This commit was manufactured by cvs2svn to create branch 'R3_2_2_patches'.
diff --git a/features/org.eclipse.jst.server_core.feature.patch/.cvsignore b/features/org.eclipse.jst.server_core.feature.patch/.cvsignore
deleted file mode 100644
index c14487c..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/features/org.eclipse.jst.server_core.feature.patch/.project b/features/org.eclipse.jst.server_core.feature.patch/.project
deleted file mode 100644
index e374a53..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server_core.feature.patch</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/features/org.eclipse.jst.server_core.feature.patch/build.properties b/features/org.eclipse.jst.server_core.feature.patch/build.properties
deleted file mode 100644
index cd1f9c4..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-src.includes = license.html,\
- feature.xml,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
diff --git a/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html b/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
deleted file mode 100644
index 6cac857..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/buildnotes_org.eclipse.jst.server_core.feature.patch.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Build" content="Build">
- <title>WTP 3.0.5 Patches</title>
-</head>
-
-<body>
-
-<h1>WTP 3.0.5 Patches</h1>
-
-<h2>org.eclipse.jst.server_core.feature</h2>
-
-<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=294664'>294664</a>. Classpath entry attributes lost when updating runtime classpath container</p>
-<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=295494'>295494</a>. RuntimeClasspathContainer should update runtime if it is null</p>
-<p>Bug <a href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=323375'>323375</a>. [backport] fix for bug 296576 in 3.0 and 3.1 branches for WTP</p>
-</body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.jst.server_core.feature.patch/eclipse_update_120.jpg b/features/org.eclipse.jst.server_core.feature.patch/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.jst.server_core.feature.patch/epl-v10.html b/features/org.eclipse.jst.server_core.feature.patch/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/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/features/org.eclipse.jst.server_core.feature.patch/feature.properties b/features/org.eclipse.jst.server_core.feature.patch/feature.properties
deleted file mode 100644
index 4d250e6..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/feature.properties
+++ /dev/null
@@ -1,152 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 IBM 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
-###############################################################################
-# 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=WTP Patch for org.eclipse.jst.server_core.feature.patch
-
-# "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=\
-Contains fixes for the following plugin(s):\n\
- org.eclipse.jst.server.core\n\
-\n\
-The fixes are described in the following bugzilla entries:\n\
-\n\
-Bug https://bugs.eclipse.org/294664 Classpath entry attributes lost when updating runtime classpath container\n\
-Bug https://bugs.eclipse.org/295494 RuntimeClasspathContainer should update runtime if it is null\n\
-Bug https://bugs.eclipse.org/323375 [backport] fix for bug 296576 in 3.0 and 3.1 branches for WTP\n\
-\n\
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2007 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM 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\
-September 27, 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/features/org.eclipse.jst.server_core.feature.patch/feature.xml b/features/org.eclipse.jst.server_core.feature.patch/feature.xml
deleted file mode 100644
index 08ab969..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/feature.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jst.server_core.feature.patch"
- label="%featureName"
- version="3.0.5.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jst.server_core.feature" version="3.0.4.v20090115-377Aq9oA55T5F8H35AC" patch="true"/>
- </requires>
-
- <plugin
- id="org.eclipse.jst.server.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.jst.server_core.feature.patch/license.html b/features/org.eclipse.jst.server_core.feature.patch/license.html
deleted file mode 100644
index 2347060..0000000
--- a/features/org.eclipse.jst.server_core.feature.patch/license.html
+++ /dev/null
@@ -1,93 +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>
-<P>January 28, 2005</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>
-<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></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/plugins/org.eclipse.jst.server.core/.classpath b/plugins/org.eclipse.jst.server.core/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/plugins/org.eclipse.jst.server.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/plugins/org.eclipse.jst.server.core/.cvsignore b/plugins/org.eclipse.jst.server.core/.cvsignore
deleted file mode 100644
index 5f50554..0000000
--- a/plugins/org.eclipse.jst.server.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-build.xml
-org.eclipse.jst.server.core_3.0.0.jar
-src.jar
-temp.folder
-@dot
-src.zip
-javaCompiler...args
diff --git a/plugins/org.eclipse.jst.server.core/.options b/plugins/org.eclipse.jst.server.core/.options
deleted file mode 100644
index c0ef0b3..0000000
--- a/plugins/org.eclipse.jst.server.core/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Debugging options for the org.eclipse.jst.server.core plugin
-
-# Turn on general debugging
-org.eclipse.jst.server.core/debug=true
-
-# Turn on general debugging
-org.eclipse.jst.server.core/publishing=false
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/.project b/plugins/org.eclipse.jst.server.core/.project
deleted file mode 100644
index 7d5e17d..0000000
--- a/plugins/org.eclipse.jst.server.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index c8be432..0000000
--- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Nov 10 17:11:35 HST 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2920850..0000000
--- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,77 +0,0 @@
-#Thu Sep 13 15:25:06 EDT 2007
-eclipse.preferences.version=1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=error
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled
-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.maxProblemPerUnit=1000
-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=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=error
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-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
-org.eclipse.jdt.core.incompatibleJDKLevel=warning
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index c39847e..0000000
--- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Feb 23 21:15:38 EST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\n<templates/>
diff --git a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 08a60e5..0000000
--- a/plugins/org.eclipse.jst.server.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Sat Apr 22 18:36:14 EDT 2006
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 0d587d5..0000000
--- a/plugins/org.eclipse.jst.server.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jst.server.core; singleton:=true
-Bundle-Version: 1.1.5.qualifier
-Bundle-Activator: org.eclipse.jst.server.core.internal.JavaServerPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.server.core,
- org.eclipse.jst.server.core.internal;x-friends:="org.eclipse.jst.server.ui",
- org.eclipse.jst.server.core.internal.cactus;x-friends:="org.eclipse.jst.server.ui"
-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.core.expressions;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.server.core;bundle-version="[1.0.304,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.1.0,2.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.jst.server.core/about.html b/plugins/org.eclipse.jst.server.core/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/plugins/org.eclipse.jst.server.core/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/plugins/org.eclipse.jst.server.core/build.properties b/plugins/org.eclipse.jst.server.core/build.properties
deleted file mode 100644
index 40ca4c9..0000000
--- a/plugins/org.eclipse.jst.server.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2007 IBM 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
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- .,\
- META-INF/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = schema/
-source.. = src/
diff --git a/plugins/org.eclipse.jst.server.core/plugin.properties b/plugins/org.eclipse.jst.server.core/plugin.properties
deleted file mode 100644
index bf40b71..0000000
--- a/plugins/org.eclipse.jst.server.core/plugin.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2008 IBM 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
-###############################################################################
-pluginName=Java Server Support
-providerName=Eclipse.org
-
-extensionPointRuntimeClasspathProviders=Runtime Classpath Providers
-extensionPointRuntimeFacetMapping=Runtime Facet Mappings
-extensionPointServerProfilers=Server Profilers
-
-runtimeTypeName=J2EE Runtime Library
-runtimeTypeDescription=A runtime that represents a set of J2EE runtime libraries.
-
-moduleTypeJ2EEWebName=J2EE Web module
-moduleTypeJ2EEEJBName=J2EE EJB module
-moduleTypeJ2EERARName=J2EE Connector module
-moduleTypeJ2EEClientName=J2EE Application Client module
-moduleTypeJ2EEEARName=J2EE Enterprise application
-moduleTypeJ2EEUtilityName=J2EE Utility jar
-
-launchableJndi=JNDI Object
-launchableJndiDescription=Silently start an object locatable by JNDI.
diff --git a/plugins/org.eclipse.jst.server.core/plugin.xml b/plugins/org.eclipse.jst.server.core/plugin.xml
deleted file mode 100644
index 17b1725..0000000
--- a/plugins/org.eclipse.jst.server.core/plugin.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
- <extension-point id="runtimeClasspathProviders" name="%extensionPointRuntimeClasspathProviders" schema="schema/runtimeClasspathProviders.exsd"/>
- <extension-point id="runtimeFacetMappings" name="%extensionPointRuntimeFacetMappings" schema="schema/runtimeFacetMappings.exsd"/>
- <extension-point id="serverProfilers" name="%extensionPointServerProfilers" schema="schema/serverProfilers.exsd"/>
- <extension-point id="internalRuntimeComponentProviders" name="internalRuntimeComponentProviders" schema="schema/internalRuntimeComponentProviders.exsd"/>
-
- <extension point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
- id="org.eclipse.jst.server.core.container"
- class="org.eclipse.jst.server.core.internal.RuntimeClasspathContainerInitializer"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.moduleTypes">
- <moduleType
- id="jst.web"
- name="%moduleTypeJ2EEWebName"/>
- <moduleType
- id="jst.ejb"
- name="%moduleTypeJ2EEEJBName"/>
- <moduleType
- id="jst.appclient"
- name="%moduleTypeJ2EEClientName"/>
- <moduleType
- id="jst.connector"
- name="%moduleTypeJ2EERARName"/>
- <moduleType
- id="jst.ear"
- name="%moduleTypeJ2EEEARName"/>
- <moduleType
- id="jst.utility"
- name="%moduleTypeJ2EEUtilityName"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.runtimeTypes">
- <runtimeType
- id="org.eclipse.jst.server.core.runtimeType"
- name="%runtimeTypeName"
- description="%runtimeTypeDescription"
- facetRuntimeComponent="org.eclipse.jst.server.core.runtimeType"
- facetRuntimeVersion="1.0"
- class="org.eclipse.jst.server.core.internal.GenericRuntime">
- <moduleType
- types="jst.*"
- versions="*"/>
- </runtimeType>
- </extension>
-
- <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders">
- <runtimeClasspathProvider
- id="org.eclipse.jst.server.core.runtimeTarget"
- runtimeTypeIds="org.eclipse.jst.server.core.runtimeType"
- class="org.eclipse.jst.server.core.internal.GenericRuntimeClasspathProvider"/>
- </extension>
-
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- namespace="org.eclipse.jst.cactus.expressions"
- type="org.eclipse.core.runtime.IAdaptable"
- class="org.eclipse.jst.server.core.internal.cactus.ServletTestCasePropertyTester"
- properties="isServletTestCase"
- id="org.eclipse.jst.server.cactus.expression"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.moduleArtifactAdapters">
- <moduleArtifactAdapter
- id="org.eclipse.jst.server.cactus.moduleArtifactAdapter"
- class="org.eclipse.jst.server.core.internal.cactus.CactusModuleArtifactAdapterDelegate"
- priority="10">
- <enablement>
- <or>
- <instanceof value="org.eclipse.jdt.core.IMethod"/>
- <instanceof value="org.eclipse.jdt.core.ICompilationUnit"/>
- <instanceof value="org.eclipse.jdt.core.IType"/>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- </or>
- </enablement>
- </moduleArtifactAdapter>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.launchableAdapters">
- <launchableAdapter
- id="org.eclipse.jst.server.cactus.launchableAdapter"
- class="org.eclipse.jst.server.core.internal.cactus.CactusLaunchableAdapterDelegate"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.clients">
- <client
- id="org.eclipse.jst.server.jndi"
- name="%launchableJndi"
- description="%launchableJndiDescription"
- priority="-100"
- launchable="org.eclipse.jst.server.core.JndiLaunchable"
- class="org.eclipse.jst.server.core.internal.J2EELaunchableClient"/>
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
- <runtime-component-type
- id="org.eclipse.jst.server.core.runtimeType"/>
-
- <runtime-component-version
- type="org.eclipse.jst.server.core.runtimeType"
- version="1.0"/>
-
- <adapter>
- <runtime-component
- id="org.eclipse.jst.server.core.runtimeType"/>
- <factory
- class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/>
- <type
- class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
- </adapter>
-
- <supported>
- <runtime-component
- id="org.eclipse.jst.server.core.runtimeType"
- version="1.0"/>
- <facet
- id="jst.web"
- version="2.2,2.3,2.4,2.5"/>
- <facet
- id="jst.ejb"
- version="1.1,2.0,2.1,3.0"/>
- <facet
- id="jst.ear"
- version="1.2,1.3,1.4,5.0"/>
- <facet
- id="jst.connector"
- version="1.0,1.5"/>
- <facet
- id="jst.appclient"
- version="1.2,1.3,1.4,5.0"/>
- <facet
- id="jst.utility"
- version="1.0"/>
- </supported>
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets">
- <default-facets>
- <runtime-component id="org.eclipse.jst.server.core.runtimeType"/>
- <facet id="wst.jsdt.web" version="1.0"/>
- </default-facets>
- </extension>
-
- <extension point="org.eclipse.wst.server.core.runtimeFacetComponentProviders">
- <runtimeComponentProvider
- id="org.eclipse.jst.server.core.JRERuntimeComponentProvider"
- runtimeTypeIds="*"
- class="org.eclipse.jst.server.core.internal.JRERuntimeComponentProvider"/>
- </extension>
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd b/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd
deleted file mode 100644
index cf481bd..0000000
--- a/plugins/org.eclipse.jst.server.core/schema/internalRuntimeComponentProviders.exsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.server.core" id="runtimeComponentProviders" name="Runtime Component Providers"/>
- </appInfo>
- <documentation>
- This extension point is internal and experimental and should not be used by downstream components.
-This extension point is used to provide new runtime components to an existing facet runtime.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="runtimeComponentProvider" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeComponentProvider">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeTypeIds" type="string" use="required">
- <annotation>
- <documentation>
- a comma separated list of runtime type ids that this provider may support. Used for memory & performance reasons
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>RuntimeClasspathProviderDelegate</samp>.
-Runtime classpath provider instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.5.1
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a runtime component provider extension point:
-
-<pre>
- <extension point="org.eclipse.jst.server.core.runtimeComponentProviders">
- <runtimeComponentProvider
- id="com.example.runtimeComponentProvider"
- runtimeTypeIds="com.example.runtime, com.example2.*"
- class="com.example.ExampleRuntimeComponentProvider"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2006 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd b/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd
deleted file mode 100644
index 90de0c1..0000000
--- a/plugins/org.eclipse.jst.server.core/schema/runtimeClasspathProviders.exsd
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.server.core" id="runtimeClasspathProviders" name="Runtime Classpath Providers"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a new runtime classpath provider. Runtime classpath providers provide the classpath for Java server runtimes.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="runtimeClasspathProvider" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeClasspathProvider">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeTypeIds" type="string" use="required">
- <annotation>
- <documentation>
- a comma separated list of runtime type ids that this provider may support. Used for memory & performance reasons
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>RuntimeClasspathProviderDelegate</samp>.
-Runtime classpath provider instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a runtime classpath provider extension point:
-
-<pre>
- <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders">
- <runtimeClasspathProvider
- id="com.example.runtimeClasspathProvider"
- runtimeTypeIds="com.example.runtime, com.example2.*"
- class="com.example.ExampleRuntimeClasspathProvider"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <b>org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate</b> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd b/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd
deleted file mode 100644
index 94d332e..0000000
--- a/plugins/org.eclipse.jst.server.core/schema/runtimeFacetMappings.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.server.core" id="runtimeFacetMappings" name="Runtime Facet Mappings"/>
- </appInfo>
- <documentation>
- This extension point is used to map between a facet runtime component and a server runtime type.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="runtimeFacetMapping" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="runtimeFacetMapping">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtimeTypeId" type="string" use="required">
- <annotation>
- <documentation>
- a runtime type id
- </documentation>
- </annotation>
- </attribute>
- <attribute name="runtime-component" type="string" use="required">
- <annotation>
- <documentation>
- a facet runtime component id
- </documentation>
- </annotation>
- </attribute>
- <attribute name="version" type="string" use="required">
- <annotation>
- <documentation>
- a facet runtime component version
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a runtime facet mapping extension point:
-
-<pre>
- <extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
- <runtimeFacetMapping
- id="com.example.runtimeClasspathProvider"
- runtimeTypeId="com.example.runtime.32"
- runtime-component="com.example.ExampleRuntimeClasspathProvider"
- version="3.2"/>
- </extension>
-</pre>
- </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) 2000, 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd b/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd
deleted file mode 100644
index 4d0b485..0000000
--- a/plugins/org.eclipse.jst.server.core/schema/serverProfilers.exsd
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jst.server.core" id="serverProfilers" name="Server Profiler"/>
- </appInfo>
- <documentation>
- This extension point is used to provide support for profiling servers.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="serverProfiler" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="serverProfiler">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translated name
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- a class that extends org.eclipse.jst.server.core.ServerProfilerDelegate
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jst.server.core.ServerProfilerDelegate"/>
- </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 a server profiler extension point:
-
-<pre>
- <extension point="org.eclipse.jst.server.core.serverProfilers">
- <serverProfiler
- id="com.example.myProfiler"
- name="My Profiler"
- vmArgs="-XpiAgent"/>
- </extension>
-</pre>
- </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 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java
deleted file mode 100644
index e6bb015..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ClasspathRuntimeTargetHandler.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate;
-/**
- * A runtime target handler that supports changing the classpath of the
- * project by adding one or more classpath containers. Runtime providers
- * can extend this class and implement the abstract methods to provide
- * the correct build path for their runtime type.
- *
- * @deprecated Should use org.eclipse.jst.server.core.runtimeClasspathProviders
- * extension point instead
- */
-public abstract class ClasspathRuntimeTargetHandler extends RuntimeTargetHandlerDelegate {
- /** (non-Javadoc)
- * @see RuntimeTargetHandlerDelegate#setRuntimeTarget(IProject, IRuntime, IProgressMonitor)
- */
- public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /** (non-Javadoc)
- * @see RuntimeTargetHandlerDelegate#removeRuntimeTarget(IProject, IRuntime, IProgressMonitor)
- */
- public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Add library entries to the given list for every jar file found in the
- * given directory. Optionally search subdirectories as well.
- *
- * @param list a list
- * @param dir a directory
- * @param includeSubdirectories <code>true</code> to include subdirectories, and
- * <code>false</code> otherwise
- */
- protected static void addLibraryEntries(List list, File dir, boolean includeSubdirectories) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Returns the classpath entries that correspond to the given runtime.
- *
- * @param runtime a runtime
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return an array of classpath entries
- */
- public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Returns the classpath entry ids for this runtime target handler. These
- * ids will be added to the classpath container id to create a new fully
- * qualified classpath container id.
- * <p>
- * By default, there is a single classpath entry for the runtime, with no
- * extra id (<code>new String[1]</code>). To create multiple ids, just
- * return a string array containing the ids. For instance, to have two
- * classpath containers with ids "id1" and "id2", use
- * <code>new String[] { "id1", "id2" }</code>
- * </p>
- *
- * @return an array of classpath entry ids
- */
- public String[] getClasspathEntryIds() {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Request that the classpath container for the given runtime and id be updated
- * with the given classpath container entries.
- *
- * @param runtime a runtime
- * @param id an id
- * @param entries an array of classpath entries
- */
- public void requestClasspathContainerUpdate(IRuntime runtime, String id, IClasspathEntry[] entries) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Returns the classpath container label for the given runtime and the given
- * classpath container id (returned from getClasspathEntryIds()). This method
- * must not return null.
- *
- * @param runtime the runtime to resolve the container label for
- * @param id the classpath entry id
- * @return a classpath container label
- */
- public abstract String getClasspathContainerLabel(IRuntime runtime, String id);
-
- /**
- * Resolve the classpath container.
- *
- * @param runtime a runtime
- * @param id a container id
- * @return a possibly empty array of classpath entries
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime, String id) {
- throw new RuntimeException("Attempt to use deprecated code");
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param runtime the runtime to resolve the container for
- * @param id the classpath entry id
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- */
- public abstract IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id);
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java
deleted file mode 100644
index 4f6e87d..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/EJBBean.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-/**
- * An EJB bean.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public class EJBBean extends ModuleArtifactDelegate {
- public final static String EJB_11 = "1.1";
- public final static String EJB_20 = "2.0";
- public final static String EJB_21 = "2.1";
- public final static String EJB_30 = "3.0";
-
- private String jndiName;
- private String interfaceName;
- private boolean local;
- private boolean remote;
- private String version;
-
- /**
- * Create a new EJBBean.
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- */
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local) {
- super(module);
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- this.version = "2.1";
- }
-
- /**
- * Create a new EJBBean with a specific version
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- * @param version the level of the EJB specification that this EJB uses. Use one of the <code>EJB_xx</code> constants declared on {@link EJBBean}
- */
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version) {
- super(module);
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- this.version = version;
- }
-
- /**
- * Create a new EJBBean with its interface name. This API is intended to be use by EJB 3.0.
- *
- * @param module the module that the EJB is contained in
- * @param jndiName the JNDI name of the EJB
- * @param remote <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- * @param local <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- * @param version the level of the EJB specification that this EJB uses. Use one of the <code>EJB_xx</code> constants declared on {@link EJBBean}
- * @param interfaceName the interface name of the EJB
- */
-
- public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version, String interfaceName) {
- super(module);
- this.jndiName = jndiName;
- this.remote = remote;
- this.local = local;
- this.version = version;
- this.interfaceName = interfaceName;
- }
-
- /**
- * Create a new empty EJBBean.
- */
- public EJBBean() {
- super();
- }
-
- /**
- * Returns the JNDI name of the EJB.
- *
- * @return the JNDI name of the EJB
- */
- public String getJndiName() {
- return jndiName;
- }
-
- /**
- * Returns whether the EJB has a remote interface.
- *
- * @return <code>true</code> if the EJB has a remote interface, and
- * <code>false</code> otherwise
- */
- public boolean hasRemoteInterface() {
- return remote;
- }
-
- /**
- * Returns whether the EJB has a local interface.
- *
- * @return <code>true</code> if the EJB has a local interface, and
- * <code>false</code> otherwise
- */
- public boolean hasLocalInterface() {
- return local;
- }
-
- /**
- * Returns the level of the specification of the EJB
- *
- * @return the level of the specification of the EJB
- */
- public String getVersion() {
- return version;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- String ejbName;
- // EJB 2.0 don't have an inteface name, but they set the jndi name
- if (interfaceName != null && !(interfaceName.length()<=0)){
- ejbName = interfaceName;
- }
- else{
- ejbName = jndiName;
- }
- return NLS.bind(Messages.artifactEJB, ejbName);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- if ('T' == s.charAt(ind+2))
- local = true;
- else
- local = false;
- if ('T' == s.charAt(ind+3))
- remote = true;
- else
- remote = false;
- jndiName = s.substring(ind+4);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- if (local)
- sb.append("T");
- else
- sb.append("F");
- if (remote)
- sb.append("T");
- else
- sb.append("F");
- sb.append(jndiName);
- return sb.toString();
- }
-
- /**
- * Gets the name of interface represented by this object
- * @return
- */
- public String getInterfaceName() {
- return interfaceName;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java
deleted file mode 100644
index 201dc78..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/FacetUtil.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-/**
- * Utility class for converting between facet runtimes and server runtimes.
- * <p>
- * This class provides all its functionality through static members.
- * It is not intended to be subclassed or instantiated.
- * </p>
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- */
-public final class FacetUtil {
- /**
- * Static utility class - cannot create an instance.
- */
- private FacetUtil() {
- // can't create
- }
-
- /**
- * Returns the server runtime that corresponds to a facet runtime, or null
- * if none could be found.
- *
- * @param runtime a facet runtime
- * @return the server runtime that corresponds to the facet runtime, or
- * <code>null</code> if none could be found.
- */
- public static IRuntime getRuntime(org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime) {
- return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime);
- }
-
- /**
- * Returns the facet runtime that corresponds to a server runtime, or null
- * if none could be found.
- *
- * @param runtime a server runtime
- * @return the facet runtime that corresponds to the server runtime, or
- * <code>null</code> if none could be found.
- */
- public static org.eclipse.wst.common.project.facet.core.runtime.IRuntime getRuntime(IRuntime runtime) {
- return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime);
- }
-
- /**
- * Tests whether the facets on a project are supported by a given server. Returns
- * an OK status if the server's runtime supports the project's facets, and an
- * ERROR status (with message) if it doesn't.
- *
- * @param project a project
- * @param server a server
- * @return OK status if the server's runtime supports the project's facets, and an
- * ERROR status (with message) if it doesn't
- */
- public static final IStatus verifyFacets(IProject project, IServer server) {
- return org.eclipse.wst.server.core.internal.facets.FacetUtil.verifyFacets(project, server);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java
deleted file mode 100644
index 03570e1..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IApplicationClientModule.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-/**
- * A J2EE application client module.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IApplicationClientModule extends IJ2EEModule {
- // intentionally empty
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java
deleted file mode 100644
index d836725..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IConnectorModule.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.runtime.IPath;
-/**
- * A J2EE connector module.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IConnectorModule extends IJ2EEModule {
- /**
- * Returns the classpath as an array of absolute IPaths.
- *
- * @return an array of classpath entries
- */
- public IPath[] getClasspath();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java
deleted file mode 100644
index f610656..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEJBModule.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-/**
- * A representation of a J2EE EJB module.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IEJBModule extends IJ2EEModule {
- // intentionally empty
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java
deleted file mode 100644
index 7ea1d77..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IEnterpriseApplication.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.wst.server.core.IModule;
-/**
- * A representation of a J2EE enterprise application (EAR file).
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IEnterpriseApplication {
- /**
- * Returns the modules contained within this EAR. The returned modules will
- * either be J2EE modules (which will be adaptable to IJ2EEModule) or
- * utility jars contained in the EAR.
- *
- * @return a possibly empty array of modules contained within this application
- */
- public IModule[] getModules();
-
- /**
- * Returns the URI of the given module within this enterprise application.
- *
- * @param module a module within this application
- * @return the URI of the given module, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(IModule module);
-
- /**
- * Returns the root folders for the resources in this module.
- *
- * @return a possibly-empty array of resource folders
- */
- public IContainer[] getResourceFolders();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java
deleted file mode 100644
index b4d974b..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJ2EEModule.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IContainer;
-/**
- * A J2EE module that can be deployed to a server.
- *
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IJ2EEModule {
- /**
- * Returns the root folders for the resources in this module. Returns an empty
- * array if this is a binary module.
- *
- * @return a possibly-empty array of resource folders
- */
- public IContainer[] getResourceFolders();
-
- /**
- * Returns the root folders containing Java output in this module. Returns an
- * empty array if this is a binary module.
- *
- * @return a possibly-empty array of Java output folders
- */
- public IContainer[] getJavaOutputFolders();
-
- /**
- * Returns true if this is a binary (zipped) module, and
- * false if it is expanded.
- *
- * <p>If true, members() should return only a single element -
- * the binary (jar or zip file) that contains the contents of
- * this module. (a single IModuleResource, e.g.
- * myejb.jar) Also, getLocation() should return the full path
- * up to and including the binary itself. (e.g.
- * c:\temp\myejb.jar)</p>
- *
- * <p>If false, members() should return the entire contents
- * of the module, starting at the root. There should be no
- * preceeding directory structure. (an array of
- * IModuleResources, e.g. index.html, WEB-INF/web.xml,
- * ...) In this case, getLocation() should return the path to
- * the root folder containing these resources.</p>
- *
- * @return boolean
- */
- public boolean isBinary();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java
deleted file mode 100644
index 6a51693..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntime.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- * An interface for a server that contains a Java runtime.
- * <p>
- * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @since 3.0
- */
-public interface IJavaRuntime {
- /**
- * Return the VM install (installed JRE) that this runtime is using.
- *
- * @return the current VM install
- */
- public IVMInstall getVMInstall();
-
- /**
- * Returns <code>true</code> if the runtime is using the default JRE.
- *
- * @return <code>true</code> if the runtime is using the default JRE,
- * and <code>false</code> otherwise
- * @since 2.0
- */
- public boolean isUsingDefaultJRE();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java
deleted file mode 100644
index 7bc627c..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IJavaRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jdt.launching.IVMInstall;
-/**
- * An interface for a server that contains a Java runtime.
- * <p>
- * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @since 3.0
- */
-public interface IJavaRuntimeWorkingCopy extends IJavaRuntime {
- /**
- * Set the VM install (installed JRE) that this runtime is using.
- * Use <code>null</code> to use the Eclipse default JRE.
- *
- * @param vmInstall the VM install to use
- */
- public void setVMInstall(IVMInstall vmInstall);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java
deleted file mode 100644
index f013f69..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IUtilityModule.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.resources.IContainer;
-/**
- * A J2EE utility module that can be deployed to a server.
- *
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IUtilityModule {
- /**
- * Returns the root folders for the resources in this module.
- *
- * @return a possibly-empty array of resource folders
- */
- public IContainer[] getResourceFolders();
-
- /**
- * Returns the root folders containing Java output in this module.
- *
- * @return a possibly-empty array of Java output folders
- */
- public IContainer[] getJavaOutputFolders();
-
- /**
- * Returns true if this is a binary (zipped) module, and
- * false if it is expanded.
- *
- * <p>If true, members() should return only a single element -
- * the binary (jar or zip file) that contains the contents of
- * this module. (a single IModuleResource, e.g.
- * myejb.jar) Also, getLocation() should return the full path
- * up to and including the binary itself. (e.g.
- * c:\temp\myejb.jar)</p>
- *
- * <p>If false, members() should return the entire contents
- * of the module, starting at the root. There should be no
- * preceeding directory structure. (an array of
- * IModuleResources, e.g. index.html, WEB-INF/web.xml,
- * ...) In this case, getLocation() should return the path to
- * the root folder containing these resources.</p>
- *
- * @return boolean
- */
- public boolean isBinary();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java
deleted file mode 100644
index 6f22061..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/IWebModule.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.wst.server.core.IModule;
-/**
- * A J2EE web module.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public interface IWebModule extends IJ2EEModule {
- /**
- * Returns the context root of the module.
- *
- * @return java.lang.String
- */
- public String getContextRoot();
-
- /**
- * Returns the context root of the module. If the the webModule belongs to an earModule, the context root with higher
- * presedence will be returned.
- *
- * @param earModule The EARModule if exist, if not null
- * @return java.lang.String
- */
- public String getContextRoot(IModule earModule);
-
- /**
- * Returns the utility modules contained within this WAR.
- *
- * @return a possibly empty array of modules contained within this application
- */
- public IModule[] getModules();
-
- /**
- * Returns the URI of the given contained module.
- *
- * @param module a module
- * @return the URI of the given module, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(IModule module);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java
deleted file mode 100644
index db5304c..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiLaunchable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.util.Properties;
-/**
- * A representation of an object in JNDI that can be tested on a server.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public class JndiLaunchable {
- private Properties props;
- private String jndiName;
-
- /**
- * Create a reference to an object that is launchable via JNDI.
- *
- * @param props the JNDI properties required to connect to the object
- * @param jndiName the JNDI name of the object
- */
- public JndiLaunchable(Properties props, String jndiName) {
- this.jndiName = jndiName;
- this.props = props;
- }
-
- /**
- * Returns the JNDI properties required to connect to the object.
- *
- * @return the JNDI properties required to connect to the object
- */
- public Properties getProperties() {
- return props;
- }
-
- /**
- * Returns the JNDI name of the object.
- *
- * @return the JNDI name of the object
- */
- public String getJNDIName() {
- return jndiName;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java
deleted file mode 100644
index f02e922..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/JndiObject.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-/**
- * A representation of an object in JNDI that can be tested on a server.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public class JndiObject extends ModuleArtifactDelegate {
- private String jndiName;
-
- /**
- * Create a reference to an object in JNDI.
- *
- * @param module the module that the object is contained in
- * @param jndiName the JNDI name of the object
- */
- public JndiObject(IModule module, String jndiName) {
- super(module);
- this.jndiName = jndiName;
- }
-
- /**
- * Create an empty reference to an object in JNDI.
- */
- public JndiObject() {
- super();
- }
-
- /**
- * Return the JNDI name of the object.
- *
- * @return the JNDI name of the object
- */
- public String getJndiName() {
- return jndiName;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- return NLS.bind(Messages.artifactJNDI, jndiName);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- jndiName = s.substring(ind+2);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- sb.append(jndiName);
- return sb.toString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java
deleted file mode 100644
index 794a15b..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/PublishUtil.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.io.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.jst.server.core.internal.Trace;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-/**
- * Utility class with an assortment of useful file methods.
- * <p>
- * This class provides all its functionality through static members.
- * It is not intended to be subclassed or instantiated.
- * </p>
- * <p>
- * <b>Note:</b> Adopters should use the equivalent class in
- * org.eclipse.wst.server.core.util instead. This class will eventually
- * be deprecated.
- * </p>
- */
-public final class PublishUtil {
- // size of the buffer
- private static final int BUFFER = 65536;
-
- // the buffer
- private static byte[] buf = new byte[BUFFER];
-
- /**
- * PublishUtil cannot be created. Use static methods.
- */
- private PublishUtil() {
- // can't create
- }
-
- /**
- * Copy a file from a to b. Closes the input stream after use.
- *
- * @param in java.io.InputStream
- * @param to java.lang.String
- * @deprecated Unused - will be removed.
- * @return a status
- */
- public static IStatus copyFile(InputStream in, String to) {
- OutputStream out = null;
-
- try {
- out = new FileOutputStream(to);
-
- int avail = in.read(buf);
- while (avail > 0) {
- out.write(buf, 0, avail);
- avail = in.read(buf);
- }
- return Status.OK_STATUS;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error copying file", e);
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception ex) {
- // ignore
- }
- try {
- if (out != null)
- out.close();
- } catch (Exception ex) {
- // ignore
- }
- }
- }
-
- /**
- * Smart copy the given module resources to the given path.
- *
- * @param resources
- * @param path
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException
- * @deprecated This method only returns a single error in the case of failure. Use publishSmart() instead.
- */
- public static void smartCopy(IModuleResource[] resources, IPath path, IProgressMonitor monitor) throws CoreException {
- IStatus[] status = PublishUtil.publishSmart(resources, path, monitor);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- * Handle a delta publish.
- *
- * @param kind
- * @param path
- * @param delta
- * @throws CoreException
- * @deprecated This method only returns a single error in the case of failure. Use publishDelta() instead.
- */
- public static void handleDelta(int kind, IPath path, IModuleResourceDelta delta) throws CoreException {
- IStatus[] status = PublishUtil.publishDelta(delta, path, null);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- *
- * @param path
- * @param file
- * @deprecated does not fail or return status if delete doesn't work
- */
- protected static void deleteFile(IPath path, IModuleFile file) {
- Trace.trace(Trace.PUBLISHING, "Deleting: " + file.getName() + " from " + path.toString());
- IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
- path2.toFile().delete();
- }
-
- /**
- *
- * @param resources
- * @param path
- * @throws CoreException
- * @deprecated This method only returns a single error in the case of failure. Use publishFull() instead
- */
- public static void copy(IModuleResource[] resources, IPath path) throws CoreException {
- IStatus[] status = PublishUtil.publishFull(resources, path, null);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- * Creates a new zip file containing the given module resources. Deletes the existing file
- * (and doesn't create a new one) if resources is null or empty.
- *
- * @param resources
- * @param zipPath
- * @throws CoreException
- */
- public static void createZipFile(IModuleResource[] resources, IPath zipPath) throws CoreException {
- IStatus[] status = PublishUtil.publishZip(resources, zipPath, null);
- if (status != null && status.length > 0)
- throw new CoreException(status[0]);
- }
-
- /**
- * Utility method to recursively delete a directory.
- *
- * @param dir a directory
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] deleteDirectory(File dir, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.deleteDirectory(dir, monitor);
- }
-
- /**
- * Smart copy the given module resources to the given path.
- *
- * @param resources an array of module resources
- * @param path an external path to copy to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishSmart(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishSmart(resources, path, monitor);
- }
-
- /**
- * Handle a delta publish.
- *
- * @param delta a module resource delta
- * @param path the path to publish to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishDelta(IModuleResourceDelta[] delta, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor);
- }
-
- /**
- * Handle a delta publish.
- *
- * @param delta a module resource delta
- * @param path the path to publish to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishDelta(IModuleResourceDelta delta, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor);
- }
-
- /**
- * Publish the given module resources to the given path.
- *
- * @param resources an array of module resources
- * @param path a path to publish to
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishFull(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishFull(resources, path, monitor);
- }
-
- /**
- * Creates a new zip file containing the given module resources. Deletes the existing file
- * (and doesn't create a new one) if resources is null or empty.
- *
- * @param resources an array of module resources
- * @param path the path where the zip file should be created
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly-empty array of error and warning status
- */
- public static IStatus[] publishZip(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
- return org.eclipse.wst.server.core.util.PublishUtil.publishZip(resources, path, monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
deleted file mode 100644
index a0b2a6a..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/RuntimeClasspathProviderDelegate.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2010 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import java.io.File;
-import java.util.*;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathAttribute;
-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.jst.server.core.internal.IMemento;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-import org.eclipse.jst.server.core.internal.RuntimeClasspathContainer;
-import org.eclipse.jst.server.core.internal.Trace;
-import org.eclipse.jst.server.core.internal.XMLMemento;
-import org.eclipse.wst.server.core.IRuntime;
-/**
- * A runtime classpath provider provides the classpath for a Java server runtime.
- * This provider is scoped by runtime type and may provide the classpath for multiple
- * runtime instances.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>runtimeClasspathProviders</code> extension point.
- * </p>
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- *
- * @plannedfor 3.0
- */
-public abstract class RuntimeClasspathProviderDelegate {
- protected class SourceAttachmentUpdate {
- String runtimeId;
- IPath entry;
- IPath sourceAttachmentPath;
- IPath sourceAttachmentRootPath;
- IClasspathAttribute[] attributes;
- }
-
- private List<SourceAttachmentUpdate> sourceAttachments;
-
- private String extensionId;
-
- private Map<String, IPath> runtimePathMap = Collections.synchronizedMap(new HashMap<String, IPath>());
-
- private Map<String, Integer> previousClasspath = Collections.synchronizedMap(new HashMap<String, Integer>());
-
- public RuntimeClasspathProviderDelegate() {
- // default constructor
- }
-
- /**
- * Initializes this classpath provider with its life-long id.
- * <p>
- * This method is called by the framework.
- * Clients should never call this method.
- * </p>
- * @param id the extension id
- */
- public final void initialize(String id) {
- extensionId = id;
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param runtime the runtime to resolve the container for
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- * @deprecated use resolveClasspathContainer(IProject, IRuntime) instead
- */
- public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime) {
- return null;
- }
-
- /**
- * Resolves (creates the classpath entries for) the classpath container with
- * the given runtime and the given classpath container id (returned from
- * getClasspathEntryIds()). If the classpath container cannot be resolved
- * (for instance, if the runtime does not exist), return null.
- *
- * @param project the project to resolve
- * @param runtime the runtime to resolve the container for
- * @return an array of classpath entries for the container, or null if the
- * container could not be resolved
- */
- public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) {
- return null;
- }
-
- /**
- * Resolve the classpath container.
- *
- * @param runtime a runtime
- * @return a possibly empty array of classpath entries
- * @deprecated should use resolveClasspathContainerImpl(IProject, IRuntime) instead
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime) {
- return resolveClasspathContainerImpl(null, runtime);
- }
-
- /**
- * Resolve the classpath container.
- *
- * @param project a project
- * @param runtime a runtime
- * @return a possibly empty array of classpath entries
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime) {
- if (runtime == null)
- return new IClasspathEntry[0];
- runtimePathMap.put(runtime.getId(), runtime.getLocation());
- IClasspathEntry[] entries = resolveClasspathContainer(project, runtime);
- if (entries == null)
- entries = resolveClasspathContainer(runtime);
-
- if (entries == null)
- entries = new IClasspathEntry[0];
-
- if (sourceAttachments == null)
- load();
-
- int size = entries.length;
- int size2 = sourceAttachments.size();
- for (int i = 0; i < size; i++) {
- for (int j = 0; j < size2; j++) {
- SourceAttachmentUpdate sau = sourceAttachments.get(j);
- if (sau.runtimeId.equals(runtime.getId()) && sau.entry.equals(entries[i].getPath())) {
- IClasspathAttribute[] consolidatedClasspathAttributes = consolidateClasspathAttributes(sau.attributes, entries[i].getExtraAttributes());
- entries[i] = JavaCore.newLibraryEntry(entries[i].getPath(), sau.sourceAttachmentPath, sau.sourceAttachmentRootPath, entries[i].getAccessRules(), consolidatedClasspathAttributes, false);
- }
- }
- }
-
- String key = project.getName() + "/" + runtime.getId();
- if (!previousClasspath.containsKey(key))
- previousClasspath.put(key, new Integer(entries.length));
- else {
- Integer previousEntries = previousClasspath.get(key);
-
- if ((previousEntries == null) || (previousEntries.intValue() != entries.length)) {
- Trace.trace(Trace.FINEST, "Classpath update: " + key + " " + entries);
- previousClasspath.put(key, new Integer(entries.length));
-
- IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER);
- path = path.append(extensionId).append(runtime.getId());
- try {
- IJavaProject javaProject = JavaCore.create(project);
- JavaCore.setClasspathContainer(path, new IJavaProject[] { javaProject },
- new IClasspathContainer[] { null }, new NullProgressMonitor());
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error updating classpath", e);
- }
- }
- }
-
- return entries;
- }
-
- /*
- * Returns true if there are any changes in the runtime since the last time that the
- * classpath was resolved which may affect the classpath, and false otherwise. This
- * method is used to check projects when a runtime changes and automatically rebuild
- * them if necessary.
- *
- * @param runtime a runtime
- * @return <code>true</code> if the classpath may change due to a change in the runtime,
- * and <code>false</code> if there are no changes
- */
- public boolean hasRuntimeClasspathChanged(IRuntime runtime) {
- try {
- IPath path = runtimePathMap.get(runtime.getId());
- return (path != null && !path.equals(runtime.getLocation()));
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-
- private static void addJarFiles(File dir, List<IClasspathEntry> list, boolean includeSubdirectories) {
- int depth = 0;
- if (includeSubdirectories)
- depth = 2;
- addJarFiles(dir, list, depth);
- }
-
- private static void addJarFiles(File dir, List<IClasspathEntry> list, int depth) {
- if (dir == null)
- throw new IllegalArgumentException();
-
- File[] files = dir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory() && depth > 0) {
- addJarFiles(file, list, depth - 1);
- } else if (file.getAbsolutePath().endsWith(".jar") || file.getAbsolutePath().endsWith(".zip")) {
- IPath path = new Path(file.getAbsolutePath());
- list.add(JavaCore.newLibraryEntry(path, null, null));
- }
- }
- }
- }
-
- /**
- * Add library entries to the given list for every jar file found in the
- * given directory. Optionally search subdirectories as well.
- *
- * @param list a list
- * @param dir a directory
- * @param includeSubdirectories <code>true</code> to include subdirectories, and
- * <code>false</code> otherwise
- */
- protected static void addLibraryEntries(List<IClasspathEntry> list, File dir, boolean includeSubdirectories) {
- if (dir == null)
- throw new IllegalArgumentException();
- addJarFiles(dir, list, includeSubdirectories);
- }
-
- /**
- * Request that the classpath container for the given runtime and id be updated
- * with the given classpath container entries.
- *
- * @param runtime a runtime
- * @param entries an array of classpath entries
- */
- public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) {
- // default behaviour is to save the source path entries
- if (runtime == null || entries == null)
- return;
-
- // find the source attachments
- sourceAttachments = new ArrayList<SourceAttachmentUpdate>();
-
- for (IClasspathEntry entry : entries) {
- if (entry.getSourceAttachmentPath() != null || entry.getExtraAttributes() != null) {
- SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
- sau.runtimeId = runtime.getId();
- sau.entry = entry.getPath();
- sau.sourceAttachmentPath = entry.getSourceAttachmentPath();
- sau.sourceAttachmentRootPath = entry.getSourceAttachmentRootPath();
- sau.attributes = entry.getExtraAttributes();
- sourceAttachments.add(sau);
- }
- }
- save();
- }
-
- /**
- * Load source attachment info.
- */
- private void load() {
- sourceAttachments = new ArrayList<SourceAttachmentUpdate>();
-
- String id = extensionId;
- String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
- if (!(new File(filename)).exists())
- return;
-
- try {
- IMemento memento = XMLMemento.loadMemento(filename);
-
- IMemento[] children = memento.getChildren("source-attachment");
- for (IMemento child : children) {
- try {
- SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
- sau.runtimeId = child.getString("runtime-id");
- String temp = child.getString("entry");
- if (temp != null)
- sau.entry = new Path(temp);
- temp = child.getString("source-attachment-path");
- if (temp != null)
- sau.sourceAttachmentPath = new Path(temp);
- temp = child.getString("source-attachment-root-path");
- if (temp != null)
- sau.sourceAttachmentRootPath = new Path(temp);
- IMemento[] attrChildren = child.getChildren("attribute");
- if (attrChildren != null) {
- int size2 = attrChildren.length;
- sau.attributes = new IClasspathAttribute[size2];
- for (int j = 0; j < size2; j++) {
- String name = attrChildren[j].getString("name");
- String value = attrChildren[j].getString("value");
- sau.attributes[j] = JavaCore.newClasspathAttribute(name, value);
- }
- }
- sourceAttachments.add(sau);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load source attachment: " + e);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load source path info", e);
- }
- }
-
- /**
- * Save source attachment info.
- */
- private void save() {
- if (sourceAttachments == null)
- return;
- String id = extensionId;
- String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("classpath");
-
- Iterator iterator = sourceAttachments.iterator();
- while (iterator.hasNext()) {
- SourceAttachmentUpdate sau = (SourceAttachmentUpdate) iterator.next();
- IMemento child = memento.createChild("source-attachment");
- child.putString("runtime-id", sau.runtimeId);
- if (sau.entry != null)
- child.putString("entry", sau.entry.toPortableString());
- if (sau.sourceAttachmentPath != null)
- child.putString("source-attachment-path", sau.sourceAttachmentPath.toPortableString());
- if (sau.sourceAttachmentRootPath != null)
- child.putString("source-attachment-root-path", sau.sourceAttachmentRootPath.toPortableString());
- if (sau.attributes != null) {
- for (IClasspathAttribute attr : sau.attributes) {
- IMemento attrChild = child.createChild("attribute");
- attrChild.putString("name", attr.getName());
- attrChild.putString("value", attr.getValue());
- }
- }
- }
-
- memento.saveToFile(filename);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving source path info", e);
- }
- }
-
- public IClasspathAttribute[] consolidateClasspathAttributes(IClasspathAttribute[] sourceAttachmentAttributes, IClasspathAttribute[] classpathEntryAttributes) {
- List classpathAttributeList = new ArrayList();
- classpathAttributeList.addAll(Arrays.asList(sourceAttachmentAttributes));
- for (int i = 0; i < classpathEntryAttributes.length; i++) {
- boolean attributeCollision = false;
- for (int j = 0; j < sourceAttachmentAttributes.length; j++) {
- String name = classpathEntryAttributes[i].getName();
- if(name != null && name.equals(sourceAttachmentAttributes[j].getName())) {
- attributeCollision = true;
- break;
- }
- }
- if(!attributeCollision) {
- classpathAttributeList.add(classpathEntryAttributes[i]);
- }
- }
- return (IClasspathAttribute[]) classpathAttributeList.toArray(new IClasspathAttribute[classpathAttributeList.size()]);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java
deleted file mode 100644
index 86f0dc8..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/ServerProfilerDelegate.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.jst.server.core.internal.JavaServerPlugin;
-/**
- * A server profiler delegate.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- */
-public abstract class ServerProfilerDelegate {
- /**
- * Create a new server profiler delegate. This class must have a public default constructor.
- */
- public ServerProfilerDelegate() {
- // ignore
- }
-
- /**
- * Processes the Java launch configuration about to be run to support profiling.
- * VM args or environment variables can be set to allow profiling.
- *
- * @param launch the launch
- * @param vmInstall the vm install being run against
- * @param vmConfig the configuration to process
- * @param monitor a progress monitor
- * @throws CoreException if there is a problem during configuration
- */
- public abstract void process(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Processes the Java launch configuration about to be run to support profiling.
- * VM args or environment variables can be set to allow profiling.
- *
- * @param launch the launch
- * @param vmInstall the vm install being run against
- * @param vmConfig the configuration to process
- * @param monitor a progress monitor
- * @throws CoreException if there are no profilers configured or there is a problem
- * configuring the launch
- */
- public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException {
- JavaServerPlugin.configureProfiling(launch, vmInstall, vmConfig, monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java
deleted file mode 100644
index b3cc4dc..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/Servlet.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-/**
- * A J2EE Servlet.
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- * @plannedfor 3.0
- */
-public class Servlet extends ModuleArtifactDelegate {
- private String className;
- private String alias;
-
- /**
- * Create a reference to a servlet.
- *
- * @param module the module that the servlet is contained in
- * @param className the class name of the servlet
- * @param alias the servlet's alias
- */
- public Servlet(IModule module, String className, String alias) {
- super(module);
- this.className = className;
- this.alias = alias;
- }
-
- /**
- * Create a new empty servlet.
- */
- public Servlet() {
- super();
- }
-
- /**
- * Return the class name of the servlet.
- *
- * @return the class name of the servlet
- */
- public String getServletClassName() {
- return className;
- }
-
- /**
- * Return the servlet's alias.
- *
- * @return the servlet's alias
- */
- public String getAlias() {
- return alias;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- return NLS.bind(Messages.artifactServlet, className);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- s = s.substring(ind+2);
- ind = s.indexOf("//");
- className = s.substring(0, ind);
- alias = s.substring(ind+2);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- sb.append(className);
- sb.append("//");
- sb.append(alias);
- return sb.toString();
- }
-
- /**
- * @see Object#toString()
- */
- public String toString() {
- return "Servlet [module=" + getModule() + ", class=" + className + ", alias=" + alias + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java
deleted file mode 100644
index 264fcaa..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntime.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-/**
- *
- */
-public class GenericRuntime extends RuntimeDelegate implements IGenericRuntime, IGenericRuntimeWorkingCopy {
- protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id";
- protected static final String PROP_VM_INSTALL_ID = "vm-install-id";
-
- /**
- * Create a new generic runtime.
- */
- public GenericRuntime() {
- // do nothing
- }
-
- protected String getVMInstallTypeId() {
- return getAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- }
-
- protected String getVMInstallId() {
- return getAttribute(PROP_VM_INSTALL_ID, (String)null);
- }
-
- /**
- * Returns <code>true</code> if the runtime is using the default JRE.
- *
- * @return <code>true</code> if the runtime is using the default JRE,
- * and <code>false</code> otherwise
- */
- public boolean isUsingDefaultJRE() {
- return getVMInstallTypeId() == null;
- }
-
- /**
- * @see IGenericRuntime#getVMInstall()
- */
- public IVMInstall getVMInstall() {
- if (getVMInstallTypeId() == null)
- return JavaRuntime.getDefaultVMInstall();
- try {
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId());
- IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
- String id = getVMInstallId();
- for (IVMInstall vmInst : vmInstalls) {
- if (id.equals(vmInst.getId()))
- return vmInst;
- }
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- /**
- * @see RuntimeDelegate#validate()
- */
- public IStatus validate() {
- IStatus status = super.validate();
- if (!status.isOK())
- return status;
-
- IRuntime runtime = getRuntime();
-
- IPath path = runtime.getLocation();
- if (!path.toFile().exists())
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorLocation, null);
- else if (getVMInstall() == null)
- return new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorJRE, null);
- else
- return Status.OK_STATUS;
- }
-
- /**
- * @see IGenericRuntimeWorkingCopy#setVMInstall(IVMInstall)
- */
- public void setVMInstall(IVMInstall vmInstall) {
- if (vmInstall == null) {
- setVMInstall(null, null);
- } else
- setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
- }
-
- protected void setVMInstall(String typeId, String id) {
- if (typeId == null)
- setAttribute(PROP_VM_INSTALL_TYPE_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_TYPE_ID, typeId);
-
- if (id == null)
- setAttribute(PROP_VM_INSTALL_ID, (String)null);
- else
- setAttribute(PROP_VM_INSTALL_ID, id);
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java
deleted file mode 100644
index 862bb64..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeClasspathProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- *
- */
-public class GenericRuntimeClasspathProvider extends RuntimeClasspathProviderDelegate {
- /** (non-Javadoc)
- * @see RuntimeClasspathProviderDelegate#resolveClasspathContainer(IProject, IRuntime)
- */
- public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) {
- IPath installPath = runtime.getLocation();
-
- if (installPath == null)
- return new IClasspathEntry[0];
-
- List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- addLibraryEntries(list, installPath.toFile(), false);
- return list.toArray(new IClasspathEntry[list.size()]);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java
deleted file mode 100644
index d5fbb11..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/GenericRuntimeUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.wst.server.core.IRuntime;
-/**
- * Utility methods for the generic J2EE runtime.
- */
-public class GenericRuntimeUtil {
- protected static final String RUNTIME_TYPE_ID = "org.eclipse.jst.server.core.runtimeType";
-
- /**
- * Cannot create GenericRuntimeUtil - use static methods.
- */
- private GenericRuntimeUtil() {
- // can't create
- }
-
- /**
- * Returns <code>true</code> if the given runtime is a generic J2EE runtime, and
- * <code>false</code> otherwise. The runtime may not be null.
- *
- * @param runtime
- * @return <code>true</code> if
- */
- public static boolean isGenericJ2EERuntime(IRuntime runtime) {
- if (runtime == null)
- throw new IllegalArgumentException();
-
- return (runtime.getRuntimeType() != null &&
- runtime.getRuntimeType().getId().startsWith(RUNTIME_TYPE_ID));
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java
deleted file mode 100644
index 9a4bd31..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntime.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.jst.server.core.IJavaRuntime;
-/**
- *
- */
-public interface IGenericRuntime extends IJavaRuntime {
- // no additional methods
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java
deleted file mode 100644
index 36c1965..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IGenericRuntimeWorkingCopy.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.jst.server.core.IJavaRuntimeWorkingCopy;
-/**
- *
- */
-public interface IGenericRuntimeWorkingCopy extends IGenericRuntime, IJavaRuntimeWorkingCopy {
- // no new methods
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java
deleted file mode 100644
index 8c0d1f1..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/IMemento.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IMemento {
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java
deleted file mode 100644
index a3fa50b..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EELaunchableClient.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jst.server.core.JndiLaunchable;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.ClientDelegate;
-/**
- *
- */
-public class J2EELaunchableClient extends ClientDelegate {
- /*
- * @see ClientDelegate#supports(ILaunchable)
- */
- public boolean supports(IServer server, Object launchable, String launchMode) {
- return (launchable instanceof JndiLaunchable);
- }
-
- /*
- * @see ClientDelegate#launch(ILaunchable)
- */
- public IStatus launch(IServer server, Object launchable, String launchMode, ILaunch launch) {
- Trace.trace(Trace.FINEST, "JNDI client launched");
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java
deleted file mode 100644
index 2bbf8e9..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/J2EEUtil.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.server.core.IEnterpriseApplication;
-import org.eclipse.jst.server.core.IJ2EEModule;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.ServerUtil;
-/**
- * Utility class for dealing with J2EE modules.
- */
-public class J2EEUtil {
- private static final String EAR_MODULE = "jst.ear";
- private static final String WEB_MODULE = "jst.web";
-
- private static final IModule[] EMPTY_LIST = new IModule[0];
- private static Map<IModule, List<IModule>> earCache;
- private static Map<IJ2EEModule, List<IModule>> earCache2;
- private static Map<IModule, List<IModule>> webCache;
- protected static String cache;
-
- /**
- * Returns the enterprise applications that the module is contained within.
- *
- * @param module a J2EE module
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly empty array of enterprise applications
- */
- public static IModule[] getEnterpriseApplications(IJ2EEModule module, IProgressMonitor monitor) {
- if (shouldUseCache()) {
- List<IModule> list = earCache2.get(module);
- if (list == null)
- return EMPTY_LIST;
- return list.toArray(new IModule[list.size()]);
- }
-
- List<IModule> list = new ArrayList<IModule>();
- IModule[] modules = ServerUtil.getModules(EAR_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor);
- if (ear != null) {
- IModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- for (IModule m : modules2) {
- if (module.equals(m.loadAdapter(IJ2EEModule.class, monitor)))
- list.add(module2);
- }
- }
- }
- }
- }
-
- return list.toArray(new IModule[list.size()]);
- }
-
- /**
- * Returns the enterprise applications that the module is contained within.
- *
- * @param module a J2EE module or utility module
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly empty array of enterprise applications
- */
- public static IModule[] getEnterpriseApplications(IModule module, IProgressMonitor monitor) {
- if (shouldUseCache()) {
- List<IModule> list = earCache.get(module);
- if (list == null)
- return EMPTY_LIST;
- return list.toArray(new IModule[list.size()]);
- }
-
- List<IModule> list = new ArrayList<IModule>();
- IModule[] modules = ServerUtil.getModules(EAR_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor);
- if (ear != null) {
- IModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- for (IModule m : modules2) {
- if (module.equals(m))
- list.add(module2);
- }
- }
- }
- }
- }
-
- return list.toArray(new IModule[list.size()]);
- }
-
- /**
- * Returns the web modules that the utility module is contained within.
- *
- * @param module a utility module
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @return a possibly empty array of web modules
- */
- public static IModule[] getWebModules(IModule module, IProgressMonitor monitor) {
- if (shouldUseCache()) {
- List<IModule> list = webCache.get(module);
- if (list == null)
- return EMPTY_LIST;
- return list.toArray(new IModule[list.size()]);
- }
-
- List<IModule> list = new ArrayList<IModule>();
- IModule[] modules = ServerUtil.getModules(WEB_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor);
- if (web != null) {
- IModule[] modules2 = web.getModules();
- if (modules2 != null) {
- for (IModule m : modules2) {
- if (module.equals(m))
- list.add(module2);
- }
- }
- }
- }
- }
-
- return list.toArray(new IModule[list.size()]);
- }
-
- private static void fillCache(IProgressMonitor monitor) {
- earCache = new HashMap<IModule, List<IModule>>();
- earCache2 = new HashMap<IJ2EEModule, List<IModule>>();
- webCache = new HashMap<IModule, List<IModule>>();
-
- IModule[] modules = ServerUtil.getModules(EAR_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IEnterpriseApplication ear = (IEnterpriseApplication) module2.loadAdapter(IEnterpriseApplication.class, monitor);
- if (ear != null) {
- IModule[] modules2 = ear.getModules();
- if (modules2 != null) {
- for (IModule mm : modules2) {
- List<IModule> m = earCache.get(mm);
- if (m == null) {
- m = new ArrayList<IModule>(2);
- earCache.put(mm, m);
- }
- m.add(module2);
-
- IJ2EEModule mod = (IJ2EEModule) mm.loadAdapter(IJ2EEModule.class, monitor);
- if (mod != null) {
- m = earCache2.get(mod);
- if (m == null) {
- m = new ArrayList<IModule>(2);
- earCache2.put(mod, m);
- }
- m.add(module2);
- }
- }
- }
- }
- }
- }
-
- modules = ServerUtil.getModules(WEB_MODULE);
- if (modules != null) {
- for (IModule module2 : modules) {
- IWebModule web = (IWebModule) module2.loadAdapter(IWebModule.class, monitor);
- if (web != null) {
- IModule[] modules2 = web.getModules();
- if (modules2 != null) {
- for (IModule mm : modules2) {
- List<IModule> m = webCache.get(mm);
- if (m == null) {
- m = new ArrayList<IModule>(2);
- webCache.put(mm, m);
- }
- m.add(module2);
- }
- }
- }
- }
- }
- }
-
- private static boolean shouldUseCache() {
- String s = System.getProperty("J2EEcache");
- if (s == null || "".equals(s) || "false".equals(s)) {
- webCache = null;
- earCache = null;
- return false;
- }
- if (cache == null || !cache.equals(s)) {
- cache = s;
- fillCache(null);
- }
- return true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java
deleted file mode 100644
index 89afad8..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JRERuntimeComponentProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007,2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jst.common.project.facet.core.StandardJreRuntimeComponent;
-import org.eclipse.jst.server.core.IJavaRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.server.core.IRuntime;
-
-public class JRERuntimeComponentProvider extends RuntimeComponentProviderDelegate {
-
- public List<IRuntimeComponent> getRuntimeComponents(IRuntime runtime) {
- // define JRE component
- IJavaRuntime javaRuntime = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null);
- if (javaRuntime != null) {
- final IVMInstall vmInstall = javaRuntime.getVMInstall();
- final IRuntimeComponent rc = StandardJreRuntimeComponent.create( vmInstall );
- return Collections.singletonList( rc );
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java
deleted file mode 100644
index 92e05c7..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/JavaServerPlugin.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.ILaunch;
-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.launching.IVMInstall;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.osgi.framework.BundleContext;
-/**
- * The main server tooling plugin class.
- */
-public class JavaServerPlugin extends Plugin {
- /**
- * Java server plugin id
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.server.core";
-
- // singleton instance of this class
- private static JavaServerPlugin singleton;
-
- // cached copy of all runtime classpath providers
- private static List<RuntimeClasspathProviderWrapper> runtimeClasspathProviders;
-
- // cached copy of all server profilers
- private static List<ServerProfiler> serverProfilers;
-
- // runtime listener
- private static IRuntimeLifecycleListener runtimeListener;
-
- /**
- * Create the JavaServerPlugin.
- */
- public JavaServerPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return a singleton instance
- */
- public static JavaServerPlugin getInstance() {
- return singleton;
- }
-
- /**
- * @see Plugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- runtimeListener = new IRuntimeLifecycleListener() {
- public void runtimeAdded(IRuntime runtime) {
- handleRuntimeChange(runtime, 0);
- }
-
- public void runtimeChanged(IRuntime runtime) {
- handleRuntimeChange(runtime, 1);
- }
-
- public void runtimeRemoved(IRuntime runtime) {
- handleRuntimeChange(runtime, 2);
- }
- };
-
- ServerCore.addRuntimeLifecycleListener(runtimeListener);
- }
-
- /**
- * @see Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context2) throws Exception {
- ServerCore.removeRuntimeLifecycleListener(runtimeListener);
- super.stop(context2);
- }
-
- /**
- * Handle a runtime change by potentially updating the classpath container.
- *
- * @param runtime a runtime
- */
- protected void handleRuntimeChange(final IRuntime runtime, final int act) {
- if (runtime == null)
- throw new IllegalArgumentException();
-
- Trace.trace(Trace.FINEST, "Possible runtime change: " + runtime);
-
- if (runtime.getRuntimeType() == null)
- return;
-
- final RuntimeClasspathProviderWrapper rcpw = findRuntimeClasspathProvider(runtime.getRuntimeType());
- if (rcpw != null && (rcpw.hasRuntimeClasspathChanged(runtime) || act != 1)) {
- final IPath serverContainerPath = new Path(RuntimeClasspathContainer.SERVER_CONTAINER)
- .append(rcpw.getId()).append(runtime.getId());
-
- class RebuildRuntimeReferencesJob extends Job {
- public RebuildRuntimeReferencesJob() {
- super(NLS.bind(Messages.updateClasspathContainers, runtime.getName()));
- }
-
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
- public IStatus run(IProgressMonitor monitor) {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- if (projects != null) {
- for (IProject project : projects) {
- if (project.isAccessible()) {
- try {
- if (!project.isNatureEnabled(JavaCore.NATURE_ID))
- continue;
-
- IJavaProject javaProject = JavaCore.create(project);
-
- boolean found = false;
- IClasspathEntry[] ce = javaProject.getRawClasspath();
- for (IClasspathEntry cp : ce) {
- if (cp.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if (serverContainerPath.isPrefixOf(cp.getPath()))
- found = true;
- }
- }
-
- Trace.trace(Trace.FINEST, "Classpath change on: " + project + " " + found);
-
- if (found) {
- IRuntime runtime2 = runtime;
- if (act == 2)
- runtime2 = null;
- RuntimeClasspathContainer container = new RuntimeClasspathContainer(project,
- serverContainerPath, rcpw, runtime2, runtime.getId());
- JavaCore.setClasspathContainer(serverContainerPath, new IJavaProject[] { javaProject },
- new IClasspathContainer[] {container}, null);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not update classpath container", e);
- }
- }
- }
- }
-
- return Status.OK_STATUS;
- }
- }
- RebuildRuntimeReferencesJob job = new RebuildRuntimeReferencesJob();
- job.schedule();
- }
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status a status
- */
- private static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- public static void logWarning(String msg) {
- log(new Status(IStatus.WARNING, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Returns an array of all known runtime classpath provider instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the
- * result.
- * </p>
- *
- * @return a possibly-empty array of runtime classpath provider instances
- * {@link RuntimeClasspathProviderWrapper}
- */
- public static RuntimeClasspathProviderWrapper[] getRuntimeClasspathProviders() {
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- RuntimeClasspathProviderWrapper[] rth = new RuntimeClasspathProviderWrapper[runtimeClasspathProviders.size()];
- runtimeClasspathProviders.toArray(rth);
- return rth;
- }
-
- /**
- * Returns the runtime classpath provider that supports the given runtime type, or <code>null</code>
- * if none. This convenience method searches the list of known runtime
- * classpath providers ({@link #getRuntimeClasspathProviders()}) for the one with
- * a matching runtime type.
- * The runtimeType may not be null.
- *
- * @param runtimeType a runtime type
- * @return the runtime classpath provider instance, or <code>null</code> if
- * there is no runtime classpath provider that supports the given id
- */
- public static RuntimeClasspathProviderWrapper findRuntimeClasspathProvider(IRuntimeType runtimeType) {
- if (runtimeType == null)
- throw new IllegalArgumentException();
-
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- Iterator iterator = runtimeClasspathProviders.iterator();
- while (iterator.hasNext()) {
- RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next();
- if (runtimeClasspathProvider.supportsRuntimeType(runtimeType))
- return runtimeClasspathProvider;
- }
- return null;
- }
-
- /**
- * Returns the runtime classpath provider that supports the given runtime type id,
- * or <code>null</code> if none. This convenience method searches the list of known
- * runtime classpath providers ({@link #getRuntimeClasspathProviders()}) for the one
- * with a matching runtime type id. The id may not be null.
- *
- * @param id a runtime type id
- * @return the runtime classpath provider instance, or <code>null</code> if
- * there is no runtime classpath provider that supports the given id
- */
- public static RuntimeClasspathProviderWrapper findRuntimeClasspathProviderBySupport(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- Iterator iterator = runtimeClasspathProviders.iterator();
- while (iterator.hasNext()) {
- RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next();
- if (runtimeClasspathProvider.supportsRuntimeType(id))
- return runtimeClasspathProvider;
- }
- return null;
- }
-
- /**
- * Returns the runtime classpath provider with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known runtime
- * classpath providers ({@link #getRuntimeClasspathProviders()}) for the one with
- * a matching runtime classpath provider id ({@link RuntimeClasspathProviderWrapper#getId()}).
- * The id may not be null.
- *
- * @param id the runtime classpath provider id
- * @return the runtime classpath provider instance, or <code>null</code> if
- * there is no runtime classpath provider with the given id
- */
- public static RuntimeClasspathProviderWrapper findRuntimeClasspathProvider(String id) {
- if (id == null)
- throw new IllegalArgumentException();
-
- if (runtimeClasspathProviders == null)
- loadRuntimeClasspathProviders();
-
- Iterator iterator = runtimeClasspathProviders.iterator();
- while (iterator.hasNext()) {
- RuntimeClasspathProviderWrapper runtimeClasspathProvider = (RuntimeClasspathProviderWrapper) iterator.next();
- if (id.equals(runtimeClasspathProvider.getId()))
- return runtimeClasspathProvider;
- }
- return null;
- }
-
- /**
- * Load the runtime classpath providers.
- */
- private static synchronized void loadRuntimeClasspathProviders() {
- if (runtimeClasspathProviders != null)
- return;
- Trace.trace(Trace.CONFIG, "->- Loading .runtimeClasspathProviders extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "runtimeClasspathProviders");
-
- List<RuntimeClasspathProviderWrapper> list = new ArrayList<RuntimeClasspathProviderWrapper>(cf.length);
- for (IConfigurationElement ce : cf) {
- try {
- list.add(new RuntimeClasspathProviderWrapper(ce));
- Trace.trace(Trace.CONFIG, " Loaded runtimeClasspathProviders: " + ce.getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load runtimeClasspathProviders: " + ce.getAttribute("id"), t);
- }
- }
- runtimeClasspathProviders = list;
-
- Trace.trace(Trace.CONFIG, "-<- Done loading .runtimeClasspathProviders extension point -<-");
- }
-
- /**
- * Returns an array of all known server profiler instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of server profiler instances
- * {@link ServerProfiler}
- */
- public static ServerProfiler[] getServerProfilers() {
- if (serverProfilers == null)
- loadServerProfilers();
-
- ServerProfiler[] sp = new ServerProfiler[serverProfilers.size()];
- serverProfilers.toArray(sp);
- return sp;
- }
-
- /**
- * Load the server profilers.
- */
- private static synchronized void loadServerProfilers() {
- if (serverProfilers != null)
- return;
- Trace.trace(Trace.CONFIG, "->- Loading .serverProfilers extension point ->-");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(JavaServerPlugin.PLUGIN_ID, "serverProfilers");
-
- List<ServerProfiler> list = new ArrayList<ServerProfiler>(cf.length);
- for (IConfigurationElement ce : cf) {
- try {
- list.add(new ServerProfiler(ce));
- Trace.trace(Trace.CONFIG, " Loaded serverProfiler: " + ce.getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load serverProfiler: " + ce.getAttribute("id"), t);
- }
- }
- serverProfilers = list;
-
- Trace.trace(Trace.CONFIG, "-<- Done loading .serverProfilers extension point -<-");
- }
-
- public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException {
- ServerProfiler[] sp = JavaServerPlugin.getServerProfilers();
- if (sp == null || sp.length == 0)
- throw new CoreException(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, 0, Messages.errorNoProfiler, null));
-
- sp[0].process(launch, vmInstall, vmConfig, monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java
deleted file mode 100644
index 2ffe168..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/LaunchConfigurationUtil.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-/**
- *
- */
-public class LaunchConfigurationUtil {
- /**
- * Gets the classpath from the launch configuration of the given server.
- * If create is false, it will return null if there is no launch configuration
- * (i.e. the server has not been run before) If create is true, it will create
- * a launch configuration if one does not exist.
- *
- * @param server
- * @param create
- * @param monitor a progress monitor
- * @return an array containing runtime classpath entries
- * @throws CoreException
- */
- /*public static IRuntimeClasspathEntry[] getClasspath(IServer server, boolean create, IProgressMonitor monitor) throws CoreException {
- ILaunchConfiguration config = server.getLaunchConfiguration(create, monitor);
- if (config == null)
- return null;
-
- return JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- }*/
-
- /**
- * Sets the classpath on the given server's launch configuration.
- *
- * @param server
- * @param classpath
- * @throws CoreException
- */
- /*public static void setClasspath(IServer server, IRuntimeClasspathEntry[] classpath, IProgressMonitor monitor) throws CoreException {
- ILaunchConfiguration config = server.getLaunchConfiguration(true, monitor);
- ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
-
- List mementos = new ArrayList(classpath.length);
- for (int i = 0; i < classpath.length; i++) {
- IRuntimeClasspathEntry entry = classpath[i];
- mementos.add(entry.getMemento());
- }
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, mementos);
- wc.doSave();
- }*/
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java
deleted file mode 100644
index 0bfeeeb..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
- * Translated messages.
- */
-public class Messages extends NLS {
- public static String errorLocation;
- public static String errorJRE;
- public static String classpathContainerDescription;
- public static String classpathContainer;
- public static String classpathContainerUnbound;
-
- public static String copyingTask;
- public static String deletingTask;
- public static String errorCopyingFile;
- public static String errorCreatingZipFile;
- public static String errorDelete;
- public static String errorRename;
- public static String errorReading;
- public static String updateClasspathContainers;
- public static String errorNoRuntime;
- public static String errorFacet;
- public static String errorDeleting;
- public static String errorNotADirectory;
- public static String errorMkdir;
-
- public static String artifactServlet;
- public static String artifactEJB;
- public static String artifactJNDI;
- public static String artifactCactusTest;
-
- public static String canModifyModules;
- public static String errorNoProfiler;
- public static String errorPublish;
- public static String httpPort;
- public static String errorPortInUse;
-
- static {
- NLS.initializeMessages(JavaServerPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties
deleted file mode 100644
index 76c6ce4..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Messages.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2007 IBM 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
-###############################################################################
-
-classpathContainerDescription=Server Library
-classpathContainer={0} [{1}]
-classpathContainerUnbound={0} [{1}] (unbound)
-
-errorLocation=Invalid location.
-errorJRE=Invalid JRE.
-
-copyingTask=Copying from {0} to {1}
-deletingTask=Deleting {0}
-errorCopyingFile=Error copying file {0}: {1}
-errorCreatingZipFile=Error creating zip file {0}: {1}
-errorDelete=Could not delete previous copy, which may be locked by another process.
-errorRename=Could not replace with temp file {0}.
-errorReading=Error reading file {0}
-errorNoRuntime=Cannot verify facets because there is no runtime associated with the server.
-errorFacet=Project facet {0} version {1} is not supported.
-errorDeleting=Could not delete {0}. May be locked by another process.
-errorNotADirectory=Could not delete {0} since it is not a directory.
-errorMkdir=Could not create directory {0}.
-
-updateClasspathContainers=Updating classpath container for {0}
-
-artifactServlet=Servlet {0}
-artifactEJB=EJB {0}
-artifactJNDI=JNDI {0}
-artifactCactusTest=Cactus test {0}
-
-canModifyModules=Web module can be added to the server.
-errorNoProfiler=Could not launch in profiling mode because no profilers are configured.
-errorPublish=An error occured during publishing.
-httpPort=HTTP Port
-errorPortInUse=Port {0} required by {1} is already in use. The server may already be running in another process, or a system process may be using the port. \
- To start this server you will need to stop the other process or change the port number(s).
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java
deleted file mode 100644
index 61d99d6..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ProgressUtil.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.*;
-/**
- * Progress Monitor utility.
- */
-public class ProgressUtil {
- /**
- * ProgressUtil constructor comment.
- */
- private ProgressUtil() {
- super();
- }
-
- /**
- * Return a valid progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) {
- if (monitor == null)
- return new NullProgressMonitor();
- return monitor;
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks int
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-
- /**
- * Return a sub-progress monitor with the given amount on the
- * current progress monitor.
- *
- * @param monitor org.eclipse.core.runtime.IProgressMonitor
- * @param ticks a number of ticks
- * @param style a style
- * @return org.eclipse.core.runtime.IProgressMonitor
- */
- public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks, int style) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks, style);
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
deleted file mode 100644
index e76f687..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainer.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.osgi.util.NLS;
-
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.ServerCore;
-/**
- *
- */
-public class RuntimeClasspathContainer implements IClasspathContainer {
- /**
- * The server container id.
- */
- public static final String SERVER_CONTAINER = JavaServerPlugin.PLUGIN_ID + ".container";
-
- private IPath path;
- private RuntimeClasspathProviderWrapper delegate;
- private IRuntime runtime;
- private String runtimeId;
- private IProject project;
-
- /**
- * Create a new runtime classpath container.
- *
- * @param path
- * @param delegate
- * @param runtime
- * @deprecated should use the constructor that accepts a project
- */
- public RuntimeClasspathContainer(IPath path, RuntimeClasspathProviderWrapper delegate, IRuntime runtime) {
- this.path = path;
- this.delegate = delegate;
- this.runtime = runtime;
- }
-
- /**
- * Create a new runtime classpath container.
- *
- * @param project
- * @param path
- * @param delegate
- * @param runtime
- * @param runtimeId
- */
- public RuntimeClasspathContainer(IProject project, IPath path, RuntimeClasspathProviderWrapper delegate, IRuntime runtime, String runtimeId) {
- this.project = project;
- this.path = path;
- this.delegate = delegate;
- this.runtime = runtime;
- this.runtimeId = runtimeId;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getClasspathEntries()
- */
- public IClasspathEntry[] getClasspathEntries() {
- IClasspathEntry[] entries = null;
-
- IRuntime curRuntime = getRuntime();
-
- if (delegate != null && curRuntime != null)
- entries = delegate.resolveClasspathContainerImpl(project, curRuntime);
-
- if (entries == null)
- return new IClasspathEntry[0];
-
- return entries;
- }
-
- private IRuntime getRuntime(){
- if (runtime == null && runtimeId != null) {
- // Make sure the runtime object is initialized.
- runtime = ServerCore.findRuntime(runtimeId);
- }
- return runtime;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
- */
- public String getDescription() {
- IRuntime curRuntime = getRuntime();
-
- if (curRuntime != null) {
- IRuntimeType runtimeType = curRuntime.getRuntimeType();
- if (runtimeType != null)
- return NLS.bind(Messages.classpathContainer, runtimeType.getName(), curRuntime.getName());
- }
- return NLS.bind(Messages.classpathContainerUnbound, Messages.classpathContainerDescription, runtimeId);
- }
-
- /** (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 path;
- }
-
- public boolean equals(Object obj) {
- if (!(obj instanceof RuntimeClasspathContainer))
- return false;
-
- RuntimeClasspathContainer rcc = (RuntimeClasspathContainer) obj;
- if (delegate != null && !delegate.equals(rcc.delegate))
- return false;
-
- if (runtime == null && rcc.runtime != null)
- return false;
-
- if (runtime != null && !runtime.equals(rcc.runtime))
- return false;
-
- if (runtimeId != null && !runtimeId.equals(rcc.runtimeId))
- return false;
-
- if (project == null && rcc.project != null)
- return false;
-
- if (project != null && !project.equals(rcc.project))
- return false;
-
- if (path != null && !path.equals(rcc.path))
- return false;
-
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java
deleted file mode 100644
index 4d17ce5..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathContainerInitializer.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.*;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-/**
- *
- */
-public class RuntimeClasspathContainerInitializer extends ClasspathContainerInitializer {
- /** (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 (containerPath.segmentCount() > 0) {
- if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) {
- RuntimeClasspathProviderWrapper delegate = null;
- IRuntime runtime = null;
- String runtimeId = null;
- if (containerPath.segmentCount() > 2) {
- delegate = JavaServerPlugin.findRuntimeClasspathProvider(containerPath.segment(1));
-
- runtimeId = containerPath.segment(2);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- }
- RuntimeClasspathContainer container = new RuntimeClasspathContainer(project.getProject(), containerPath, delegate, runtime, runtimeId);
- JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {project}, new IClasspathContainer[] {container}, null);
- }
- }
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
- */
- public String getDescription(IPath containerPath, IJavaProject project) {
- return Messages.classpathContainerDescription;
- }
-
- /** (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 true;
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathContainer)
- */
- public void requestClasspathContainerUpdate(IPath containerPath, IJavaProject project, IClasspathContainer containerSuggestion) throws CoreException {
- if (containerPath.segmentCount() > 0) {
- if (containerPath.segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) {
- RuntimeClasspathProviderWrapper delegate = null;
- IRuntime runtime = null;
- if (containerPath.segmentCount() > 2) {
- delegate = JavaServerPlugin.findRuntimeClasspathProvider(containerPath.segment(1));
- String runtimeId = containerPath.segment(2);
- if (runtimeId != null)
- runtime = ServerCore.findRuntime(runtimeId);
- delegate.requestClasspathContainerUpdate(runtime, containerSuggestion.getClasspathEntries());
- //JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project },
- // new IClasspathContainer[] { containerSuggestion }, new NullProgressMonitor());
- updateClasspath(runtime, containerPath, containerSuggestion);
- }
- }
- }
- }
-
- public static void updateClasspath(final IRuntime runtime, final IPath containerPath, final IClasspathContainer containerSuggestion) {
- class UpdateClasspathJob extends Job {
- public UpdateClasspathJob() {
- super(NLS.bind(Messages.updateClasspathContainers, runtime.getName()));
- }
-
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
- public IStatus run(IProgressMonitor monitor) {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- List<IJavaProject> list = new ArrayList<IJavaProject>();
- if (projects != null) {
- for (IProject project : projects) {
- if (project.isAccessible()) {
- try {
- if (!project.isNatureEnabled(JavaCore.NATURE_ID))
- continue;
-
- IJavaProject javaProject = JavaCore.create(project);
-
- boolean found = false;
- IClasspathEntry[] ce = javaProject.getRawClasspath();
- for (IClasspathEntry cp : ce) {
- if (cp.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- if (containerPath.isPrefixOf(cp.getPath()))
- found = true;
- }
- }
-
- Trace.trace(Trace.FINEST, "Classpath change on: " + project + " " + found);
-
- if (found)
- list.add(javaProject);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not update classpath container", e);
- }
- }
- }
- }
-
- int size = list.size();
- if (size > 0) {
- IJavaProject[] javaProjects = new IJavaProject[size];
- list.toArray(javaProjects);
- IClasspathContainer[] containers = new IClasspathContainer[size];
- for (int i = 0; i < size; i++)
- containers[i] = containerSuggestion;
-
- try {
- JavaCore.setClasspathContainer(containerPath, javaProjects, containers, monitor);
- } catch (JavaModelException jme) {
- return jme.getStatus();
- }
- }
-
- return Status.OK_STATUS;
- }
- }
- UpdateClasspathJob job = new UpdateClasspathJob();
- job.schedule();
- }
-
- /** (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) {
- if (containerPath == null)
- return null;
-
- return containerPath.toPortableString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java
deleted file mode 100644
index 86aafe9..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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 - initial API and implementation
- * IBM Corporation - Support for all server types
- ******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.common.project.facet.core.IClasspathProvider;
-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.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-/**
- *
- */
-public class RuntimeClasspathProvider implements IClasspathProvider {
- private static final IProjectFacet WEB_FACET = ProjectFacetsManager.getProjectFacet("jst.web");
- private static final IProjectFacet EJB_FACET = ProjectFacetsManager.getProjectFacet("jst.ejb");
- private static final IProjectFacet EAR_FACET = ProjectFacetsManager.getProjectFacet("jst.ear");
- private static final IProjectFacet UTILITY_FACET = ProjectFacetsManager.getProjectFacet("jst.utility");
- private static final IProjectFacet CONNECTOR_FACET = ProjectFacetsManager.getProjectFacet("jst.connector");
- private static final IProjectFacet APP_CLIENT_FACET = ProjectFacetsManager.getProjectFacet("jst.appclient");
-
- private IRuntimeComponent rc;
-
- public RuntimeClasspathProvider(IRuntimeComponent rc) {
- this.rc = rc;
- }
-
- public List getClasspathEntries(IProjectFacetVersion fv) {
- IProjectFacet pf = fv.getProjectFacet();
- if (pf == null)
- return null;
-
- if (pf.equals(WEB_FACET) || pf.equals(EJB_FACET) || pf.equals(EAR_FACET) ||
- pf.equals(UTILITY_FACET) || pf.equals(CONNECTOR_FACET) || pf.equals(APP_CLIENT_FACET)) {
- String runtimeTypeId = rc.getProperty("type-id");
- String runtimeId = rc.getProperty("id");
- if (runtimeTypeId == null || runtimeId == null)
- return null;
- RuntimeClasspathProviderWrapper rcpw = JavaServerPlugin.findRuntimeClasspathProviderBySupport(runtimeTypeId);
- if (rcpw != null) {
- IPath path = new Path(RuntimeClasspathContainer.SERVER_CONTAINER);
- path = path.append(rcpw.getId()).append(runtimeId);
- IClasspathEntry cpentry = JavaCore.newContainerEntry(path);
- return Collections.singletonList(cpentry);
- }
- }
-
- return null;
- }
-
- public static final class Factory implements IAdapterFactory {
- private static final Class[] ADAPTER_TYPES = { IClasspathProvider.class };
-
- public Object getAdapter(Object adaptable, Class adapterType) {
- IRuntimeComponent rc = (IRuntimeComponent) adaptable;
- return new RuntimeClasspathProvider(rc);
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_TYPES;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java
deleted file mode 100644
index fb858d6..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeClasspathProviderWrapper.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-/**
- *
- */
-public class RuntimeClasspathProviderWrapper {
- private IConfigurationElement element;
- private RuntimeClasspathProviderDelegate delegate;
-
- /**
- * Create a new runtime target handler.
- *
- * @param element a configuration element
- */
- public RuntimeClasspathProviderWrapper(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the order.
- *
- * @return the order
- */
- public int getOrder() {
- try {
- String o = element.getAttribute("order");
- return Integer.parseInt(o);
- } catch (NumberFormatException e) {
- return -1;
- }
- }
-
- public String[] getRuntimeTypeIds() {
- try {
- List<String> list = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element);
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @param runtimeType a runtime type
- * @return boolean
- */
- public boolean supportsRuntimeType(IRuntimeType runtimeType) {
- if (runtimeType == null)
- return false;
- return supportsRuntimeType(runtimeType.getId());
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @param id a runtime type id
- * @return boolean
- */
- public boolean supportsRuntimeType(String id) {
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getRuntimeTypeIds();
- if (s == null)
- return false;
-
- for (String ss : s) {
- if (ss.endsWith("*")) {
- if (id.length() >= ss.length() && id.startsWith(ss.substring(0, ss.length() - 1)))
- return true;
- } else if (id.equals(ss))
- return true;
- }
- return false;
- }
-
- /*
- * Loads the delegate class.
- */
- public RuntimeClasspathProviderDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (RuntimeClasspathProviderDelegate) element.createExecutableExtension("class");
- delegate.initialize(getId());
- } catch (Throwable t) {
- ServerPlugin.logExtensionFailure(toString(), t);
- }
- }
- return delegate;
- }
-
- /*
- * @see RuntimeClasspathProviderDelegate#resolveClasspathContainerImpl(IProject, IRuntime)
- */
- public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime) {
- if (runtime == null)
- return null;
- try {
- return getDelegate().resolveClasspathContainerImpl(project, runtime);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- return null;
- }
-
- /*
- * @see RuntimeClasspathProviderDelegate#requestClasspathContainerUpdate(IRuntime, IClasspathEntry[])
- */
- public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries) {
- if (runtime == null)
- return;
- try {
- getDelegate().requestClasspathContainerUpdate(runtime, entries);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- }
-
- /*
- * @see RuntimeClasspathProviderDelegate#hasRuntimeClasspathChanged(IRuntime)
- */
- public boolean hasRuntimeClasspathChanged(IRuntime runtime) {
- if (runtime == null)
- return false;
- try {
- return getDelegate().hasRuntimeClasspathChanged(runtime);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- return false;
- }
-
- public String toString() {
- return "RuntimeClasspathProviderWrapper[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java
deleted file mode 100644
index 968e4dd..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderDelegate.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.wst.server.core.internal.facets.RuntimeFacetComponentProviderDelegate;
-/**
- * A runtime component provider can provide additional runtime components for a facet runtime.
- * This provider is scoped by runtime type and may provide components for multiple
- * runtime instances.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>internalRuntimeComponentProviders</code> extension point.
- * </p>
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- *
- * @plannedfor 2.0
- */
-public abstract class RuntimeComponentProviderDelegate extends RuntimeFacetComponentProviderDelegate {
- // nothing added
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java
deleted file mode 100644
index e47eaf1..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeComponentProviderWrapper.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-/**
- *
- */
-public class RuntimeComponentProviderWrapper {
- private IConfigurationElement element;
- private RuntimeComponentProviderDelegate delegate;
-
- /**
- * Create a new runtime component handler.
- *
- * @param element a configuration element
- */
- public RuntimeComponentProviderWrapper(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- protected IConfigurationElement getElement() {
- return element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- public String[] getRuntimeTypeIds() {
- try {
- List<String> list = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(element.getAttribute("runtimeTypeIds"), ",");
- while (st.hasMoreTokens()) {
- String str = st.nextToken();
- if (str != null && str.length() > 0)
- list.add(str.trim());
- }
- String[] s = new String[list.size()];
- list.toArray(s);
- return s;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not parse runtime type ids: " + element);
- return null;
- }
- }
-
- /**
- * Returns true if the given server resource type (given by the
- * id) can be opened with this editor. This result is based on
- * the result of the getServerResources() method.
- *
- * @param runtimeType a runtime type
- * @return boolean
- */
- public boolean supportsRuntimeType(IRuntimeType runtimeType) {
- if (runtimeType == null)
- return false;
- String id = runtimeType.getId();
- if (id == null || id.length() == 0)
- return false;
-
- String[] s = getRuntimeTypeIds();
- if (s == null)
- return false;
-
- for (String ss : s) {
- if (ss.endsWith("*")) {
- if (id.length() >= ss.length() && id.startsWith(ss.substring(0, ss.length() - 1)))
- return true;
- } else if (id.equals(ss))
- return true;
- }
- return false;
- }
-
- /*
- * Loads the delegate class.
- */
- protected RuntimeComponentProviderDelegate getDelegate() {
- if (delegate == null) {
- try {
- delegate = (RuntimeComponentProviderDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- ServerPlugin.logExtensionFailure(toString(), t);
- }
- }
- return delegate;
- }
-
- /*
- * @see RuntimeFacetComponentProviderDelegate#getRuntimeComponents(IRuntime)
- */
- public List<IRuntimeComponent> getComponents(IRuntime runtime) {
- if (runtime == null)
- return null;
- try {
- return getDelegate().getRuntimeComponents(runtime);
- } catch (Exception e) {
- ServerPlugin.logExtensionFailure(toString(), e);
- }
- return null;
- }
-
- public String toString() {
- return "RuntimeComponentProviderWrapper[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java
deleted file mode 100644
index 72cd045..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/RuntimeFacetMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-/**
- *
- */
-public class RuntimeFacetMapping {
- private IConfigurationElement element;
-
- /**
- * Create a new runtime facet mapping.
- *
- * @param element a configuration element
- */
- public RuntimeFacetMapping(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- *
- * @return the id
- */
- public String getRuntimeTypeId() {
- return element.getAttribute("runtimeTypeId");
- }
-
- /**
- *
- * @return the id
- */
- public String getVersion() {
- return element.getAttribute("version");
- }
-
- /**
- *
- * @return the id
- */
- public String getRuntimeComponent() {
- return element.getAttribute("runtime-component");
- }
-
- public String toString() {
- return "RuntimeFacetMapping[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java
deleted file mode 100644
index 7ab3003..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/ServerProfiler.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.jst.server.core.ServerProfilerDelegate;
-/**
- *
- */
-public class ServerProfiler {
- private IConfigurationElement element;
- private ServerProfilerDelegate delegate;
-
- /**
- * Create a new server profiler.
- *
- * @param element a configuration element
- */
- public ServerProfiler(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- *
- * @return the name
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- /*
- * Loads the delegate class.
- */
- protected ServerProfilerDelegate getDelegate() {
- if (delegate == null) {
- if (element.getAttribute("class") == null)
- return null;
- try {
- delegate = (ServerProfilerDelegate) element.createExecutableExtension("class");
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
- }
- }
- return delegate;
- }
-
- /**
- * @deprecated Switch to new API via TODO
- * @return the VM args
- */
- public String getVMArgs() {
- return null;
- }
-
- public void process(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor) throws CoreException {
- try {
- ServerProfilerDelegate del = getDelegate();
- if (del != null)
- del.process(launch, vmInstall, vmConfig, monitor);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), ce);
- throw ce;
- }
- }
-
- public String toString() {
- return "ServerProfiler[" + getId() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
deleted file mode 100644
index fd470af..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/Trace.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- /**
- * Config tracing
- */
- public static final byte CONFIG = 0;
- /**
- * Warning tracing
- */
- public static final byte WARNING = 1;
- /**
- * Severe tracing
- */
- public static final byte SEVERE = 2;
- /**
- * Finest tracing
- */
- public static final byte FINEST = 3;
-
- public static final byte PUBLISHING = 4;
-
- private static Set<String> logged = new HashSet<String>();
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param level trace level
- * @param s String
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param level trace level
- * @param s String
- * @param t Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (s == null)
- return;
-
- if (level == SEVERE) {
- if (!logged.contains(s)) {
- JavaServerPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, JavaServerPlugin.PLUGIN_ID, s, t));
- logged.add(s);
- }
- }
-
- if (!JavaServerPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(JavaServerPlugin.PLUGIN_ID + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java
deleted file mode 100644
index 119f14d..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal;
-
-import java.io.*;
-import java.util.*;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistance with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- private XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /**
- * @see IMemento#createChild(String)
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- private static XMLMemento createReadRoot(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(in));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- *
- * @param type a type
- * @return a memento
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /*
- * @see IMemento
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /*
- * @see IMemento
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- List<Element> list = new ArrayList<Element>(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, list.get(x));
- }
- return results;
- }
-
- /*
- * @see IMemento
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- * @return a memento
- */
- public static IMemento loadMemento(String filename) throws IOException {
- InputStream in = null;
- try {
- in = new BufferedInputStream(new FileInputStream(filename));
- return XMLMemento.createReadRoot(in);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- /*
- * @see IMemento
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- *
- * @param os an output stream
- * @throws IOException if anything goes wrong
- */
- private void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- FileOutputStream w = null;
- try {
- w = new FileOutputStream(filename);
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusLaunchable.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusLaunchable.java
deleted file mode 100644
index de2f447..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusLaunchable.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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:
- * Daniel R. Somerfield - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal.cactus;
-
-import java.net.URL;
-/**
- *
- */
-public class CactusLaunchable {
- private String fProjectname;
- private String fClassName;
- private String fTestName;
- private URL fCactusURL;
-
- public CactusLaunchable(String projectName, String className, String testName, URL cactusURL) {
- fProjectname = projectName;
- fClassName = className;
- fTestName = testName;
- fCactusURL = cactusURL;
- }
-
- public String getTestClassName() {
- return fClassName;
- }
-
- public String getTestName() {
- return fTestName;
- }
-
- public String getProjectName() {
- return fProjectname;
- }
-
- public URL getCactusURL() {
- return fCactusURL;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusLaunchableAdapterDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusLaunchableAdapterDelegate.java
deleted file mode 100644
index 028f6fc..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusLaunchableAdapterDelegate.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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:
- * Daniel R. Somerfield - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal.cactus;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.server.core.internal.Trace;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IURLProvider;
-import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
-/**
- *
- */
-public class CactusLaunchableAdapterDelegate extends LaunchableAdapterDelegate {
- public Object getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException {
- if (moduleArtifact instanceof WebTestableResource) {
- WebTestableResource resource = (WebTestableResource) moduleArtifact;
- URL url = ((IURLProvider) server.getAdapter(IURLProvider.class))
- .getModuleRootURL(resource.getModule());
-
- String urlString = url.toString();
- if (urlString.endsWith("/")) {
- try {
- url = new URL(urlString.substring(0, urlString.length() - 1));
- } catch (MalformedURLException e) {
- Trace.trace(Trace.SEVERE, "Error getting launchable", e);
- return null;
- }
- }
- return new CactusLaunchable(resource.getProjectName(),
- resource.getClassName(), resource.getTestName(), url);
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusModuleArtifactAdapterDelegate.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusModuleArtifactAdapterDelegate.java
deleted file mode 100644
index 46a2819..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/CactusModuleArtifactAdapterDelegate.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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:
- * Daniel R. Somerfield - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal.cactus;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-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.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-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.server.core.internal.Trace;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
-/**
- *
- */
-public class CactusModuleArtifactAdapterDelegate extends ModuleArtifactAdapterDelegate {
- private static final String SERVLET_TEST_CASE_TYPE = "org.apache.cactus.ServletTestCase";
-
- private static final String SUITE_METHOD = "suite";
-
- private static final String TEST_CLASS_NAME = "junit.framework.Test";
-
- public IModuleArtifact getModuleArtifact(Object obj) {
- String methodName = "";
- if (obj instanceof IMethod) {
- IMethod method = (IMethod) obj;
- methodName = method.getElementName();
- obj = method.getCompilationUnit();
- }
- if (obj instanceof IAdaptable) {
- IResource resource = (IResource) ((IAdaptable) obj).getAdapter(IResource.class);
- String testClassName = getClassNameForType(resource);
- if (testClassName != null) {
- String projectName = resource.getProject().getName();
- return new WebTestableResource(getModule(resource.getProject()), false,
- projectName, testClassName, methodName);
- }
- }
- return null;
- }
-
- private static String getClassNameForType(IResource resource) {
- if (resource == null)
- return null;
-
- if (!"java".equals(resource.getFileExtension()) && !"class".equals(resource.getFileExtension()))
- return null;
-
- try {
- IProject project = resource.getProject();
- IPath path = resource.getFullPath();
- if (path == null || !project.hasNature(JavaCore.NATURE_ID))
- return null;
-
- IJavaProject javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID);
- if (!javaProject.isOpen())
- javaProject.open(new NullProgressMonitor());
-
- // output location may not be on classpath
- IPath outputPath = javaProject.getOutputLocation();
- if (outputPath != null
- && "class".equals(path.getFileExtension()) && outputPath.isPrefixOf(path)) { //$NON-NLS-1$
- int count = outputPath.segmentCount();
- path = path.removeFirstSegments(count);
- }
-
- // remove initial part of classpath
- IClasspathEntry[] classPathEntry = javaProject.getResolvedClasspath(true);
- if (classPathEntry != null) {
- int size = classPathEntry.length;
- for (int i = 0; i < size; i++) {
- IPath classPath = classPathEntry[i].getPath();
- if (classPath.isPrefixOf(path)) {
- int count = classPath.segmentCount();
- path = path.removeFirstSegments(count);
- i += size;
- }
- }
- }
-
- // get java element
- IJavaElement javaElement = javaProject.findElement(path);
- IType[] types = getTypes(javaElement);
- if (types != null) {
- int size2 = types.length;
- for (int i = 0; i < size2; i++) {
- if (hasSuperclass(types[i]) || hasSuiteMethod(types[i]))
- return types[i].getFullyQualifiedName();
- }
- }
- return null;
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Unexpected exception: " + e);
- return null;
- }
- }
-
- private static boolean hasSuiteMethod(IType type) throws JavaModelException {
- IMethod[] methods = type.getMethods();
- int size = methods.length;
- for (int i = 0; i < size; i++) {
- IMethod method = methods[i];
- if (method.getParameterNames().length == 0 && method.getElementName().equals(SUITE_METHOD)) {
- String returnType = getFullyQualifiedTypeForMangledType(method.getReturnType(), type);
- if (TEST_CLASS_NAME.equals(returnType))
- return true;
- }
- }
- return false;
- }
-
- private static IType[] getTypes(IJavaElement element) {
- try {
- if (element.getElementType() != IJavaElement.COMPILATION_UNIT)
- return null;
- return ((ICompilationUnit) element).getAllTypes();
- } catch (Exception e) {
- return null;
- }
- }
-
- private static boolean hasSuperclass(IType type) {
- try {
- ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
- IType[] superClasses = hierarchy.getAllSuperclasses(type);
- int size = superClasses.length;
- for (int i = 0; i < size; i++) {
- if (SERVLET_TEST_CASE_TYPE.equals(superClasses[i].getFullyQualifiedName())) //$NON-NLS-1$
- return true;
- }
- return false;
- } catch (Exception e) {
- return false;
- }
- }
-
- protected static IModule getModule(IProject project) {
- IModule deployable = null;
- Iterator iterator = Arrays.asList(ServerUtil.getModules("jst.web")).iterator();
- while (iterator.hasNext()) {
- Object next = iterator.next();
- if (next instanceof IModule) {
- deployable = (IModule) next;
- if (deployable.getProject().equals(project))
- return deployable;
- }
- }
- return null;
- }
-
- private static String getFullyQualifiedTypeForMangledType(String type,
- IType declaringType) throws JavaModelException {
- type = Signature.toString(type);
- return getFullyQualifiedTypeForType(type, declaringType);
- }
-
- private static String getFullyQualifiedTypeForType(String type, IType declaringType)
- throws JavaModelException {
- String[][] resolvedTypes = declaringType.resolveType(type);
- // Are there legit cases where this would not be the case? We might need to check
- // for this and bomb out if the type cannot be unambigiously resolved
- if (resolvedTypes.length != 1)
- Trace.trace(Trace.WARNING, "The type cannot be unambigiously resolved. Need to handle this case");
- String[] resolvedType = resolvedTypes[0];
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < resolvedType.length - 1; i++) {
- buffer.append(resolvedType[i]);
- buffer.append('.');
- }
-
- buffer.append(resolvedType[resolvedType.length - 1]);
-
- return buffer.toString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/ServletTestCasePropertyTester.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/ServletTestCasePropertyTester.java
deleted file mode 100644
index d73704d..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/ServletTestCasePropertyTester.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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:
- * Daniel R. Somerfield - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal.cactus;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jst.server.core.internal.Trace;
-/**
- *
- */
-public class ServletTestCasePropertyTester extends PropertyTester {
- public static final String PROPERTY_IS_SERVLET_TEST_CASE = "isServletTestCase";
- private static final String TEST_SUPERCLASS_NAME = "org.apache.cactus.ServletTestCase";
-
- public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
- IJavaElement javaElement = null;
- if (receiver instanceof IAdaptable) {
- javaElement = (IJavaElement) ((IAdaptable) receiver).getAdapter(IJavaElement.class);
- }
- if (javaElement != null) {
- if (!javaElement.exists()) {
- return false;
- }
- }
- if (javaElement instanceof IJavaProject
- || javaElement instanceof IPackageFragmentRoot
- || javaElement instanceof IPackageFragment) {
- return true;
- }
- if (javaElement != null) {
- if (PROPERTY_IS_SERVLET_TEST_CASE.equals(method)) { //$NON-NLS-1$
- return isServletTestCase(javaElement);
- }
- }
- return false;
- }
-
- private boolean isServletTestCase(IJavaElement element) {
- IType testType = null;
-
- try {
- if (element instanceof ICompilationUnit) {
- ICompilationUnit cu = (ICompilationUnit) element;
- testType = cu.getType(Signature.getQualifier(cu.getElementName()));
- } else if (element instanceof IClassFile)
- testType = ((IClassFile) element).getType();
- else if (element instanceof IType)
- testType = (IType) element;
- else if (element instanceof IMember)
- testType = ((IMember) element).getDeclaringType();
-
- if (testType != null && testType.exists() && isTestOrSuite(testType))
- return true;
- } catch (JavaModelException e) {
- Trace.trace(Trace.SEVERE, "Error checking isServlet", e);
- }
- return false;
- }
-
- /**
- *
- * @param testType
- * @return true if the type is a test, false otherwise
- */
- private boolean isTestOrSuite(IType testType) throws JavaModelException {
- IType[] types = testType.newSupertypeHierarchy(null).getAllSuperclasses(testType);
- for (int i = 0; i < types.length; i++) {
- if (types[i].getFullyQualifiedName().equals(TEST_SUPERCLASS_NAME)) {
- return true;
- }
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/WebTestableResource.java b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/WebTestableResource.java
deleted file mode 100644
index 9e6873a..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/internal/cactus/WebTestableResource.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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:
- * Daniel R. Somerfield - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.server.core.internal.cactus;
-
-import org.eclipse.jst.server.core.internal.Messages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
-
-public class WebTestableResource extends ModuleArtifactDelegate {
- private boolean fServletIsConfigured;
- private String fClassName;
- private String fTestName;
- private String fProjectName;
-
- public WebTestableResource(IModule module, boolean servletIsConfigured,
- String projectName, String className, String testName) {
- super(module);
- fServletIsConfigured = servletIsConfigured;
- fClassName = className;
- fTestName = testName;
- fProjectName = projectName;
- }
-
- public WebTestableResource() {
- super();
- }
-
- public String getProjectName() {
- return fProjectName;
- }
-
- public boolean isServletConfigured() {
- return fServletIsConfigured;
- }
-
- public String getClassName() {
- return fClassName;
- }
-
- public String getTestName() {
- return fTestName;
- }
-
- /*
- * @see ModuleArtifactDelegate#getName()
- */
- public String getName() {
- return NLS.bind(Messages.artifactCactusTest, fTestName);
- }
-
- /*
- * @see ModuleArtifactDelegate#deserialize(String)
- */
- public void deserialize(String s) {
- int ind = s.indexOf("//");
- super.deserialize(s.substring(0, ind));
- s = s.substring(ind+2);
- ind = s.indexOf("//");
- fProjectName = s.substring(0, ind);
-
- s = s.substring(ind+2);
- ind = s.indexOf("//");
- fClassName = s.substring(0, ind);
-
- if ('T' == s.charAt(ind+2))
- fServletIsConfigured = true;
- else
- fServletIsConfigured = false;
- fTestName = s.substring(ind+3);
- }
-
- /*
- * @see ModuleArtifactDelegate#serialize()
- */
- public String serialize() {
- StringBuffer sb = new StringBuffer(super.serialize());
- sb.append("//");
- sb.append(fProjectName);
- sb.append("//");
- sb.append(fClassName);
- sb.append("//");
- if (fServletIsConfigured)
- sb.append("T");
- else
- sb.append("F");
- sb.append(fTestName);
- return sb.toString();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html
deleted file mode 100644
index 0dfa3c3..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../../../..//apistyles.css" type="text/css">
-<title>WTP API overview</title>
-</head>
-<body>
-<table width="500">
-<tr>
-<td>
-<p>Support for Java and J2EE server types.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>The ClasspathRuntimeTargetHandler class provides a common subclass
-for runtime target handlers that need to modify a project's classpath
-when a project is targetted to a particular runtime.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>IGenericRuntime and its working copy provide type-specific access
-to the generic runtime type. When using a generic runtime, clients can
-access the type specific information by adapting to these types using
-<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>.
-GenericRuntimeUtil contains some utility methods for handling the
-generic runtime type.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule,
-and IConnectorModule are J2EE module interfaces meant to be implemented
-by module delegates that provide J2EE module support.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules
-that take advantage of loose archive support - allowing JARs contained within
-the module to be available in a separate Java project instead of directly
-within the module.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>The remainder of the classes in this package are module artifact and
-launchable types to provide access to J2EE resource types for the server tool
-framework.</p>
-</td>
-</tr>
-</table>
-</body>
-</html>
diff --git a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml b/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml
deleted file mode 100644
index b4c0529..0000000
--- a/plugins/org.eclipse.jst.server.core/src/org/eclipse/jst/server/core/package.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-<p>Support for Java and J2EE server types.</p>
-
-<p>The ClasspathRuntimeTargetHandler class provides a common subclass
-for runtime target handlers that need to modify a project's classpath
-when a project is targetted to a particular runtime.</p>
-
-<p>IGenericRuntime and its working copy provide type-specific access
-to the generic runtime type. When using a generic runtime, clients can
-access the type specific information by adapting to these types using
-<pre>IGenericRuntime gr = (IGenericRuntime) runtime.getAdapter(IGenericRuntime.class)</pre>.
-GenericRuntimeUtil contains some utility methods for handling the
-generic runtime type.</p>
-
-<p>IEnterpriseApplication, IEJBModule, IWebModule, IApplicationClientModule,
-and IConnectorModule are J2EE module interfaces meant to be implemented
-by module delegates that provide J2EE module support.</p>
-
-<p>ILooseArchive and ILooseArchiveSupport are module interfaces for modules
-that take advantage of loose archive support - allowing JARs contained within
-the module to be available in a separate Java project instead of directly
-within the module.</p>
-
-<p>The remainder of the classes in this package are module artifact and
-launchable types to provide access to J2EE resource types for the server tool
-framework.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.classpath b/plugins/org.eclipse.wst.internet.monitor.core/.classpath
deleted file mode 100644
index acc46b4..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="monitorcore/"/>
- <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/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore b/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore
deleted file mode 100644
index 29d1e04..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-monitorcore.jar
-build.xml
-temp.folder
-org.eclipse.wst.internet.monitor.core_3.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.options b/plugins/org.eclipse.wst.internet.monitor.core/.options
deleted file mode 100644
index 47070ee..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.options
+++ /dev/null
@@ -1,6 +0,0 @@
-# Debugging options for the org.eclipse.wst.internet.monitor.core plugin
-
-# Turn on general debugging
-org.eclipse.wst.internet.monitor.core/debug=true
-
-org.eclipse.wst.internet.monitor.core/parsing=false
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.project b/plugins/org.eclipse.wst.internet.monitor.core/.project
deleted file mode 100644
index 93b239c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.monitor.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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index c8be432..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Nov 10 17:11:35 HST 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2920850..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,77 +0,0 @@
-#Thu Sep 13 15:25:06 EDT 2007
-eclipse.preferences.version=1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=error
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled
-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.maxProblemPerUnit=1000
-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=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=error
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-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
-org.eclipse.jdt.core.incompatibleJDKLevel=warning
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index dfce209..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Feb 23 21:16:21 EST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\n<templates/>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 08a60e5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Sat Apr 22 18:36:14 EDT 2006
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.internet.monitor.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 8cfaea6..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.internet.monitor.core; singleton:=true
-Bundle-Version: 1.0.305.qualifier
-Bundle-Activator: org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.internet.monitor.core.internal;x-friends:="org.eclipse.wst.internet.monitor.ui",
- org.eclipse.wst.internet.monitor.core.internal.http;x-friends:="org.eclipse.wst.internet.monitor.ui",
- org.eclipse.wst.internet.monitor.core.internal.provisional;x-friends:="org.eclipse.wst.internet.monitor.ui"
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/about.html b/plugins/org.eclipse.wst.internet.monitor.core/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/build.properties b/plugins/org.eclipse.wst.internet.monitor.core/build.properties
deleted file mode 100644
index 75ed562..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2005 IBM 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
-###############################################################################
-bin.includes = plugin.xml,\
- .,\
- plugin.properties,\
- .options,\
- META-INF/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = schema/
-source.. = monitorcore/
-output.. = bin/
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java
deleted file mode 100644
index 69111aa..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.InterruptedIOException;
-import java.net.*;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-/**
- * The actual TCP/IP monitoring server. This is a thread that
- * listens on a port and relays a call to another server.
- */
-public class AcceptThread {
- protected IMonitor monitor;
-
- protected boolean alive = true;
- protected ServerSocket serverSocket;
-
- protected Thread thread;
-
- class ServerThread extends Thread {
- public ServerThread() {
- super("TCP/IP Monitor");
- }
-
- /**
- * ServerThread accepts incoming connections and delegates to the protocol
- * adapter to deal with the connection.
- */
- public void run() {
- // create a new server socket
- try {
- serverSocket = new ServerSocket(monitor.getLocalPort());
- serverSocket.setSoTimeout(2000);
- Trace.trace(Trace.FINEST, "Monitoring localhost:" + monitor.getLocalPort() + " -> " + monitor.getRemoteHost()
- + ":" + monitor.getRemotePort());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not start monitoring");
- return;
- }
-
- while (alive) {
- try {
- // accept the connection from the client
- Socket localSocket = serverSocket.accept();
-
- int timeout = monitor.getTimeout();
- if (timeout != 0)
- localSocket.setSoTimeout(timeout);
-
- try {
- // connect to the remote server
- Socket remoteSocket = new Socket();
- if (timeout != 0)
- remoteSocket.setSoTimeout(timeout);
-
- remoteSocket.connect(new InetSocketAddress(monitor.getRemoteHost(), monitor.getRemotePort()), timeout);
-
- // relay the call through
- String protocolId = monitor.getProtocol();
- ProtocolAdapter adapter = MonitorPlugin.getInstance().getProtocolAdapter(protocolId);
- adapter.connect(monitor, localSocket, remoteSocket);
- } catch (SocketTimeoutException e) {
- FailedConnectionThread thread2 = new FailedConnectionThread((Monitor) monitor, localSocket, Messages.errorConnectTimeout);
- thread2.start();
- } catch (Exception e) {
- FailedConnectionThread thread2 = new FailedConnectionThread((Monitor) monitor, localSocket, null);
- thread2.start();
- }
- } catch (InterruptedIOException e) {
- // do nothing
- } catch (Exception e) {
- if (alive)
- Trace.trace(Trace.SEVERE, "Error while monitoring", e);
- }
- }
- }
- }
-
- /**
- * AcceptThread constructor.
- *
- * @param monitor a monitor
- */
- public AcceptThread(IMonitor monitor) {
- super();
- this.monitor = monitor;
- }
-
- /**
- * Start the server.
- */
- public void startServer() {
- if (thread != null)
- return;
- thread = new ServerThread();
- thread.setDaemon(true);
- thread.setPriority(Thread.NORM_PRIORITY + 1);
- thread.start();
-
- Thread.yield();
-
- // wait up to 2 seconds for initialization
- int i = 0;
- while (serverSocket == null && i < 10) {
- try {
- Thread.sleep(200);
- } catch (Exception e) {
- // ignore
- }
- i++;
- }
- }
-
- /**
- * Returns <code>true</code> if the server is running.
- *
- * @return <code>true</code> if the server is running, and <code>false</code>
- * otherwise
- */
- public boolean isRunning() {
- return (thread != null);
- }
-
- /**
- * Correctly close the server socket and shut down the server.
- */
- public void stopServer() {
- try {
- alive = false;
- thread = null;
-
- String protocolId = monitor.getProtocol();
- ProtocolAdapter adapter = MonitorPlugin.getInstance().getProtocolAdapter(protocolId);
- adapter.disconnect(monitor);
- if (serverSocket != null)
- serverSocket.close();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error stopping server", e);
- }
- }
-
- /**
- * Returns true if this port is in use.
- *
- * @return boolean
- * @param port int
- */
- public static boolean isPortInUse(int port) {
- ServerSocket s = null;
- try {
- s = new ServerSocket(port);
- } catch (SocketException e) {
- return true;
- } catch (Exception e) {
- return true;
- } finally {
- if (s != null) {
- try {
- s.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- return false;
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java
deleted file mode 100644
index 086fb38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.net.Socket;
-/**
- *
- */
-public class Connection {
- protected Socket in;
- protected Socket out;
-
- /**
- * Creates a new connection.
- *
- * @param in inbound socket
- * @param out outbound socket
- */
- public Connection(Socket in, Socket out) {
- this.in = in;
- this.out = out;
- }
-
- /**
- * Close the connection.
- */
- public void close() {
- Trace.trace(Trace.FINEST, "Closing connection");
- try {
- in.getOutputStream().flush();
- in.shutdownInput();
- in.shutdownOutput();
-
- out.getOutputStream().flush();
- out.shutdownInput();
- out.shutdownOutput();
- Trace.trace(Trace.FINEST, "Connection closed");
- } catch (Exception ex) {
- Trace.trace(Trace.WARNING, "Error closing connection " + this, ex);
- }
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java
deleted file mode 100644
index 1ea64cc..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.ContentFilterDelegate;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- *
- */
-public class ContentFilter implements IContentFilter {
- protected IConfigurationElement element;
- protected ContentFilterDelegate delegate;
-
- protected ContentFilter(IConfigurationElement element) {
- this.element = element;
- }
-
- /**
- * Return the id.
- *
- * @return the id
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * Returns the relative order for this filter.
- *
- * @return the order
- */
- public int getOrder() {
- try {
- return Integer.parseInt(element.getAttribute("order"));
- } catch (Exception e) {
- return 0;
- }
- }
-
- /**
- * Returns the name.
- *
- * @return the name
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- /**
- * Do the filtering.
- *
- * @param request the request
- * @param isRequest true if request, false if response
- * @param content the content
- * @return the filtered content
- * @throws IOException if there is a connection problem
- */
- public byte[] filter(Request request, boolean isRequest, byte[] content) throws IOException {
- if (delegate == null) {
- try {
- delegate = (ContentFilterDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create content filter delegate: " + getId(), e);
- return new byte[0];
- }
- }
- return delegate.filter(request, isRequest, content);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/FailedConnectionThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/FailedConnectionThread.java
deleted file mode 100644
index b1d4547..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/FailedConnectionThread.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.InputStream;
-import java.net.Socket;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-
-/**
- * Thread used if the connection to the server fails.
- */
-public class FailedConnectionThread extends Thread {
- private static final int BUFFER = 2048;
- protected Monitor monitor;
- protected Socket socket;
- protected String error;
-
- public FailedConnectionThread(Monitor monitor, Socket socket, String error) {
- super();
- this.monitor = monitor;
- this.socket = socket;
- this.error = error;
- }
-
- public void run() {
- Request request = new Request(monitor, IProtocolAdapter.TCPIP_PROTOCOL_ID, monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- String err = error;
- if (err == null)
- err = Messages.errorConnectToServer;
- request.addToResponse(err.getBytes());
-
- try {
- InputStream in = socket.getInputStream();
- byte[] b = new byte[BUFFER];
- while (in.available() > 0) {
- int n = in.read(b);
- byte[] c = new byte[n];
- System.arraycopy(b, 0, c, 0, n);
- request.addToRequest(c);
- }
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- socket.shutdownInput();
- socket.shutdownOutput();
- socket.close();
- } catch (Exception ex) {
- // ignore
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IContentFilter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IContentFilter.java
deleted file mode 100644
index 99c7bb4..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IContentFilter.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * A content filter that filters specific contents from the monitor traffic
- * of a request.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IContentFilter {
- /**
- * Returns the id of this filter.
- * Each filter has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the displayable (translated) name for this filter.
- *
- * @return a displayable name
- */
- public String getName();
-
- /**
- * Returns the relative order of this filter.
- * Each filter has a relative order that allows them to be applied in the correct
- * order relative to each other. Lower orders are processed first.
- *
- * @return the relative order
- *
- * [issue: CS - The schema (contentFilterns.exsd) defines an 'order' attribute.
- * The comments above suggest that filters should be designed to be composable. Is this correct?
- * It would be good to make this optional if the user had no idea how his filter should be ordered.
- * I've found that sometimes 'low', 'medium', 'high' are adequate to handle ordering issues and are
- * easier for the extension writer deal with and get a sense of the proper value to assign. ]
- */
- //public int getOrder();
-
- /**
- * Filter the given content from the given request. The content that has been filtered out will
- * not be shown to clients of the TCP/IP monitor.
- *
- * @param request the request that the filter will be performed on
- * @param isRequest set to true if the content filter applies to request monitor traffic,
- * or set to false if the content filter applies to the response monitor traffic
- * @param content the message content to be filtered out
- * @return the filtered content
- * @throws IOException if there is an error while parsing or filtering the content
- */
- public byte[] filter(Request request, boolean isRequest, byte[] content) throws IOException;
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java
deleted file mode 100644
index 6be5f28..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IMemento {
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the integer value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public Integer getInteger(String key);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Returns the boolean value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a boolean
- */
- public Boolean getBoolean(String key);
-
- /**
- * Sets the value of the given key to the given integer.
- *
- * @param key the key
- * @param value the value
- */
- public void putInteger(String key, int value);
-
- /**
- * Sets the value of the given key to the given boolean value.
- *
- * @param key the key
- * @param value the value
- */
- public void putBoolean(String key, boolean value);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IProtocolAdapter.java
deleted file mode 100644
index 63a838b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IProtocolAdapter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-/**
- * A protocol adapter enables a monitor to support a particular network
- * protocol used to communicate between a client and server. All supported
- * protocols will be based on TCP/IP.
- * <p>
- * Protocol adapters are registered via the <code>protocolAdapaters</code>
- * extension point in the <code>org.eclipse.wst.internet.monitor.core</code>
- * plug-in. The global list of known protocol adapters is available via
- * {@link MonitorPlugin#getProtocolAdapters()}. Standard protocol
- * adapters for {@linkplain #HTTP_PROTOCOL_ID HTTP} and
- * {@linkplain #TCPIP_PROTOCOL_ID TCP/IP} are built-in.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IProtocolAdapter {
- /**
- * Protocol adapter id (value {@value}) for TCP/IP.
- * The TCP/IP protocol adapter is standard.
- */
- public static String TCPIP_PROTOCOL_ID = "TCP/IP";
-
- /**
- * Protocol adapter id (value {@value}) for HTTP.
- * The HTTP protocol adapter is standard.
- */
- public static String HTTP_PROTOCOL_ID = "HTTP";
-
- /**
- * Returns the id of this adapter.
- * Each adapter has a distinct, fixed id. Ids are intended to be used
- * internally as keys; they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the displayable (translated) name for this adapter.
- *
- * @return a displayable name
- */
- public String getName();
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IStartup.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IStartup.java
deleted file mode 100644
index d414170..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IStartup.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-/**
- * An interface for the startup extension point.
- * Plug-ins that register a startup extension will be activated when the monitor
- * core plug-in initializes and have an opportunity to run code that can't be
- * implemented using the normal contribution mechanisms.
- */
-public interface IStartup {
- /**
- * Will be called on monitor core startup.
- */
- public void startup();
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Messages.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Messages.java
deleted file mode 100644
index fc4ad45..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Messages.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
- * Translated messages.
- */
-public class Messages extends NLS {
- public static String errorInvalidLocalPort;
- public static String errorInvalidRemotePort;
- public static String errorInvalidRemoteHost;
- public static String errorConnectToServer;
- public static String errorConnectTimeout;
- public static String monitorValid;
- public static String errorPortInUse;
- public static String errorContentSize;
-
- static {
- NLS.initializeMessages(MonitorPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Messages.properties b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Messages.properties
deleted file mode 100644
index f39c3f0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Messages.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2008 IBM 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
-###############################################################################
-
-# --------------- Errors ---------------
-errorPortInUse=The TCP/IP monitor could not start because port {0} is in use.
-errorInvalidLocalPort=The local port number is invalid.
-errorInvalidRemotePort=The remote port number is invalid.
-errorInvalidRemoteHost=The remote host name is invalid.
-errorConnectToServer=Error: Could not connect to server.
-errorConnectTimeout=Error: Timeout connecting to server.
-errorContentSize=The HTTP content is too large to display.
-
-monitorValid=The monitor is valid.
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java
deleted file mode 100644
index e4dbc03..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.*;
-/**
- *
- */
-public class Monitor implements IMonitor {
- private static final String MEMENTO_ID = "id";
- private static final String MEMENTO_LOCAL_PORT = "local-port";
- private static final String MEMENTO_REMOTE_HOST = "remote-host";
- private static final String MEMENTO_REMOTE_PORT = "remote-port";
- private static final String MEMENTO_TYPE_ID = "type-id";
- private static final String MEMENTO_TIMEOUT = "timeout";
- private static final String MEMENTO_AUTO_START = "auto-start";
-
- private static final int ADD = 0;
- private static final int CHANGE = 1;
-
- protected String id;
- protected String remoteHost;
- protected int remotePort = 80;
- protected int localPort = 80;
- protected String protocolId;
- protected int timeout;
- protected boolean autoStart = false;
-
- protected List<IRequestListener> requestListeners = new ArrayList<IRequestListener>(2);
-
- /**
- * Create a new monitor.
- */
- public Monitor() {
- protocolId = MonitorPlugin.getInstance().getDefaultType();
- }
-
- /** (non-Javadoc)
- * @see IMonitor#getId()
- */
- public String getId() {
- return id;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#getRemoteHost()
- */
- public String getRemoteHost() {
- return remoteHost;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#getRemotePort()
- */
- public int getRemotePort() {
- return remotePort;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#getLocalPort()
- */
- public int getLocalPort() {
- return localPort;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#getProtocol()
- */
- public String getProtocol() {
- return protocolId;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#getTimeout()
- */
- public int getTimeout() {
- return timeout;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#isAutoStart()
- */
- public boolean isAutoStart() {
- return autoStart;
- }
-
- /** (non-Javadoc)
- * @see IMonitor#isRunning()
- */
- public boolean isRunning() {
- if (isWorkingCopy())
- return false;
- return MonitorManager.getInstance().isRunning(this);
- }
-
- /**
- * @see IMonitor#delete()
- */
- public void delete() {
- if (isWorkingCopy())
- return;
- MonitorManager.getInstance().removeMonitor(this);
- }
-
- /**
- * @see IMonitor#isWorkingCopy()
- */
- public boolean isWorkingCopy() {
- return false;
- }
-
- /**
- * @see IMonitor#createWorkingCopy()
- */
- public IMonitorWorkingCopy createWorkingCopy() {
- return new MonitorWorkingCopy(this);
- }
-
- protected void setInternal(IMonitor monitor) {
- id = monitor.getId();
- remoteHost = monitor.getRemoteHost();
- remotePort = monitor.getRemotePort();
- localPort = monitor.getLocalPort();
- protocolId = monitor.getProtocol();
- timeout = monitor.getTimeout();
- autoStart = monitor.isAutoStart();
- }
-
- protected void save(IMemento memento) {
- memento.putString(MEMENTO_ID, id);
- memento.putString(MEMENTO_TYPE_ID, protocolId);
- memento.putInteger(MEMENTO_LOCAL_PORT, localPort);
- memento.putString(MEMENTO_REMOTE_HOST, remoteHost);
- memento.putInteger(MEMENTO_REMOTE_PORT, remotePort);
- memento.putInteger(MEMENTO_TIMEOUT, timeout);
- memento.putBoolean(MEMENTO_AUTO_START, autoStart);
- }
-
- protected void load(IMemento memento) {
- id = memento.getString(MEMENTO_ID);
- protocolId = memento.getString(MEMENTO_TYPE_ID);
- Integer temp = memento.getInteger(MEMENTO_LOCAL_PORT);
- if (temp != null)
- localPort = temp.intValue();
- remoteHost = memento.getString(MEMENTO_REMOTE_HOST);
- temp = memento.getInteger(MEMENTO_REMOTE_PORT);
- if (temp != null)
- remotePort = temp.intValue();
- temp = memento.getInteger(MEMENTO_TIMEOUT);
- if (temp != null)
- timeout = temp.intValue();
- Boolean temp2 = memento.getBoolean(MEMENTO_AUTO_START);
- if (temp != null)
- autoStart = temp2.booleanValue();
- }
-
- /**
- * @see IMonitor#start()
- */
- public synchronized void start() throws CoreException {
- if (isRunning())
- return;
- if (isWorkingCopy() || !MonitorManager.getInstance().exists(this))
- throw new IllegalArgumentException();
-
- IStatus status = validate();
- if (!status.isOK())
- throw new CoreException(status);
-
- MonitorManager.getInstance().startMonitor(this);
- }
-
- /**
- * @see IMonitor#start()
- */
- public synchronized void stop() {
- if (isWorkingCopy() || !MonitorManager.getInstance().exists(this))
- throw new IllegalArgumentException();
- if (!isRunning())
- return;
- MonitorManager.getInstance().stopMonitor(this);
- }
-
- /**
- * @see IMonitor#addRequestListener(IRequestListener)
- */
- public synchronized void addRequestListener(IRequestListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- if (!requestListeners.contains(listener))
- requestListeners.add(listener);
- }
-
- /**
- * @see IMonitor#removeRequestListener(IRequestListener)
- */
- public synchronized void removeRequestListener(IRequestListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- requestListeners.remove(listener);
- }
-
- /**
- * Fire a request event.
- * @param rr
- * @param type
- */
- protected void fireRequestEvent(Request rr, int type) {
- int size = requestListeners.size();
- IRequestListener[] rl = new IRequestListener[size];
- requestListeners.toArray(rl);
-
- for (IRequestListener listener : rl) {
- if (type == ADD)
- listener.requestAdded(this, rr);
- else if (type == CHANGE)
- listener.requestChanged(this, rr);
- }
- }
-
- /**
- * Add a new request response pair.
- *
- * @param request a request
- */
- public void addRequest(Request request) {
- fireRequestEvent(request, ADD);
- }
-
- /**
- * A request response pair has been changed.
- *
- * @param request a request
- */
- public void requestChanged(Request request) {
- fireRequestEvent(request, CHANGE);
- }
-
- /**
- * @see IMonitor#validate()
- */
- public IStatus validate() {
- if (localPort < 0)
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, Messages.errorInvalidLocalPort, null);
-
- if (remotePort < 0)
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, Messages.errorInvalidRemotePort, null);
-
- if (remoteHost == null || remoteHost.length() == 0 || !isValidHostname(remoteHost))
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, Messages.errorInvalidRemoteHost, null);
-
- if (isLocalhost(remoteHost) && localPort == remotePort)
- return new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, Messages.errorInvalidLocalPort, null);
-
- return Status.OK_STATUS;
- }
-
- protected static boolean isValidHostname(String host) {
- if (host == null || host.trim().length() < 1)
- return false;
-
- int length = host.length();
- for (int i = 0; i < length; i++) {
- char c = host.charAt(i);
- if (!Character.isLetterOrDigit(c) && c != ':' && c != '.' && c != '-')
- return false;
- }
- if (host.endsWith(":"))
- return false;
- return true;
- }
-
- protected static boolean isLocalhost(String host) {
- if (host == null)
- return false;
- try {
- if ("localhost".equals(host) || "127.0.0.1".equals(host))
- return true;
- InetAddress localHostaddr = InetAddress.getLocalHost();
- if (localHostaddr.getHostName().equals(host))
- return true;
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error checking for localhost", e);
- }
- return false;
- }
-
- /**
- * @see Object#toString()
- */
- public String toString() {
- return "Monitor [" + getId() + ", " + getProtocol() + ", " + getLocalPort() + ", "
- + getRemoteHost() + ", " + getRemotePort() + "]";
- }
-
- /**
- * @see Object#equals(Object)
- */
- public boolean equals(Object obj) {
- if (!(obj instanceof Monitor))
- return false;
-
- IMonitor m = (IMonitor) obj;
- if (m.isWorkingCopy()) {
- m = ((IMonitorWorkingCopy) m).getOriginal();
- if (m == null)
- return false;
- }
- if (id == null && m.getId() != null)
- return false;
- if (id != null && !id.equals(m.getId()))
- return false;
-
- if (localPort != m.getLocalPort())
- return false;
- if (remotePort != m.getRemotePort())
- return false;
-
- if (remoteHost == null && m.getRemoteHost() != null)
- return false;
- if (remoteHost != null && !remoteHost.equals(m.getRemoteHost()))
- return false;
-
- if (protocolId == null && m.getProtocol() != null)
- return false;
- if (protocolId != null && !protocolId.equals(m.getProtocol()))
- return false;
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java
deleted file mode 100644
index ba5c55f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.util.*;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.*;
-/**
- *
- */
-public class MonitorManager {
- private static final int ADD = 0;
- private static final int CHANGE = 1;
- private static final int REMOVE = 2;
-
- // monitors
- protected List<IMonitor> monitors;
- protected Map<IMonitor, AcceptThread> threads = new HashMap<IMonitor, AcceptThread>();
-
- protected List<IMonitorListener> monitorListeners = new ArrayList<IMonitorListener>();
-
- private Preferences.IPropertyChangeListener pcl;
- protected boolean ignorePreferenceChanges = false;
-
- protected Map<Request, List<ResendHTTPRequest>> resendMap = new HashMap<Request, List<ResendHTTPRequest>>();
-
- protected static MonitorManager instance;
-
- static {
- MonitorPlugin.getInstance().executeStartups();
- }
-
- /**
- * Return a static instance.
- *
- * @return the instance
- */
- public static MonitorManager getInstance() {
- if (instance == null) {
- instance = new MonitorManager();
- instance.startMonitors();
- }
-
- return instance;
- }
-
- private MonitorManager() {
- loadMonitors();
-
- pcl = new Preferences.IPropertyChangeListener() {
- public void propertyChange(Preferences.PropertyChangeEvent event) {
- if (ignorePreferenceChanges)
- return;
- String property = event.getProperty();
- if (property.equals("monitors")) {
- loadMonitors();
- }
- }
- };
-
- MonitorPlugin.getInstance().getPluginPreferences().addPropertyChangeListener(pcl);
- }
-
- protected void dispose() {
- MonitorPlugin.getInstance().getPluginPreferences().removePropertyChangeListener(pcl);
- }
-
- /**
- * Create a new monitor.
- *
- * @return the new monitor
- */
- public IMonitorWorkingCopy createMonitor() {
- return new MonitorWorkingCopy();
- }
-
- /**
- * Return the list of monitors.
- *
- * @return the list of monitors
- */
- public List<IMonitor> getMonitors() {
- return new ArrayList<IMonitor>(monitors);
- }
-
- protected synchronized void addMonitor(IMonitor monitor) {
- if (!monitors.contains(monitor))
- monitors.add(monitor);
- fireMonitorEvent(monitor, ADD);
- saveMonitors();
- }
-
- protected boolean isRunning(IMonitor monitor) {
- return (threads.get(monitor) != null);
- }
-
- /**
- * Start a monitor.
- *
- * @param monitor the monitor
- * @throws CoreException
- */
- public void startMonitor(IMonitor monitor) throws CoreException {
- if (!monitors.contains(monitor))
- return;
-
- if (AcceptThread.isPortInUse(monitor.getLocalPort()))
- throw new CoreException(new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorPortInUse, monitor.getLocalPort() + ""), null));
-
- AcceptThread thread = new AcceptThread(monitor);
- thread.startServer();
- threads.put(monitor, thread);
- }
-
- /**
- * Stop a monitor.
- *
- * @param monitor the monitor
- */
- public void stopMonitor(IMonitor monitor) {
- if (!monitors.contains(monitor))
- return;
-
- AcceptThread thread = threads.get(monitor);
- if (thread != null) {
- thread.stopServer();
- threads.remove(monitor);
- }
- }
-
- protected synchronized void removeMonitor(IMonitor monitor) {
- if (monitor.isRunning())
- stopMonitor(monitor);
- monitors.remove(monitor);
- fireMonitorEvent(monitor, REMOVE);
- saveMonitors();
- }
-
- protected synchronized void monitorChanged(IMonitor monitor) {
- fireMonitorEvent(monitor, CHANGE);
- saveMonitors();
- }
-
- protected boolean exists(IMonitor monitor) {
- return (monitors.contains(monitor));
- }
-
- /**
- * Add monitor listener.
- *
- * @param listener
- */
- public synchronized void addMonitorListener(IMonitorListener listener) {
- if (!monitorListeners.contains(listener))
- monitorListeners.add(listener);
- }
-
- /**
- * Remove monitor listener.
- *
- * @param listener
- */
- public synchronized void removeMonitorListener(IMonitorListener listener) {
- if (monitorListeners.contains(listener))
- monitorListeners.remove(listener);
- }
-
- /**
- * Fire a monitor event.
- *
- * @param monitor the monitor
- * @param type the type of event
- */
- protected void fireMonitorEvent(IMonitor monitor, int type) {
- IMonitorListener[] obj = monitorListeners.toArray(new IMonitorListener[monitorListeners.size()]);
-
- for (IMonitorListener listener : obj) {
- if (type == ADD)
- listener.monitorAdded(monitor);
- else if (type == CHANGE)
- listener.monitorChanged(monitor);
- else if (type == REMOVE)
- listener.monitorRemoved(monitor);
- }
- }
-
- protected synchronized void loadMonitors() {
- Trace.trace(Trace.FINEST, "Loading monitors");
-
- monitors = new ArrayList<IMonitor>();
- Preferences prefs = MonitorPlugin.getInstance().getPluginPreferences();
- String xmlString = prefs.getString("monitors");
- if (xmlString != null && xmlString.length() > 0) {
- try {
- ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
- IMemento memento = XMLMemento.loadMemento(in);
-
- IMemento[] children = memento.getChildren("monitor");
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- Monitor monitor = new Monitor();
- monitor.load(children[i]);
- monitors.add(monitor);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load monitors", e);
- }
- }
- }
-
- protected synchronized void saveMonitors() {
- try {
- ignorePreferenceChanges = true;
- XMLMemento memento = XMLMemento.createWriteRoot("monitors");
-
- Iterator iterator = monitors.iterator();
- while (iterator.hasNext()) {
- Monitor monitor = (Monitor) iterator.next();
- IMemento child = memento.createChild("monitor");
- monitor.save(child);
- }
-
- String xmlString = memento.saveToString();
- Preferences prefs = MonitorPlugin.getInstance().getPluginPreferences();
- prefs.setValue("monitors", xmlString);
- MonitorPlugin.getInstance().savePluginPreferences();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save browsers", e);
- }
- ignorePreferenceChanges = false;
- }
-
- /**
- * Creates a new resend request from the given request.
- *
- * @param request the request that is to be resent; may not be <code>null</code>
- * @return a new resend request
- */
- public static ResendHTTPRequest createResendRequest(Request request) {
- if (request == null)
- throw new IllegalArgumentException();
- return new ResendHTTPRequest((Monitor)request.getMonitor(), request);
- }
-
- /**
- * Adds a resend request to this request.
- *
- * @param request the resend request to add
- * @param resendReq the resend request
- */
- public void addResendRequest(Request request, ResendHTTPRequest resendReq) {
- if (request == null || resendReq == null)
- return;
-
- List<ResendHTTPRequest> list = null;
- try {
- list = resendMap.get(request);
- } catch (Exception e) {
- // ignore
- }
-
- if (list == null) {
- list = new ArrayList<ResendHTTPRequest>();
- resendMap.put(request, list);
- }
- list.add(resendReq);
- }
-
- /**
- * Returns an array of resend requests based on this request.
- *
- * @param request a request
- * @return the array of resend requests based on this request
- */
- public ResendHTTPRequest[] getResendRequests(Request request) {
- List<ResendHTTPRequest> list = resendMap.get(request);
- if (list != null)
- return list.toArray(new ResendHTTPRequest[list.size()]);
-
- return new ResendHTTPRequest[0];
- }
-
- /**
- * Start all monitors that are set to auto-start.
- */
- public synchronized void startMonitors() {
- MonitorManager manager = MonitorManager.getInstance();
- List monitorList = manager.getMonitors();
- Iterator monitorIterator = monitorList.iterator();
- while (monitorIterator.hasNext()) {
- IMonitor monitor = (IMonitor) monitorIterator.next();
- if (monitor.isAutoStart())
- try {
- monitor.start();
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Failed to start monitor:" + monitor.toString(), e);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java
deleted file mode 100644
index 5f79b19..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.util.*;
-
-import org.eclipse.core.runtime.*;
-/**
- * The monitor core plugin.
- */
-public class MonitorPlugin extends Plugin {
- /**
- * The plugin/bundle id.
- */
- public static final String PLUGIN_ID = "org.eclipse.wst.internet.monitor.core";
-
- private static MonitorPlugin singleton;
-
- protected Map<String, ProtocolAdapter> protocolAdapters;
- protected Map<String, IContentFilter> contentFilters;
- protected boolean startupsLoaded;
-
- /**
- * MonitorPlugin constructor comment.
- */
- public MonitorPlugin() {
- super();
- singleton = this;
- loadProtocolAdapters();
- loadContentFilters();
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.wst.internet.monitor.core.MonitorPlugin
- */
- public static MonitorPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the default protocol type.
- *
- * @return the protocol
- */
- public String getDefaultType() {
- return "HTTP";
- }
-
- /**
- * Returns the protocol adapter with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * protocol adapters ({@link #getProtocolAdapters()}) for the one with a
- * matching id.
- *
- * @param id the protocol adapter id; must not be <code>null</code>
- * @return the protocol adapter instance, or <code>null</code> if there
- * is no protocol adapter with the given id
- */
- public ProtocolAdapter getProtocolAdapter(String id) {
- return protocolAdapters.get(id);
- }
-
- /**
- * Returns a list of all known protocol adapter instances.
- * <p>
- * Protocol adapters are registered via the <code>protocolAdapaters</code>
- * extension point in the <code>org.eclipse.wst.internet.monitor.core</code>
- * plug-in.
- * </p>
- * <p>
- * A new array is returned on each call; clients may safely store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of protocol adapter instances
- */
- public ProtocolAdapter[] getProtocolAdapters() {
- List<ProtocolAdapter> list = new ArrayList<ProtocolAdapter>();
- Iterator<ProtocolAdapter> iterator = protocolAdapters.values().iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- ProtocolAdapter[] types = new ProtocolAdapter[list.size()];
- list.toArray(types);
- return types;
- }
-
- /**
- * Return the content filters.
- *
- * @return an array of content filters
- */
- public IContentFilter[] getContentFilters() {
- List<IContentFilter> list = new ArrayList<IContentFilter>();
- Iterator<IContentFilter> iterator = contentFilters.values().iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- IContentFilter[] cf = new IContentFilter[list.size()];
- list.toArray(cf);
- return cf;
- }
-
- /**
- * Find a content filter by the id.
- *
- * @param id an id
- * @return the content filter, or <code>null</code> if it couldn't be found
- */
- public IContentFilter findContentFilter(String id) {
- if (id == null)
- throw new IllegalArgumentException();
- return contentFilters.get(id);
- }
-
- protected synchronized void loadProtocolAdapters() {
- if (protocolAdapters != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading protocol adapters");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "internalProtocolAdapters");
-
- int size = cf.length;
- Map<String, ProtocolAdapter> map = new HashMap<String, ProtocolAdapter>(size);
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading adapter: " + id);
- map.put(id, new ProtocolAdapter(cf[i]));
- }
- protocolAdapters = map;
- }
-
- protected synchronized void loadContentFilters() {
- if (contentFilters != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading content filters");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "internalContentFilters");
-
- int size = cf.length;
- Map<String, IContentFilter> map = new HashMap<String, IContentFilter>(size);
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading filter: " + id);
- map.put(id, new ContentFilter(cf[i]));
- }
- contentFilters = map;
- }
-
- protected synchronized void executeStartups() {
- if (startupsLoaded)
- return;
-
- Trace.trace(Trace.CONFIG, "Loading startups");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "internalStartup");
-
- int size = cf.length;
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading startup: " + id);
- try {
- IStartup startup = (IStartup) cf[i].createExecutableExtension("class");
- try {
- startup.startup();
- } catch (Exception ex) {
- Trace.trace(Trace.SEVERE, "Startup failed" + startup.toString(), ex);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create startup: " + id, e);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java
deleted file mode 100644
index 21527c7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorWorkingCopy;
-/**
- *
- */
-public class MonitorWorkingCopy extends Monitor implements IMonitorWorkingCopy {
- protected Monitor monitor;
-
- /**
- * Create a new monitor working copy. (used for initial creation)
- */
- public MonitorWorkingCopy() {
- // do nothing
- }
-
- /**
- * Create a new monitor working copy. (used for working copies)
- *
- * @param monitor the monitor this working copy is for
- */
- public MonitorWorkingCopy(Monitor monitor) {
- this.monitor = monitor;
- setInternal(monitor);
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#getOriginal()
- */
- public IMonitor getOriginal() {
- return monitor;
- }
-
- /**
- * Set the id.
- *
- * @param newId the id
- */
- public void setId(String newId) {
- id = newId;
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#setRemoteHost(String)
- */
- public void setRemoteHost(String host) {
- remoteHost = host;
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#setRemotePort(int)
- */
- public void setRemotePort(int port) {
- remotePort = port;
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#setLocalPort(int)
- */
- public void setLocalPort(int port) {
- localPort = port;
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#setProtocol(String)
- */
- public void setProtocol(String protocolId2) {
- protocolId = protocolId2;
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#setTimeout(int)
- */
- public void setTimeout(int timeout2) {
- timeout = timeout2;
- }
-
- /** (non-Javadoc)
- * @see IMonitorWorkingCopy#setAutoStart(boolean)
- */
- public void setAutoStart(boolean startByDefault) {
- autoStart = startByDefault;
- }
-
- /**
- * @see IMonitor#isWorkingCopy()
- */
- public boolean isWorkingCopy() {
- return true;
- }
-
- /**
- * @see IMonitor#createWorkingCopy()
- */
- public IMonitorWorkingCopy createWorkingCopy() {
- return this;
- }
-
- /**
- * @see IMonitorWorkingCopy#save()
- */
- public synchronized IMonitor save() {
- MonitorManager mm = MonitorManager.getInstance();
- if (monitor != null) {
- //boolean restart = false;
- if (monitor.isRunning()) {
- //restart = true;
- mm.stopMonitor(monitor);
- }
- monitor.setInternal(this);
- mm.monitorChanged(monitor);
- //if (restart)
- // mm.startMonitor(monitor);
- } else {
- monitor = new Monitor();
- monitor.setInternal(this);
- mm.addMonitor(monitor);
- }
- return monitor;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java
deleted file mode 100644
index 44f8c0e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-/**
- *
- */
-public class ProtocolAdapter implements IProtocolAdapter {
- protected IConfigurationElement element;
- protected ProtocolAdapterDelegate delegate;
-
- protected ProtocolAdapter(IConfigurationElement element) {
- this.element = element;
- }
-
- /**
- * @see IProtocolAdapter#getId()
- */
- public String getId() {
- return element.getAttribute("id");
- }
-
- /**
- * @see IProtocolAdapter#getName()
- */
- public String getName() {
- return element.getAttribute("name");
- }
-
- protected ProtocolAdapterDelegate getDelegate() {
- if (delegate != null)
- return delegate;
-
- try {
- delegate = (ProtocolAdapterDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create protocol adapter delegate: " + getId(), e);
- }
- return delegate;
- }
-
- /**
- * Connect with the protocol.
- *
- * @param monitor a monitor
- * @param in an inbound socket
- * @param out an outbound socket
- * @throws IOException
- */
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- getDelegate().connect(monitor, in, out);
- }
-
- /**
- * Disconnect from the sockets.
- *
- * @param monitor a monitor
- * @throws IOException
- */
- public void disconnect(IMonitor monitor) throws IOException {
- getDelegate().disconnect(monitor);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapterDelegate.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapterDelegate.java
deleted file mode 100644
index a07cd3d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapterDelegate.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-/**
- * Abstract base class for protocol adapter delegates, which provide the
- * implementation behind a particular protocol adapter.
- * A protocol adapter watches the message traffic passing between client and
- * server; it parses the messages and reports them in the form of
- * Request objects.
- * <p>
- * This abstract class is intended to be subclassed only by clients
- * to extend the <code>protocolAdapters</code> extension point.
- * The subclass must have a public 0-argument constructor, which will be used
- * automatically to instantiate the delegate when required.
- * </p>
- * <p>
- * There is only one delegate created per protocol, and this delegate must
- * be able to handle multiple monitor instances. This means that the delegate
- * typically will not have instance state, or must synchronize and keep the
- * state separate.
- * </p>
- * <p>
- * [issue: The HTTP and TCP/IP delegate implementations create threads which
- * shuffle info between sockets. If the monitor is changed or deleted, how do
- * these threads go away? Methinks that delegates in general should be forced
- * to implement disconnect(IMonitor) as well. This method would be called by the
- * system when the monitor is changed or deleted, or when the plug-in is
- * being shut down.]
- * </p>
- */
-public abstract class ProtocolAdapterDelegate {
- /**
- * Establishes an ongoing connection between client and server being
- * monitored by the given monitor. The <code>in</code> socket is associated
- * with the monitor's client. The <code>out</code> socket is associated with
- * the monitor's server. Different adapaters handle different network
- * protocols.
- * <p>
- * Subclasses must implement this method to achieve the following:
- * <ul>
- * <li>Client to server communication -
- * Opening an input stream on the <code>in</code> socket, opening an output
- * stream on the <code>out</code> socket, and establishing a mechanism that
- * will pass along all bytes received on the input stream to the output
- * stream.</li>
- * <li>Server to client communication - Opening an input stream on the
- * <code>out</code> socket, opening an output stream on the <code>in</code>
- * socket, and establishing a mechanism that will pass along all bytes
- * received on the input stream to the output stream.</li>
- * <li>Parsing the protocol-specific message traffic to create and report
- * request objects for each message passed between client and server.</li>
- * <li>Closing the input and output sockets and otherwise cleaning up
- * afterwards.</li>
- * </ul>
- * </p>
- *
- * @param monitor the monitor that uses this protocol adapter
- * @param in the input socket of the monitor client
- * @param out the output socket of the monitor server
- * @throws IOException if an exception occur when opening the streams of the
- * input or output sockets
- */
- public abstract void connect(IMonitor monitor, Socket in, Socket out) throws IOException;
-
- /**
- * Called if the monitor is changed or deleted, or the plugin is shutting down.
- * The delegate must clean up the connections and threads created to respond to
- * this monitor.
- *
- * @param monitor
- * @throws IOException
- */
- public abstract void disconnect(IMonitor monitor) throws IOException;
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java
deleted file mode 100644
index 62b4dd9..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.nio.channels.SocketChannel;
-/**
- * A socket that is only used for resending requests. All input operations are
- * ignored.
- */
-public class SocketWrapper extends Socket {
- private InputStream inputStream;
- private OutputStream outputStream;
-
- /**
- * Create a new socket wrapper.
- *
- * @param inputStream
- */
- public SocketWrapper(InputStream inputStream) {
- this.inputStream = inputStream;
- this.outputStream = new DummyOutputStream();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#bind(java.net.SocketAddress)
- */
- public void bind(SocketAddress arg0) throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#close()
- */
- public synchronized void close() throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#connect(java.net.SocketAddress, int)
- */
- public void connect(SocketAddress arg0, int arg1) throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#connect(java.net.SocketAddress)
- */
- public void connect(SocketAddress arg0) throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getChannel()
- */
- public SocketChannel getChannel() {
- return super.getChannel();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getInetAddress()
- */
- public InetAddress getInetAddress() {
- return super.getInetAddress();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getInputStream()
- */
- public InputStream getInputStream() throws IOException {
- return inputStream;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getKeepAlive()
- */
- public boolean getKeepAlive() throws SocketException {
- return false;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getLocalAddress()
- */
- public InetAddress getLocalAddress() {
- return super.getLocalAddress();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getLocalPort()
- */
- public int getLocalPort() {
- return super.getLocalPort();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getLocalSocketAddress()
- */
- public SocketAddress getLocalSocketAddress() {
- return super.getLocalSocketAddress();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getOOBInline()
- */
- public boolean getOOBInline() throws SocketException {
- return super.getOOBInline();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getOutputStream()
- */
- public OutputStream getOutputStream() throws IOException {
- return outputStream;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getPort()
- */
- public int getPort() {
- return super.getPort();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getReceiveBufferSize()
- */
- public synchronized int getReceiveBufferSize() throws SocketException {
- return super.getReceiveBufferSize();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getRemoteSocketAddress()
- */
- public SocketAddress getRemoteSocketAddress() {
- return super.getRemoteSocketAddress();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getReuseAddress()
- */
- public boolean getReuseAddress() throws SocketException {
- return super.getReuseAddress();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getSendBufferSize()
- */
- public synchronized int getSendBufferSize() throws SocketException {
- return super.getSendBufferSize();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getSoLinger()
- */
- public int getSoLinger() throws SocketException {
- return super.getSoLinger();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getSoTimeout()
- */
- public synchronized int getSoTimeout() throws SocketException {
- return super.getSoTimeout();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getTcpNoDelay()
- */
- public boolean getTcpNoDelay() throws SocketException {
- return super.getTcpNoDelay();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#getTrafficClass()
- */
- public int getTrafficClass() throws SocketException {
- return super.getTrafficClass();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#isBound()
- */
- public boolean isBound() {
- return super.isBound();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#isClosed()
- */
- public boolean isClosed() {
- return false;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#isConnected()
- */
- public boolean isConnected() {
- return true;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#isInputShutdown()
- */
- public boolean isInputShutdown() {
- return false;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#isOutputShutdown()
- */
- public boolean isOutputShutdown() {
- return false;
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#sendUrgentData(int)
- */
- public void sendUrgentData(int arg0) throws IOException {
- super.sendUrgentData(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setKeepAlive(boolean)
- */
- public void setKeepAlive(boolean arg0) throws SocketException {
- super.setKeepAlive(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setOOBInline(boolean)
- */
- public void setOOBInline(boolean arg0) throws SocketException {
- super.setOOBInline(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setReceiveBufferSize(int)
- */
- public synchronized void setReceiveBufferSize(int arg0) throws SocketException {
- super.setReceiveBufferSize(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setReuseAddress(boolean)
- */
- public void setReuseAddress(boolean arg0) throws SocketException {
- super.setReuseAddress(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setSendBufferSize(int)
- */
- public synchronized void setSendBufferSize(int arg0) throws SocketException {
- super.setSendBufferSize(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setSoLinger(boolean, int)
- */
- public void setSoLinger(boolean arg0, int arg1) throws SocketException {
- super.setSoLinger(arg0, arg1);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setSoTimeout(int)
- */
- public synchronized void setSoTimeout(int arg0) throws SocketException {
- super.setSoTimeout(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setTcpNoDelay(boolean)
- */
- public void setTcpNoDelay(boolean arg0) throws SocketException {
- super.setTcpNoDelay(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#setTrafficClass(int)
- */
- public void setTrafficClass(int arg0) throws SocketException {
- super.setTrafficClass(arg0);
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#shutdownInput()
- */
- public void shutdownInput() throws IOException {
- inputStream.close();
- }
-
- /** (non-Javadoc)
- * @see java.net.Socket#shutdownOutput()
- */
- public void shutdownOutput() throws IOException {
- // do nothing
- }
-
- /**
- * A dummy OutputStream that allows us to fake output for a socket.
- */
- public class DummyOutputStream extends OutputStream {
- /** (non-Javadoc)
- * @see java.io.OutputStream#close()
- */
- public void close() throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.io.OutputStream#flush()
- */
- public void flush() throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.io.OutputStream#write(byte[], int, int)
- */
- public void write(byte[] arg0, int arg1, int arg2) throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.io.OutputStream#write(byte[])
- */
- public void write(byte[] arg0) throws IOException {
- // do nothing
- }
-
- /** (non-Javadoc)
- * @see java.io.OutputStream#write(int)
- */
- public void write(int arg0) throws IOException {
- // do nothing
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java
deleted file mode 100644
index 8ca4ec8..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- *
- */
-public class TCPIPProtocolAdapter extends ProtocolAdapterDelegate {
- protected Map<IMonitor, Connection> map = new HashMap<IMonitor, Connection>();
-
- /**
- * @see ProtocolAdapterDelegate#connect(IMonitor, Socket, Socket)
- */
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- Request request = new Request((Monitor) monitor, IProtocolAdapter.TCPIP_PROTOCOL_ID, monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- Connection conn = new Connection(in, out);
- map.put(monitor, conn);
- TCPIPThread requestThread = new TCPIPThread(conn, request, in.getInputStream(), out.getOutputStream(), true);
- requestThread.start();
- new TCPIPThread(conn, request, out.getInputStream(), in.getOutputStream(), false).start();
- }
-
- /**
- * @see ProtocolAdapterDelegate#disconnect(IMonitor)
- */
- public void disconnect(IMonitor monitor) throws IOException {
- try {
- Connection conn = map.get(monitor);
- conn.close();
- } catch (Exception e) {
- // ignore
- }
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPThread.java
deleted file mode 100644
index 234de85..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPThread.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.*;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * Monitor server I/O thread.
- */
-public class TCPIPThread extends Thread {
- private static final int BUFFER = 2048;
- protected InputStream in;
- protected OutputStream out;
- protected boolean isRequest;
-
- protected Connection conn;
- protected Request request;
-
- /**
- * Create a new TCP/IP thread.
- *
- * @param conn
- * @param request
- * @param in
- * @param out
- * @param isRequest
- */
- public TCPIPThread(Connection conn, Request request, InputStream in, OutputStream out, boolean isRequest) {
- super("TCP/IP Monitor TCP/IP Connection");
- this.conn = conn;
- this.request = request;
- this.in = in;
- this.out = out;
- this.isRequest = isRequest;
- setPriority(Thread.NORM_PRIORITY + 1);
- setDaemon(true);
- }
-
- /**
- * Listen for input, save it, and pass to the output stream.
- */
- public void run() {
- try {
- byte[] b = new byte[BUFFER];
- int n = in.read(b);
- while (n > 0) {
- out.write(b, 0, n);
- if (b != null && n > 0) {
- byte[] x = null;
- if (n == BUFFER)
- x = b;
- else {
- x = new byte[n];
- System.arraycopy(b, 0, x, 0, n);
- }
- if (isRequest)
- request.addToRequest(x);
- else
- request.addToResponse(x);
- }
- n = in.read(b);
- Thread.yield();
- }
- out.flush();
- } catch (IOException e) {
- // ignore
- } finally {
- //request.fireChangedEvent();
- if (!isRequest)
- conn.close();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
deleted file mode 100644
index c2a860f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- /**
- * Config trace event.
- */
- public static final byte CONFIG = 0;
-
- /**
- * Warning trace event.
- */
- public static final byte WARNING = 1;
-
- /**
- * Severe trace event.
- */
- public static final byte SEVERE = 2;
-
- /**
- * Finest trace event.
- */
- public static final byte FINEST = 3;
-
- /**
- * Parsing trace event.
- */
- public static final byte PARSING = 4;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param level the trace level
- * @param s a message
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param level the trace level
- * @param s a message
- * @param t a throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (level == SEVERE)
- MonitorPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, s, t));
-
- if (!MonitorPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(MonitorPlugin.PLUGIN_ID + " " + System.currentTimeMillis() + " thread=["+Thread.currentThread().getId() +"]" + s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java
deleted file mode 100644
index 8cbf231..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.*;
-import java.util.*;
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistence with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- private XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /**
- * @see IMemento#createChild(String)
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- private static XMLMemento createReadRoot(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(in));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (ParserConfigurationException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- } catch (SAXException e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- *
- * @param type
- * @return a memento
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /**
- * @see IMemento#getChild(String)
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /**
- * @see IMemento#getChildren(String)
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- List<Element> list = new ArrayList<Element>(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, list.get(x));
- }
- return results;
- }
-
- /**
- * @see IMemento#getInteger(String)
- */
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Integer(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /**
- * @see IMemento#getString(String)
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in the input stream
- * @return a memento
- */
- public static IMemento loadMemento(InputStream in) {
- return createReadRoot(in);
- }
-
- /**
- * @see IMemento#putInteger(String, int)
- */
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
-
- /**
- * @see IMemento#putString(String, String)
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to an output stream.
- *
- * @param os
- * @throws IOException
- */
- private void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Save to string.
- *
- * @return the string
- * @throws IOException
- */
- public String saveToString() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toString("UTF-8");
- }
-
- /**
- * @see IMemento#getBoolean(String)
- */
- public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- if ("true".equalsIgnoreCase(strValue))
- return new Boolean(true);
-
- return new Boolean(false);
- }
-
- /**
- * @see IMemento#putBoolean(String, boolean)
- */
- public void putBoolean(String key, boolean value) {
- element.setAttribute(key, value ? "true" : "false");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java
deleted file mode 100644
index 02cb85d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-
-import java.util.List;
-import java.util.ArrayList;
-/**
- * Manages a monitor server connection between two hosts. This
- * connection may spawn one or more TCP/IP requests to be displayed
- * in the monitor server view.
- */
-public class HTTPConnection {
- protected IMonitor monitor;
-
- protected int req = -1;
- protected int resp = -1;
-
- protected List<Request> requests = new ArrayList<Request>();
-
- /**
- * HTTPConnection constructor comment.
- *
- * @param monitor a monitor
- */
- public HTTPConnection(IMonitor monitor) {
- super();
- this.monitor = monitor;
- Trace.trace(Trace.PARSING, "TCP/IP monitor connection opened " + monitor);
- }
-
- /**
- * Add a request.
- *
- * @param b the request data
- * @param isNew true if new
- */
- public void addRequest(byte[] b, boolean isNew) {
- if (isNew)
- req ++;
- HTTPRequest request = (HTTPRequest) getRequestResponse(req);
- request.addToRequest(b);
- }
-
- /**
- * Add a response.
- *
- * @param b the response data
- * @param isNew true if new
- */
- public void addResponse(byte[] b, boolean isNew) {
- if (isNew)
- resp ++;
- HTTPRequest request = (HTTPRequest) getRequestResponse(resp);
- request.addToResponse(b);
- }
-
- /**
- * Add a property.
- *
- * @param key
- * @param value
- */
- public void addProperty(String key, Object value) {
- Request request = getRequestResponse(req);
- request.setProperty(key, value);
- }
-
- /**
- * Get the request.
- *
- * @param isRequest
- * @return the request
- */
- public Request getRequestResponse(boolean isRequest) {
- if (isRequest)
- return getRequestResponse(req);
-
- return getRequestResponse(resp);
- }
-
- /**
- *
- */
- protected Request getRequestResponse(int i) {
- synchronized (this) {
- while (i >= requests.size()) {
- Request request = new HTTPRequest((Monitor) monitor, monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- requests.add(request);
- return request;
- }
- return requests.get(i);
- }
- }
-
- /**
- * Set the title.
- *
- * @param title the title
- * @param isNew boolean
- */
- public void setLabel(String title, boolean isNew) {
- if (isNew)
- req ++;
- HTTPRequest request = (HTTPRequest) getRequestResponse(req);
- request.setName(title);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java
deleted file mode 100644
index 7c24cfe..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-/**
- *
- */
-public class HTTPProtocolAdapter extends ProtocolAdapterDelegate {
- protected Map<IMonitor, Connection> map = new HashMap<IMonitor, Connection>();
-
- /**
- * @see ProtocolAdapterDelegate#connect(IMonitor, Socket, Socket)
- */
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- Connection conn2 = new Connection(in, out);
- map.put(monitor, conn2);
- HTTPConnection conn = new HTTPConnection(monitor);
- HTTPThread request = new HTTPThread(conn2, in.getInputStream(), out.getOutputStream(), conn, true, monitor.getRemoteHost(), monitor.getRemotePort());
- HTTPThread response = new HTTPThread(conn2, out.getInputStream(), in.getOutputStream(), conn, false, "localhost", monitor.getLocalPort(), request);
- request.start();
- response.start();
- }
-
- /**
- * @see ProtocolAdapterDelegate#disconnect(IMonitor)
- */
- public void disconnect(IMonitor monitor) throws IOException {
- try {
- Connection conn = map.get(monitor);
- if (conn != null)
- conn.close();
- } catch (Exception e) {
- // ignore
- }
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java
deleted file mode 100644
index 83e1655..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.internal.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- *
- */
-public class HTTPRequest extends Request {
- protected static final String HTTP_REQUEST_HEADER = "request-header";
- protected static final String HTTP_RESPONSE_HEADER = "response-header";
-
- protected static final String HTTP_REQUEST_BODY = "request-body";
- protected static final String HTTP_RESPONSE_BODY = "response-body";
-
- protected static final byte[] EMPTY = new byte[0];
-
- /**
- * Create an HTTPRequest.
- *
- * @param monitor
- * @param localPort
- * @param remoteHost
- * @param remotePort
- */
- public HTTPRequest(Monitor monitor, int localPort, String remoteHost, int remotePort) {
- super(monitor, IProtocolAdapter.HTTP_PROTOCOL_ID, localPort, remoteHost, remotePort);
- }
-
- /**
- * @see Request#getRequest(int)
- */
- public byte[] getRequest(int type2) {
- if (type2 == ALL)
- return request;
- else if (type2 == TRANSPORT)
- return getRequestHeader();
- else
- return getRequestContent();
- }
-
- /**
- * @see Request#getResponse(int)
- */
- public byte[] getResponse(int type2) {
- if (type2 == ALL)
- return response;
- else if (type2 == TRANSPORT)
- return getResponseHeader();
- else
- return getResponseContent();
- }
-
- protected byte[] getRequestHeader() {
- Object obj = getProperty(HTTP_REQUEST_HEADER);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getRequestContent() {
- Object obj = getProperty(HTTP_REQUEST_BODY);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getResponseHeader() {
- Object obj = getProperty(HTTP_RESPONSE_HEADER);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getResponseContent() {
- Object obj = getProperty(HTTP_RESPONSE_BODY);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected void setName(String n) {
- super.setName(n);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
deleted file mode 100644
index 8eee71f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
+++ /dev/null
@@ -1,726 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import java.io.*;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.Messages;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * Monitor server I/O thread.
- */
-public class HTTPThread extends Thread {
- private static final int BUFFER = 2048;
- private static final byte CR = (byte) '\r';
- private static final byte LF = (byte) '\n';
- protected static int threadCount = 0;
-
- private byte[] readBuffer = new byte[BUFFER];
-
- // buffer and index
- protected byte[] buffer = new byte[0];
- protected int bufferIndex = 0;
-
- protected InputStream in;
- protected OutputStream out;
- protected HTTPConnection conn;
- protected boolean isRequest;
- protected Connection conn2;
-
- protected HTTPThread request;
- protected boolean isWaiting;
-
- // user to translate the Host: header
- protected String host;
- protected int port;
-
- protected int contentLength = -1;
- protected byte transferEncoding = -1;
- protected String responseType = null;
- protected boolean connectionKeepAlive = false;
- protected boolean connectionClose = false;
-
- protected static final String[] ENCODING_STRING = new String[] {
- "chunked", "identity", "gzip", "compressed", "deflate"};
-
- protected static final byte ENCODING_CHUNKED = 0;
- protected static final byte ENCODING_IDENTITY = 1;
- protected static final byte ENCODING_GZIP = 2;
- protected static final byte ENCODING_COMPRESSED = 3;
- protected static final byte ENCODING_DEFLATE = 4;
-
-/* change:
-Referer: http://localhost:8081/index.html
-Host: localhost:8081
-*/
-/* The Connection header has the following grammar:
-
- Connection = "Connection" ":" 1#(connection-token)
- connection-token = token
-
- HTTP/1.1 proxies MUST parse the Connection header field before a
- message is forwarded and, for each connection-token in this field,
- remove any header field(s) from the message with the same name as the
- connection-token. */
-
- /**
- * Create a new HTTP thread.
- *
- * @param conn2
- * @param in
- * @param out
- * @param conn
- * @param isRequest
- * @param host
- * @param port
- */
- public HTTPThread(Connection conn2, InputStream in, OutputStream out, HTTPConnection conn, boolean isRequest, String host, int port) {
- super("TCP/IP Monitor HTTP Connection");
- this.conn2 = conn2;
- this.in = in;
- this.out = out;
- this.conn = conn;
- this.isRequest = isRequest;
- this.host = host;
- this.port = port;
-
- setName("HTTP (" + host + ":" + port + ") " + (isRequest ? "REQUEST" : "RESPONSE") + " " + (threadCount++));
- setPriority(Thread.NORM_PRIORITY + 1);
- setDaemon(true);
-
- Trace.trace(Trace.PARSING, "Started: " + this);
- }
-
- /**
- * Create a new HTTP thread.
- *
- * @param conn2
- * @param in
- * @param out
- * @param conn
- * @param isRequest
- * @param host
- * @param port
- * @param request
- */
- public HTTPThread(Connection conn2, InputStream in, OutputStream out, HTTPConnection conn, boolean isRequest, String host, int port, HTTPThread request) {
- this(conn2, in, out, conn, isRequest, host, port);
-
- this.request = request;
- }
-
- /**
- * Add a line feed to the end of the byte array.
- * @return byte[]
- * @param b byte[]
- */
- protected static byte[] convert(byte[] b) {
- if (b == null || b.length == 0)
- return b;
-
- int size = b.length;
- byte[] x = new byte[size + 2];
- System.arraycopy(b, 0, x, 0, size);
- x[size] = (byte) '\r'; // CR
- x[size + 1] = (byte) '\n'; // LF
- return x;
- }
-
- /**
- * Read more data into the buffer.
- */
- protected void fillBuffer() throws IOException {
- int n = in.read(readBuffer);
-
- if (n <= 0)
- throw new IOException("End of input");
-
- // add to full buffer
- int len = buffer.length - bufferIndex;
- if (len < 0)
- len = 0;
- byte[] x = new byte[n + len];
- System.arraycopy(buffer, bufferIndex, x, 0, len);
- System.arraycopy(readBuffer, 0, x, len, n);
- bufferIndex = 0;
- buffer = x;
- }
-
- /**
- * Returns the first location of a CRLF.
- *
- * @return int
- */
- protected int getFirstCRLF() {
- int size = buffer.length;
- int i = bufferIndex + 1;
- while (i < size) {
- if (buffer[i - 1] == CR && buffer[i] == LF)
- return i;
- i++;
- }
- return -1;
- }
-
- /**
- * Output the given bytes.
- * @param b byte[]
- */
- protected void outputBytes(byte[] b, boolean isNew) throws IOException {
- out.write(b);
- if (isRequest)
- conn.addRequest(b, isNew);
- else
- conn.addResponse(b, isNew);
- }
-
- /**
- * Parse the HTTP body.
- *
- * @throws IOException
- */
- public void parseBody() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing body for: " + this);
-
- if (responseType != null && ("204".equals(responseType) || "304".equals(responseType))) {
- setHTTPBody(new byte[0]);
- return;
- }
-
- if (isRequest) {
- if (contentLength != -1) {
- byte[] b2 = null;
- int b2Index = 0;
- if (contentLength < 1024 * 1024)
- b2 = new byte[contentLength];
- byte[] b = removeFromBuffer(Math.min(buffer.length, bufferIndex + contentLength));
- if (b2 != null) {
- System.arraycopy(b, 0, b2, 0, b.length);
- b2Index += b.length;
- }
- int bytesLeft = contentLength - b.length;
- Trace.trace(Trace.PARSING, "[Request] bytesLeft: "+ bytesLeft);
- out.write(b);
-
- int n = 0;
- while (bytesLeft > 0) {
- n = in.read(readBuffer, 0, Math.min(readBuffer.length, bytesLeft));
- bytesLeft -= n;
- if (b2 != null) {
- System.arraycopy(readBuffer, 0, b2, b2Index, n);
- b2Index += n;
- }
- out.write(readBuffer, 0, n);
- Trace.trace(Trace.PARSING, "[Request] bytes read: "+ n + " bytesLeft: "+ bytesLeft);
- }
-
- // restore the byte array for display
- if (b2 == null)
- b2 = Messages.errorContentSize.getBytes();
-
- conn.addRequest(b2, false);
- setHTTPBody(b2);
- } else if (transferEncoding != -1 && transferEncoding != ENCODING_IDENTITY) {
- parseChunk();
- }
-
- Trace.trace(Trace.PARSING, "Done parsing request body for: " + this);
- return;
- }
-
- // just return body for HTTP 1.0 responses
- if (!isRequest && !connectionKeepAlive && contentLength == -1 && transferEncoding == -1) {
- Trace.trace(Trace.PARSING, "Assuming HTTP 1.0 for: " + this);
- int n = buffer.length - bufferIndex;
- byte[] b = readBytes(n);
- byte[] body = new byte[0];
- while (n >= 0) {
- Trace.trace(Trace.PARSING, "Bytes read: " + n + " " + this);
- if (b != null && n > 0) {
- byte[] x = null;
- if (n == b.length)
- x = b;
- else {
- x = new byte[n];
- System.arraycopy(b, 0, x, 0, n);
- }
- outputBytes(x, false);
-
- // copy to HTTP body
- byte[] temp = new byte[body.length + x.length];
- System.arraycopy(body, 0, temp, 0, body.length);
- System.arraycopy(x, 0, temp, body.length, x.length);
- body = temp;
- }
- if (b == null || b.length < BUFFER)
- b = new byte[BUFFER];
- n = in.read(b);
- Thread.yield();
- }
- out.flush();
- setHTTPBody(body);
- return;
- }
-
- // spec 4.4.1
- if (responseType != null && responseType.startsWith("1")) {
- setHTTPBody(new byte[0]);
- return;
- }
-
- // spec 4.4.2
- if (transferEncoding != -1 && transferEncoding != ENCODING_IDENTITY) {
- parseChunk();
- return;
- }
-
- // spec 4.4.3
- if (contentLength != -1) {
- byte[] b2 = null;
- int b2Index = 0;
- if (contentLength < 1024 * 1024)
- b2 = new byte[contentLength];
- byte[] b = removeFromBuffer(Math.min(buffer.length, bufferIndex + contentLength));
- if (b2 != null) {
- System.arraycopy(b, 0, b2, 0, b.length);
- b2Index += b.length;
- }
- int bytesLeft = contentLength - b.length;
- Trace.trace(Trace.PARSING,"bytesLeft: "+ bytesLeft);
- out.write(b);
-
- int n = 0;
- while (bytesLeft > 0) {
- n = in.read(readBuffer, 0, Math.min(readBuffer.length, bytesLeft));
- bytesLeft -= n;
- if (b2 != null) {
- System.arraycopy(readBuffer, 0, b2, b2Index, n);
- b2Index += n;
- }
- Trace.trace(Trace.PARSING,"bytes read: "+n + " bytesLeft: "+ bytesLeft);
- out.write(readBuffer, 0, n);
- }
-
- // restore the byte array for display
- if (b2 == null)
- b2 = Messages.errorContentSize.getBytes();
-
- if (isRequest)
- conn.addRequest(b2, false);
- else
- conn.addResponse(b2, false);
- setHTTPBody(b2);
- return;
- }
-
- // spec 4.4.4 (?)
-
- Trace.trace(Trace.PARSING, "Unknown body for: " + this);
- }
-
- // Use this method to dump the content of a byte array
- //
- // private void dumpBuffer(byte[] b) {
- // Trace.trace(Trace.PARSING, "Buffer dump to default.out:");
- // Trace.trace(Trace.PARSING, "Byte array: " + b.length);
- // for (int i = 0; i < b.length; i++) {
- // System.out.print(" [" + (char) b[i] + "]"); // +" ["+b[i+1]+"] "
- // if (i % 20 == 0) {
- // System.out.println();
- // }
- // }
- // }
-
-
- /**
- * Parse an HTTP chunk.
- *
- * @throws IOException
- */
- public void parseChunk() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing chunk for: " + this);
- boolean done = false;
- byte[] body = new byte[0];
-
- while (!done) {
- // read chunk size
- byte[] b = readLine();
-
- String s = new String(b);
- Trace.trace(Trace.PARSING, "Chunk-length: "+s);
- int index = s.indexOf(" ");
- int length = -1;
- try {
- if (index > 0)
- s = s.substring(0, index);
- length = Integer.parseInt(s.trim(), 16);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error chunk for: " + this, e);
- }
-
- // output bytes
- outputBytes(b, false);
-
- if (length <= 0)
- done = true;
- else {
- // read and output chunk data plus CRLF
- b = readBytes(length + 2);
- outputBytes(b, false);
-
- // copy to HTTP body
- byte[] temp = new byte[body.length + b.length - 2];
- System.arraycopy(body, 0, temp, 0, body.length);
- System.arraycopy(b, 0, temp, body.length, b.length - 2);
- body = temp;
- }
- }
-
- // read trailer
- byte[] b = readLine();
- while (b.length > 2) {
- outputBytes(b, false);
- b = readLine();
- }
-
- outputBytes(b, false);
- setHTTPBody(body);
- }
-
- /**
- * Parse an HTTP header.
- *
- * @throws IOException
- */
- public void parseHeader() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing header for: " + this);
-
- // read until first blank line
- boolean isFirstLine = true;
- boolean isNew = true;
-
- byte[] b = readLine();
- while (b.length > 5) {
- Trace.trace(Trace.PARSING, "Parsing header line: '" + new String(b) + "'");
-
- if (isFirstLine) {
- String s = new String(b);
- if (isRequest) {
- setLabel(s);
- isNew = false;
- }
-
- if (!isRequest) {
- int index1 = s.indexOf(' ');
- int index2 = s.indexOf(' ', index1 + 1);
-
- try {
- responseType = s.substring(index1 + 1, index2).trim();
- Trace.trace(Trace.PARSING, "Response Type: " + this + " " + responseType);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error parsing response type for: " + this, e);
- }
- if (responseType != null && responseType.equals("100")) {
- outputBytes(b, isNew);
- isNew = false;
-
- b = readLine();
- outputBytes(b, false);
-
- b = readLine();
-
- index1 = s.indexOf(' ');
- index2 = s.indexOf(' ', index1 + 1);
-
- try {
- responseType = s.substring(index1 + 1, index2).trim();
- Trace.trace(Trace.PARSING, "Response Type: " + this + " " + responseType);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error parsing response type for: " + this, e);
- }
- }
- }
- isFirstLine = false;
- }
-
- // translate
- b = translateHeaderLine(b);
-
- outputBytes(b, isNew);
- isNew = false;
-
- b = readLine();
- }
-
- Trace.trace(Trace.PARSING, "Parsing final header line: '" + new String(b) + "'");
-
- outputBytes(b, false);
-
- Request rr = conn.getRequestResponse(isRequest);
- Trace.trace(Trace.PARSING, "Setting header length: " + rr.getRequest(Request.ALL).length);
-
- setHTTPHeader(rr);
- }
-
- /**
- * Read bytes from the stream.
- * @return byte[]
- */
- protected byte[] readBytes(int n) throws IOException {
- Trace.trace(Trace.PARSING, "readBytes() " + n + " for: " + this);
- while (buffer.length - bufferIndex < n)
- fillBuffer();
-
- return removeFromBuffer(bufferIndex + n);
- }
-
- /**
- * Read and return the next full line.
- *
- * @return byte[]
- */
- protected byte[] readLine() throws IOException {
- Trace.trace(Trace.PARSING, "readLine() for: " + this);
-
- int n = getFirstCRLF();
- while (n < 0) {
- fillBuffer();
- n = getFirstCRLF();
- }
- return removeFromBuffer(n + 1);
- }
-
- /**
- * Remove data from the buffer up to the absolute index n.
- * Return the data from between bufferIndex and n.
- *
- * @param n the bytes to remove
- * @return a byte array
- */
- protected byte[] removeFromBuffer(int n) {
- // copy line out of buffer
- byte[] b = new byte[n - bufferIndex];
- System.arraycopy(buffer, bufferIndex, b, 0, n - bufferIndex);
-
- if (buffer.length > BUFFER * 2 || bufferIndex > BUFFER) {
- // remove line from buffer
- int size = buffer.length;
- byte[] x = new byte[size - n];
- System.arraycopy(buffer, n, x, 0, size - n);
- buffer = x;
- bufferIndex = 0;
- } else
- bufferIndex = n;
-
- return b;
- }
-
- /**
- * Listen for input, save it, and pass to the output stream.
- * Philosophy: Read a single line separately and translate.
- * When blank line is reached, just pass all other data through.
- */
- public void run() {
- try {
- try {
- while (true) {
- contentLength = -1;
- transferEncoding = -1;
- connectionKeepAlive = false;
- connectionClose = false;
-
- parseHeader();
- parseBody();
-
- if (isRequest && connectionKeepAlive)
- waitForResponse();
-
- //Request r = conn.getRequestResponse(true);
- //r.fireChangedEvent();
-
- Trace.trace(Trace.PARSING, "Done HTTP request for " + this + " " + connectionKeepAlive);
- if (!isRequest && (!request.connectionKeepAlive || connectionClose)) {
- conn2.close();
- if (request.connectionKeepAlive && connectionClose)
- request.connectionKeepAlive = false;
- notifyRequest();
- break;
- }
-
- if (!isRequest)
- notifyRequest();
-
- Thread.yield();
- }
- } catch (IOException e) {
- // reached end of input
- Trace.trace(Trace.PARSING, "End of buffer for: " + this, e);
- if (!isRequest) {
- try {
- request.connectionKeepAlive = false;
- request.conn2.close();
- notifyRequest();
- } catch (Exception ex) {
- Trace.trace(Trace.PARSING, "Error closing request in response to error: " + this, e);
- }
- }
- }
-
- // send rest of buffer
- out.write(buffer, bufferIndex, buffer.length - bufferIndex);
- out.flush();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in: " + this, e);
- }
- //if (!isRequest)
- // conn2.close();
-
- Trace.trace(Trace.PARSING, "Closing thread " + this);
- }
-
- /**
- * Sets the title of the call.
- *
- * @param s java.lang.String
- */
- protected void setLabel(String s) {
- try {
- int index1 = s.indexOf(' ');
- if (index1 < 0 || index1 > 15)
- return;
- int index2 = s.indexOf(' ', index1 + 1);
- if (index2 < 0)
- return;
-
- conn.setLabel(s.substring(index1 + 1, index2), true);
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Translate the header line.
- *
- * @return byte[]
- * @param b byte[]
- */
- protected byte[] translateHeaderLine(byte[] b) {
- String s = new String(b);
-
- if (isRequest && s.startsWith("Host: ")) {
- String t = "Host: " + host;
- if (port != 80)
- t += ":" + port;
- return convert(t.getBytes());
- } else if (s.toLowerCase().startsWith("content-length: ")) {
- try {
- contentLength = Integer.parseInt(s.substring(16).trim());
- Trace.trace(Trace.PARSING, "Content length: " + this + " " + contentLength);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Content length error", e);
- }
- } else if (s.startsWith("Connection: ")) {
- try {
- String t = s.substring(11).trim();
- if (t.equalsIgnoreCase("Keep-Alive"))
- connectionKeepAlive = true;
- // response contains "Connection: close" header
- // close connection to the client even if "keepalive" had been requested
- // we can't just reset request.keepAlive - it's used as indicator whether
- // the request thread is (going to) wait for the response thread
- // (and must be notified (only then)),
- // so we have to let it alone
- if (t.equalsIgnoreCase("close"))
- connectionClose = true;
- Trace.trace(Trace.PARSING, "Keep alive: " + connectionKeepAlive);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error getting Connection: from header", e);
- }
- } else if (s.startsWith("Transfer-Encoding: ")) {
- String t = s.substring(19).trim();
- int size = ENCODING_STRING.length;
- for (int i = 0; i < size; i++) {
- if (ENCODING_STRING[i].equalsIgnoreCase(t)) {
- transferEncoding = (byte) i;
- Trace.trace(Trace.PARSING, "Transfer encoding: " + ENCODING_STRING[i]);
- }
- }
- }
-
- return b;
- }
-
- protected void close() {
- try {
- Trace.trace(Trace.PARSING, "Closing: " + this);
- out.close();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error closing connection " + this, e);
- }
- }
-
- protected void waitForResponse() {
- Trace.trace(Trace.PARSING, "Waiting for response " + this);
- synchronized (this) {
- try {
- isWaiting = true;
- wait();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in waitForResponse() " + this, e);
- }
- isWaiting = false;
- }
- Trace.trace(Trace.PARSING, "Done waiting for response " + this);
- }
-
- protected void notifyRequest() {
- Trace.trace(Trace.PARSING, "Notifying request " + this);
- while (request.connectionKeepAlive && !request.isWaiting) {
- Trace.trace(Trace.PARSING, "Waiting for request " + this);
- try {
- Thread.sleep(100);
- } catch (Exception e) {
- // ignore
- }
- }
- synchronized (request) {
- try {
- request.notify();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in notifyRequest() " + this, e);
- }
- }
- Trace.trace(Trace.PARSING, "Done notifying request " + this);
- }
-
- protected void setHTTPHeader(Request rr) {
- if (isRequest) {
- byte[] b = rr.getRequest(Request.ALL);
- byte[] h = new byte[b.length];
- System.arraycopy(b, 0, h, 0, b.length);
- rr.setProperty(HTTPRequest.HTTP_REQUEST_HEADER, h);
- } else {
- byte[] b = rr.getResponse(Request.ALL);
- byte[] h = new byte[b.length];
- System.arraycopy(b, 0, h, 0, b.length);
- rr.setProperty(HTTPRequest.HTTP_RESPONSE_HEADER, h);
- }
- }
-
- protected void setHTTPBody(byte[] b) {
- Request rr = conn.getRequestResponse(isRequest);
- if (isRequest)
- rr.setProperty(HTTPRequest.HTTP_REQUEST_BODY, b);
- else
- rr.setProperty(HTTPRequest.HTTP_RESPONSE_BODY, b);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java
deleted file mode 100644
index c9e3441..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * A resend HTTP connection wraps an HTTP connection to send an existing request.
- */
-public class ResendHTTPConnection extends HTTPConnection {
- protected Request existingRequest;
-
- /**
- * Create a new resend connection.
- *
- * @param request
- */
- public ResendHTTPConnection(Request request) {
- super(null);
- this.existingRequest = request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPConnection#getRequestResponse(int)
- */
- protected Request getRequestResponse(int i) {
- return existingRequest;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java
deleted file mode 100644
index 2a48859..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.Socket;
-
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.SocketWrapper;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * Wraps an existing request to create an HTTP request that can be sent. The
- * response is ignored. Only the request is important in this case.
- */
-public class ResendHTTPRequest extends HTTPRequest {
- private boolean sent = false;
-
- private byte[] header;
-
- private byte[] content;
-
- private Request originalRequest = null;
-
- /**
- * Constructor.
- *
- * @param monitor
- * @param req the request that is to be resent.
- */
- public ResendHTTPRequest(Monitor monitor, Request req) {
- super(monitor, req.getLocalPort(), req.getRemoteHost(), req.getRemotePort());
- setProperty(HTTP_REQUEST_HEADER, req.getProperty(HTTP_REQUEST_HEADER));
- setProperty(HTTP_REQUEST_BODY, req.getProperty(HTTP_REQUEST_BODY));
- header = req.getRequest(TRANSPORT);
- content = req.getRequest(CONTENT);
- request = req.getRequest(ALL);
- name = req.getName();
- this.originalRequest = req;
- }
-
- /**
- * Send the request.
- */
- public void sendRequest() {
- try {
- Socket inSocket = new SocketWrapper(new ByteArrayInputStream(request));
- Socket outSocket = new Socket(remoteHost, remotePort);
- //Connection conn = new Connection(inSocket, outSocket);
- //TCPIPThread requestThread = new TCPIPThread(conn, this, in,
- // outSocket.getOutputStream(), true);
- //requestThread.start();
- //new TCPIPThread(conn, this, outSocket.getInputStream(),
- // inSocket.getOutputStream(), false).start();
- Connection conn2 = new Connection(inSocket, outSocket);
- ResendHTTPConnection conn = new ResendHTTPConnection(this);
-
- HTTPThread request2 = new HTTPThread(conn2, inSocket.getInputStream(),
- outSocket.getOutputStream(), conn, true, remoteHost, remotePort);
- HTTPThread response2 = new HTTPThread(conn2, outSocket.getInputStream(),
- inSocket.getOutputStream(), conn, false, "localhost", localPort, request2);
- request2.start();
- response2.start();
- } catch (IOException e) {
- response = ("Unable to resend to server.\n" + e).getBytes();
- }
- sent = true;
- }
-
- /** (non-Javadoc)
- * @see Request#addToRequest(byte[])
- */
- public void addToRequest(byte[] addRequest) {
- // Don't want to add to the request as we already have the request.
- }
-
- /**
- * Returns <code>true</code> if the request has been sent.
- *
- * @return <code>true</code> if the request has been sent, and <code>false</code>
- * otherwise
- */
- public boolean hasBeenSent() {
- return sent;
- }
-
- /**
- * Set the request.
- *
- * @param request
- * @param type
- */
- public void setRequest(byte[] request, int type) {
- if (request == null)
- request = new byte[0];
- if (type == TRANSPORT)
- header = request;
- else if (type == CONTENT)
- content = request;
-
- int length = 0;
- int headerLength = 0;
- if (header != null) {
- length += header.length;
- headerLength = length;
- }
- if (content != null)
- length += content.length;
- byte[] newRequest = new byte[length];
- if (header != null)
- System.arraycopy(header, 0, newRequest, 0, header.length);
- if (content != null)
- System.arraycopy(content, 0, newRequest, headerLength, content.length);
- super.setRequest(newRequest);
- }
-
- /** (non-Javadoc)
- * @see HTTPRequest#getRequestContent()
- */
- protected byte[] getRequestContent() {
- return content;
- }
-
- /** (non-Javadoc)
- * @see HTTPRequest#getRequestHeader()
- */
- protected byte[] getRequestHeader() {
- return header;
- }
-
- /**
- * Returns the original request.
- *
- * @return the original request
- */
- public Request getOriginalRequest() {
- return originalRequest;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/ContentFilterDelegate.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/ContentFilterDelegate.java
deleted file mode 100644
index 55cdfaf..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/ContentFilterDelegate.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-
-import java.io.IOException;
-/**
- * A content filter that filters contents from the monitor traffic on a request.
- * <p>
- * This abstract class is intended to be subclassed only by clients
- * to extend the <code>contentFilters</code> extension point.
- * The subclass must have a public 0-argument constructor, which will be used
- * automatically to instantiate the delegate when required.
- * </p>
- * <p>
- * [issue: The notion of content filters is a UI/presentation
- * concern, not something that is makes sense to have as core
- * functionality. The contentFilters extension point, IContentFilter,
- * and ContentFilterDelegate should all move to the o.e.wst.internet.monitor.ui
- * plug-in.]
- * [issue: CS - I'd echo the comment above that this seems like a UI concern.
- * I noticed there's also a viewer on the UI side, so i'm not sure how these would interact.
- * I assume that filters operate on the byte stream and aren't concerned with UI presentation...
- * but usually UI's and filters are tightly coupled.
- * </p>
- */
-public abstract class ContentFilterDelegate {
- /**
- * Filter the given content from the given request. The content that has been filtered out will
- * not be shown to clients of the TCP/IP monitor.
- *
- * @param request the request that the filter will be performed on
- * @param isRequest set to true if the content filter applies to request monitor traffic,
- * or set to false if the content filter applies to the response monitor traffic
- * @param content the message content to be filtered out
- * @return the filtered content
- * @throws IOException if there is an error while parsing or filtering the content
- */
- public abstract byte[] filter(Request request, boolean isRequest, byte[] content) throws IOException;
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitor.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitor.java
deleted file mode 100644
index 107f138..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitor.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-/**
- * Represents a monitor between a client and server.
- * The monitor watches all network traffic between a local client (talking
- * on a given local port) and a remote server (identified by host and port).
- * The global list of known monitors is available via {@link MonitorCore#getMonitors()}.
- * IMonitor is thread-safe.
- * <p>
- * IMonitors are read-only. To make changes to a monitor, you must create an
- * IMonitorWorkingCopy by calling createWorkingCopy(). Changes to the working copy
- * are applied when the working copy is saved. Monitors and monitor working copies
- * have the following properties:
- * * equals() returns true for a monitor and it's working copy
- * <p>
- * [issue: Why the built-in assumption that the client is local? A monitor
- * would make just as much sense sitting between a client on a remote machine
- * and a server.]
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IMonitorWorkingCopy
- */
-public interface IMonitor {
- /**
- * Returns the id of this monitor.
- * Each monitor has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the monitor id
- */
- public String getId();
-
- /**
- * Returns the remote host name of the server being monitored.
- *
- * @return the remote host name
- */
- public String getRemoteHost();
-
- /**
- * Returns the remote port number of the server being monitored.
- *
- * @return the remote port number
- */
- public int getRemotePort();
-
- /**
- * Returns the local port number of the client being monitored. This
- * is the port that the client is talking to the remote server on.
- *
- * @return the local port number
- */
- public int getLocalPort();
-
- /**
- * Returns the protocol that this monitor uses to read network
- * traffic.
- *
- * @return the protocol id
- */
- public String getProtocol();
-
- /**
- * Returns the connection timeout (in ms). Returns 0 if there is no timeout.
- *
- * @return the timeout
- */
- public int getTimeout();
-
- /**
- * Returns whether this monitor starts by default.
- *
- * @return <code>true</code> if the monitor should be started by default, or
- * <code>false</code> otherwise
- */
- public boolean isAutoStart();
-
- /**
- * Returns whether this monitor is currently running. Monitor working
- * copies will always return false (since they cannot be run).
- *
- * @return <code>true</code> if the monitor is currently running, or
- * <code>false</code> otherwise
- */
- public boolean isRunning();
-
- /**
- * Deletes this monitor. The monitor will no longer be available to clients.
- * If the monitor is currently running, it will be stopped first.
- * This method has no effect if the monitor has already been deleted or if
- * it is called on a working copy. Clients have no obligation to delete
- * working copies.
- */
- public void delete();
-
- /**
- * Returns whether this monitor is a working copy. Monitors which return
- * <code>true</code> to this method can be safely cast to
- * {@link IMonitorWorkingCopy}.
- *
- * @return <code>true</code> if this monitor is a working copy, and
- * <code>false</code> otherwise
- */
- public boolean isWorkingCopy();
-
- /**
- * Returns a working copy for this monitor. If the receiver is not a
- * working copy, a new working copy will be created and initialized to have
- * the same attributes as this monitor. If the receiver is a working copy,
- * this method simply returns the receiver. After configuring attributes on
- * the working copy, calling {@link IMonitorWorkingCopy#save()} applies
- * the changes to the original monitor.
- *
- * @return a working copy of this monitor
- */
- public IMonitorWorkingCopy createWorkingCopy();
-
- /**
- * Starts the given monitor listening on its client port. This method is
- * synchronous and the monitor will be running and ready for use by the
- * time that the method returns. This method has no effect if the monitor
- * is already running.
- * <p>
- * A CoreException is thrown if the monitor is not valid, the local port
- * is in use, or if another problem occurs when starting the monitor.
- * </p>
- * <p>
- * This method must not be called on a working copy or after the monitor
- * has been deleted.
- * </p>
- *
- * @throws CoreException thrown if the monitor's properties are invalid,
- * if it fails to start because the port is in use, or another problem occurs
- */
- public void start() throws CoreException;
-
- /**
- * Stops the given monitor and frees up all underlying operating
- * system resources. This method is synchronous and the monitor will be
- * running and ready for use by the time that the method returns.
- * This method has no effect if the monitor was not already running.
- * <p>
- * After returning from this method, the monitor may be restarted at
- * any time. This method must not be called on a working copy or after
- * the monitor has been deleted.
- * </p>
- */
- public void stop();
-
- /**
- * Adds a request listener.
- * Once registered, a listener starts receiving notification of
- * changes to the global list of requests. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- * <p>
- * If a listener is added to a working copy, it will automatically be added
- * to the original monitor. If the monitor does not exist yet (when the working
- * copy was just created from MonitorCore.createMonitor()), the listener will
- * be added to the created monitor when (if) the working copy is saved.
- * </p>
- *
- * @param listener the request listener
- * @see #removeRequestListener(IRequestListener)
- */
- public void addRequestListener(IRequestListener listener);
-
- /**
- * Removes the given request listener. Has no effect if the listener is
- * not registered.
- * <p>
- * If a listener is removed from a working copy, it will automatically be
- * removed from the corresponding original monitor. Removing a monitor from
- * a newly created monitor has no effect unless the monitor had already been
- * added, in which case it is removed from notification and will not be added
- * to the created monitor when (if) the working copy is saved.
- * </p>
- *
- * @param listener the listener
- * @see #addRequestListener(IRequestListener)
- */
- public void removeRequestListener(IRequestListener listener);
-
- /**
- * Validates this monitor. This method should return an error if the monitor
- * has invalid ports or remote hostname.
- * <p>
- * This method is not on the working copy so that the runtime can be validated
- * at any time.
- * </p>
- *
- * @return a status object with code <code>IStatus.OK</code> if this
- * runtime is valid, otherwise a status object indicating what is
- * wrong with it
- */
- public IStatus validate();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitorListener.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitorListener.java
deleted file mode 100644
index 75c947c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitorListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-/**
- * Listener for global changes affecting monitors.
- * <p>
- * Clients should implement this interface and register
- * their listener via {@link MonitorCore#addMonitorListener(IMonitorListener)}.
- * </p>
- */
-public interface IMonitorListener {
-
- /**
- * Notification that the given monitor has been created (added to the
- * global list of known monitors).
- *
- * @param monitor the newly-created monitor
- */
- public void monitorAdded(IMonitor monitor);
-
- /**
- * Notification that the given monitor has been changed.
- * Note that the monitor is never a working copy.
- *
- * @param monitor the monitor that has been changed
- */
- public void monitorChanged(IMonitor monitor);
-
- /**
- * Notification that the given monitor has been deleted (removed
- * from the global list of known monitors).
- *
- * @param monitor the monitor that has been deleted
- */
- public void monitorRemoved(IMonitor monitor);
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitorWorkingCopy.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitorWorkingCopy.java
deleted file mode 100644
index 1b74058..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IMonitorWorkingCopy.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-
-import org.eclipse.core.runtime.CoreException;
-/**
- * Represents a working copy of a monitor. A working copy is a copy that the
- * attributes can be changed.
- * IMonitorWorkingCopy is thread-safe. However, working copies instances
- * should be short-lived to reduce the chance of multiple working copies
- * being created by different clients and one client overwritting changes
- * made to the other working copy.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IMonitor
- *
- * [issue : CS - it sounds like this is something useful for creating monitors.
- * Shouldn't this be called a IMonitorConfiguration? Is there an advantage to making
- * this actually seem to be a IMonitor? Perhaps some UI convenience?
- * Is a IMonitorWorkingCopy actually 'useable' for monitoring .. or is it really just a configuration? ]
- */
-public interface IMonitorWorkingCopy extends IMonitor {
- /**
- * Returns the original monitor that this working copy corresponds to, or
- * <code>null</code> if this working copy was just created from
- * MonitorCore.createMonitor().
- *
- * @return the original monitor, or <code>null</code> if this working copy
- * was just created
- */
- public IMonitor getOriginal();
-
- /**
- * Sets the local port number of the client to be monitored.
- *
- * @param port the local (client) port number
- * @see IMonitor#getLocalPort()
- */
- public void setLocalPort(int port);
-
- /**
- * Sets the remote host name of the server to be monitored.
- *
- * @param host the new remote host name
- * @see IMonitor#getRemoteHost()
- */
- public void setRemoteHost(String host);
-
- /**
- * Sets the remote port number of the server to be monitored.
- *
- * @param port the new remote port number
- * @see IMonitor#getRemotePort()
- */
- public void setRemotePort(int port);
-
- /**
- * Sets the protocol to be used to read network
- * traffic between the server and the client.
- *
- * @param protocolId the protocol id
- * @see IMonitor#getProtocol()
- */
- public void setProtocol(String protocolId);
-
- /**
- * Sets the connection timeout (in ms). Use 0 to clear the timeout.
- *
- * @param timeout the connection timeout
- * @see IMonitor#getTimeout()
- */
- public void setTimeout(int timeout);
-
- /**
- * Sets whether this monitor starts by default.
- *
- * @param startByDefault run the monitor on plug-in startup
- * @see IMonitor#isAutoStart()
- */
- public void setAutoStart(boolean startByDefault);
-
- /**
- * Saves the changes made to this working copy.
- * For a brand new working copy (created by
- * {@link MonitorCore#createMonitor()}, and not yet saved), this method
- * creates a new monitor instance with attributes matching this working copy.
- * For a working copy cloned from an existing monitor instance (by
- * {@link IMonitor#createWorkingCopy()}), this method stops the existing
- * monitor (using {@link IMonitor#stop()}) if necessary,
- * and then sets the attributes of the monitor instance to match this
- * working copy (the monitor instance is returned).
- * <p>
- * Saving a working copy for a monitor that was already deleted will cause
- * the monitor to get recreated (with any changes in the working copy).
- * </p>
- * <p>
- * This method throws a CoreException if there is a problem saving the
- * monitor. No validation checks occur when saving the monitor. This can be
- * done by calling IMonitor.validate() prior to saving.
- * </p>
- *
- * @return the affected monitor
- * @throws CoreException thrown if a problem occurs while saving the monitor
- */
- public IMonitor save() throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IRequestListener.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IRequestListener.java
deleted file mode 100644
index bd0c5b6..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/IRequestListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-/**
- * Listener for new or modified requests created from a single monitor.
- * Each request represents message traffic between a monitored client
- * and server.
- * <p>
- * Requests are not persisted - they only exist in this API until the
- * connection is done. An initial requestAdded() event is fired when the
- * request is created (by the client creating a connection), and then
- * requestChanged() events occur as data is passed through the request
- * or changes are made to the request's properties.
- * </p>
- *
- * @see IMonitor#addRequestListener(IRequestListener)
- */
-public interface IRequestListener {
- /**
- * Notification that the given request was created.
- * <p>
- * Requests may be created with little to no data in them.
- * As additional information is available, the
- * <code>requestChanged</code> method is called.
- * </p>
- *
- * @param monitor the monitor from which the request was initiated
- * @param request the request that has been added
- */
- public void requestAdded(IMonitor monitor, Request request);
-
- /**
- * Notification that the given request has been changed.
- * This method is called when more data is available in the
- * request.
- * <p>
- * Individual values within the request are rarely modified.
- * This method may be called when they are initially set or
- * when more data is received from the client or server.
- * </p>
- *
- * @param monitor the monitor from which the request was initiated
- * @param request the request that has been changed
- */
- public void requestChanged(IMonitor monitor, Request request);
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/MonitorCore.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/MonitorCore.java
deleted file mode 100644
index 4414882..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/MonitorCore.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-
-import java.util.List;
-
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-/**
- * Main class for creating new monitors and locating existing ones. The methods on
- * this class are thread safe.
- * <p>
- * This class provides all functionality through static members. It is not intended
- * to be instantiated or subclassed.
- * </p>
- */
-public final class MonitorCore {
- private static MonitorManager manager;
-
- /**
- * Cannot create MonitorCore - use static methods.
- */
- private MonitorCore() {
- // can't create
- }
-
- /**
- * Returns a monitor manager instance.
- *
- * @return the monitor manager
- */
- private static MonitorManager getManager() {
- if (manager == null)
- manager = MonitorManager.getInstance();
- return manager;
- }
-
- /**
- * Returns a list of all known monitor instances. The list will not contain any
- * working copies and is persisted between workbench sessions.
- * <p>
- * A new array is returned on each call; clients may safely store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of monitor instances
- */
- public static IMonitor[] getMonitors() {
- List<IMonitor> list = getManager().getMonitors();
- IMonitor[] m = new IMonitor[list.size()];
- list.toArray(m);
- return m;
- }
-
- /**
- * Creates a new monitor working copy. After configuring parameters on
- * the working copy, calling {@link IMonitorWorkingCopy#save()} brings
- * the monitor into existence.
- * <p>
- * Note that the client is responsible for calling {@link IMonitor#delete()}
- * to delete the monitor once it is no longer needed.
- * </p>
- * <p>
- * When monitors are created, the local and remote port values default to
- * <code>80</code>, but they do not have a protocol or remote host (values
- * are <code>null</code>).
- * </p>
- *
- * @return a monitor working copy
- */
- public static IMonitorWorkingCopy createMonitor() {
- return getManager().createMonitor();
- }
-
- /**
- * Adds a monitor listener.
- * Once registered, a listener starts receiving notification of
- * changes to the monitors. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the monitor listener
- * @see #removeMonitorListener(IMonitorListener)
- */
- public static void addMonitorListener(IMonitorListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- getManager().addMonitorListener(listener);
- }
-
- /**
- * Removes the given monitor listener. Has no
- * effect if the listener is not registered.
- *
- * @param listener the listener
- * @see #addMonitorListener(IMonitorListener)
- */
- public static void removeMonitorListener(IMonitorListener listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- getManager().removeMonitorListener(listener);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/Request.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/Request.java
deleted file mode 100644
index 06ebd2e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/Request.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.provisional;
-
-import java.util.Date;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.internet.monitor.core.internal.Monitor;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-/**
- * Represents a TCP/IP request made between the client and the server.
- * Each request represents a request-response pair, where the request
- * is from client -> server, and the response is from server -> client.
- * <p>
- * Requests are created by a running monitor. They do not have a reference
- * back to the monitor because the monitor may have been deleted or modified
- * since the request was created.
- * </p>
- * <p>
- * This interface is intended to be extended only by clients
- * to extend the <code>protocolAdapters</code> extension point.
- * </p>
- */
-public class Request implements IAdaptable {
- protected Monitor monitor;
- protected Date date;
- protected long responseTime = -1;
- protected int localPort;
- protected String remoteHost;
- protected int remotePort;
- protected byte[] request;
- protected byte[] response;
-
- protected String name;
- protected String protocolId;
-
- protected Properties properties;
-
- /**
- * Request2 content type (value 1) for the transport (header) of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int TRANSPORT = 1;
-
- /**
- * Request2 content type (value 2) for the content (body) of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int CONTENT = 2;
-
- /**
- * Request2 content type (value 3) for the entire content of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int ALL = 3;
-
- /**
- * Create a new Request.
- *
- * @param monitor a monitor
- * @param protocolId the protocol id
- * @param localPort a local port number
- * @param remoteHost a remote hostname
- * @param remotePort a remote port number
- */
- public Request(Monitor monitor, String protocolId, int localPort, String remoteHost, int remotePort) {
- super();
- this.monitor = monitor;
- this.protocolId = protocolId;
- this.localPort = localPort;
- this.remoteHost = remoteHost;
- this.remotePort = remotePort;
- date = new Date();
- properties = new Properties();
- if (monitor != null)
- monitor.addRequest(this);
- }
-
- /**
- * Returns the protocol responsible for creating this request.
- *
- * @return the protocol id
- */
- public String getProtocol() {
- return protocolId;
- }
-
- /**
- * Returns the time this request was made.
- *
- * @return the timestamp
- */
- public Date getDate() {
- return date;
- }
-
- /**
- * Returns the local (client) port.
- *
- * @return the local port number
- */
- public int getLocalPort() {
- return localPort;
- }
-
- /**
- * Returns the remote (server) host.
- *
- * @return the remote host
- */
- public String getRemoteHost() {
- return remoteHost;
- }
-
- /**
- * Returns the remote (server) port.
- *
- * @return the remote port number
- */
- public int getRemotePort() {
- return remotePort;
- }
-
- /**
- * Returns the selected content of the request portion of this request.
- * <p>
- * [issue: I don't know how to explain this. For basic TCP/IP requests,
- * distinction between transport and content is ignored.
- * For HTTP requests, this TRANSPORT returns just the HTTP header and
- * CONTENT returns just the HTTP body without the headers. What would
- * it mean for other protocols?
- * </p>
- *
- * @param type the content type: one of {@link #TRANSPORT},
- * {@link #CONTENT}, or {@link #ALL}
- * @return the content bytes
- */
- public byte[] getRequest(int type) {
- return request;
- }
-
- /**
- * Returns the selected content of the response portion of this request.
- * <p>
- * [issue: I don't know how to explain this. For basic TCP/IP requests,
- * distinction between transport and content is ignored.
- * For HTTP requests, this TRANSPORT returns just the HTTP header and
- * CONTENT returns just the HTTP body without the headers. What would
- * it mean for other protocols?]
- * </p>
- *
- * @param type the content type: one of {@link #TRANSPORT},
- * {@link #CONTENT}, or {@link #ALL}
- * @return the content bytes
- */
- public byte[] getResponse(int type) {
- return response;
- }
-
- /**
- * Returns the server's response time in milliseconds. If the request
- * has not been completed yet, -1 is returned.
- *
- * @return the server's response time, or -1 if there has been no
- * response yet
- */
- public long getResponseTime() {
- return responseTime;
- }
-
- /**
- * Returns a name for this request.
- *
- * @return the name
- */
- public String getName() {
- if (name == null)
- return getRemoteHost() + ":" + getRemotePort();
-
- return name;
- }
-
- /**
- * Sets the name of this request.
- *
- * @param n the name
- */
- protected void setName(String n) {
- name = n;
- }
-
- /**
- * Sets the given key-value property on this request. To remove a property,
- * set the value to null.
- * <p>
- * This method is typically called by protocol adapters to attach protocol-
- * specific fields to the request, but it may be called by any client.
- * </p>
- *
- * @param key the key
- * @param value the value
- */
- public void setProperty(String key, Object value) {
- try {
- if (properties.containsKey(key))
- properties.remove(key);
- if (value != null)
- properties.put(key, value);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not add property", e);
- }
- monitor.requestChanged(this);
- }
-
- /**
- * Returns the value of the property with the given key from this request.
- * If the key does not exist, <code>null</code> is returned.
- *
- * @param key the property key
- * @return the property value
- */
- public Object getProperty(String key) {
- try {
- return properties.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Add to the request.
- *
- * @param addRequest byte[]
- */
- public void addToRequest(byte[] addRequest) {
- if (addRequest == null || addRequest.length == 0)
- return;
-
- if (request == null || request.length == 0) {
- setRequest(addRequest);
- return;
- }
-
- int size = request.length + addRequest.length;
- byte[] b = new byte[size];
- System.arraycopy(request, 0, b, 0, request.length);
- System.arraycopy(addRequest, 0, b, request.length, addRequest.length);
- request = b;
- fireChangedEvent();
- }
-
- /**
- * Add to the response.
- *
- * @param addResponse byte[]
- */
- public void addToResponse(byte[] addResponse) {
- if (addResponse == null || addResponse.length == 0)
- return;
-
- if (response == null || response.length == 0) {
- setResponse(addResponse);
- return;
- }
-
- int size = response.length + addResponse.length;
- byte[] b = new byte[size];
- System.arraycopy(response, 0, b, 0, response.length);
- System.arraycopy(addResponse, 0, b, response.length, addResponse.length);
- response = b;
- fireChangedEvent();
- }
-
- /**
- * Set the request.
- *
- * @param request byte[]
- */
- protected void setRequest(byte[] request) {
- if (request == null || request.length == 0)
- return;
-
- this.request = request;
- monitor.requestChanged(this);
- }
-
- /**
- * Set the response.
- *
- * @param response byte[]
- */
- protected void setResponse(byte[] response) {
- if (response == null || response.length == 0)
- return;
-
- this.response = response;
- responseTime = System.currentTimeMillis() - date.getTime();
- monitor.requestChanged(this);
- }
-
- /**
- * Returns the monitor that created this request.
- * Change events will be fired from this monitor.
- * <p>
- * Note that the monitor may have been editted since this
- * request was created, so you cannot rely on the monitor's
- * hostname or port values.
- * </p>
- *
- * @return the monitor that created this request
- */
- public IMonitor getMonitor() {
- return monitor;
- }
-
- /**
- * Fire a change event to notify monitor listeners that the request has changed.
- */
- protected void fireChangedEvent() {
- if (monitor != null)
- monitor.requestChanged(this);
- }
-
- /** (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/package.html b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/package.html
deleted file mode 100644
index 505ed58..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/package.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../../../../..//apistyles.css" type="text/css">
-<title>WTP API overview</title>
-</head>
-<body>
-<p>This package gives core (non-UI) access to the TCP/IP monitor. Clients can
-query for existing monitors, create new monitors, start/stop monitors, and
-listen for requests being received by a running monitor.</p>
-<table width="500">
-<tr>
-<td>
-<p>The MonitorCore class gives initial access to all of the API. From here you
-can query the existing monitors, create new ones, and add/remove a listener for
-monitor changes.</p>
-</td>
-</tr>
-</table>
-<table width="500">
-<tr>
-<td>
-<p>The IMonitor interface provides information about a particular monitor,
-allowing you to change it via a working copy, start/stop it, or add a listener
-for request activity.</p>
-</td>
-</tr>
-</table>
-</body>
-</html>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/package.xml b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/package.xml
deleted file mode 100644
index 3f4e04a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/provisional/package.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-
-
-<abstract>This package gives core (non-UI) access to the TCP/IP monitor. Clients can
-query for existing monitors, create new monitors, start/stop monitors, and
-listen for requests being received by a running monitor.</abstract>
-
-<p>The MonitorCore class gives initial access to all of the API. From here you
-can query the existing monitors, create new ones, and add/remove a listener for
-monitor changes.</p>
-
-<p>The IMonitor interface provides information about a particular monitor,
-allowing you to change it via a working copy, start/stop it, or add a listener
-for request activity.</p>
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties b/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties
deleted file mode 100644
index f0e5242..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2005 IBM 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
-###############################################################################
-pluginName=Monitor
-providerName=Eclipse.org
-
-extensionPointProtocolAdapters=Protocol Adapters
-extensionPointContentFilters=Content Filters
-extensionPointStartup=Startup
-
-HTTP=HTTP
-TCPIP=TCP/IP
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml b/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml
deleted file mode 100644
index 5a825fa..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
-
-<extension-point name="%extensionPointProtocolAdapters" id="internalProtocolAdapters" schema="schema/protocolAdapters.exsd"/>
-<extension-point name="%extensionPointContentFilters" id="internalContentFilters" schema="schema/internalContentFilters.exsd"/>
-<extension-point name="%extensionPointStartup" id="internalStartup" schema="schema/startup.exsd"/>
-
-<extension point="org.eclipse.wst.internet.monitor.core.internalProtocolAdapters">
- <protocolAdapter
- id="TCP/IP"
- class="org.eclipse.wst.internet.monitor.core.internal.TCPIPProtocolAdapter"
- name="%TCPIP"/>
- <protocolAdapter
- id="HTTP"
- class="org.eclipse.wst.internet.monitor.core.internal.http.HTTPProtocolAdapter"
- name="%HTTP"/>
-</extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/internalContentFilters.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/internalContentFilters.exsd
deleted file mode 100644
index 992dd36..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/internalContentFilters.exsd
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="contentFilters" name="Content Filters"/>
- </appInfo>
- <documentation>
- This extension point is used to filter content received in a monitor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="filter" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="filter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of a Java class that extends <samp>org.eclipse.wst.internet.monitor.core.internal.provisional.ContentFilterDelegate</samp>.
-Content filter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.internal.provisional.ContentFilterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the filter
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
- an integer used to order filters relative to each other. Lower orders are processed first
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content filter extension point:
-
-<pre>
- <extension
- point="org.eclipse.wst.internet.monitor.core.contentFilter">
- <filter
- id="com.example.ExampleIdentifier"
- name="%exampleName"
- class="com.example.ExampleContentFilter"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <code>org.eclipse.wst.internet.monitor.core.internal.provisional.ContentFilterDelegate</code>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/startup.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/startup.exsd
deleted file mode 100644
index 1992e48..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/startup.exsd
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="internalStartup" name="Startup"/>
- </appInfo>
- <documentation>
- This extension point is used to load a secondary plugin. The extension point will be called when the monitor core plugin starts up.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="startup" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="startup">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.internal.IStartup"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is internal and should not be used by any other plugins.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a startup extension point:
-
-<pre>
- <extension
- point="org.eclipse.wst.internet.monitor.core.internal.startups">
- <startup
- id="com.example.myplugin"
- class="com.example.myplugin.Startup"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- This extension point is internal and should not be used by any other plugins.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.classpath b/plugins/org.eclipse.wst.internet.monitor.ui/.classpath
deleted file mode 100644
index acf166f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="monitorui/"/>
- <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/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore b/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore
deleted file mode 100644
index 59f65bf..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-monitorui.jar
-build.xml
-temp.folder
-org.eclipse.wst.internet.monitor.ui_3.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.options b/plugins/org.eclipse.wst.internet.monitor.ui/.options
deleted file mode 100644
index 08412ea..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.wst.internet.monitor.ui plugin
-
-# Turn on general debugging
-org.eclipse.wst.internet.monitor.ui/debug=true
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.project b/plugins/org.eclipse.wst.internet.monitor.ui/.project
deleted file mode 100644
index b81173e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.monitor.ui</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.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index c8be432..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Nov 10 17:11:35 HST 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2920850..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,77 +0,0 @@
-#Thu Sep 13 15:25:06 EDT 2007
-eclipse.preferences.version=1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=error
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled
-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.maxProblemPerUnit=1000
-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=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=error
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-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
-org.eclipse.jdt.core.incompatibleJDKLevel=warning
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 3dffa25..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Feb 23 21:16:28 EST 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\n<templates/>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 08a60e5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,14 +0,0 @@
-#Sat Apr 22 18:36:14 EDT 2006
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.internet.monitor.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 9b4cc49..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.internet.monitor.ui; singleton:=true
-Bundle-Version: 1.0.305.qualifier
-Bundle-Activator: org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.internet.monitor.ui.internal;x-internal:=true,
- org.eclipse.wst.internet.monitor.ui.internal.provisional;x-internal:=true,
- org.eclipse.wst.internet.monitor.ui.internal.view;x-internal:=true,
- org.eclipse.wst.internet.monitor.ui.internal.viewers;x-internal:=true
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.internet.monitor.core;bundle-version="[1.0.103,1.1.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/about.html b/plugins/org.eclipse.wst.internet.monitor.ui/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/about.html
+++ /dev/null
@@ -1,34 +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">
-
-<H3>About This Content</H3>
-
-<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/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from 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
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/build.properties b/plugins/org.eclipse.wst.internet.monitor.ui/build.properties
deleted file mode 100644
index 1fddcd7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2005 IBM 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
-###############################################################################
-bin.includes = plugin.xml,\
- .,\
- plugin.properties,\
- icons/,\
- META-INF/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = schema/
-source.. = monitorui/
-output.. = bin/
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif
deleted file mode 100644
index 389954f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif
deleted file mode 100644
index fb20c38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/pin.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/pin.gif
deleted file mode 100644
index ec50b70..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/pin.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif
deleted file mode 100644
index e334e9f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif
deleted file mode 100644
index c374f13..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif
deleted file mode 100644
index 3bf98c0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif
deleted file mode 100644
index 6d71a8b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/pin.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/pin.gif
deleted file mode 100644
index 61615d5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/pin.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif
deleted file mode 100644
index 06e0c73..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif
deleted file mode 100644
index 389954f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif
deleted file mode 100644
index fb20c38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/pin.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/pin.gif
deleted file mode 100644
index ec50b70..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/pin.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif
deleted file mode 100644
index cf62b63..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif
deleted file mode 100644
index e334e9f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif
deleted file mode 100644
index d044e59..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif
deleted file mode 100644
index c374f13..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif
deleted file mode 100644
index b51ae39..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif
deleted file mode 100644
index 42e5f31..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif
deleted file mode 100644
index 2ff3974..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif
deleted file mode 100644
index 8a6e219..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java
deleted file mode 100644
index df1d1c7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-/**
- * Constant ids for context help.
- */
-public interface ContextIds {
- public static final String VIEW = MonitorUIPlugin.PLUGIN_ID + ".tmvw0000";
- public static final String VIEW_TREE = MonitorUIPlugin.PLUGIN_ID + ".tmvw0002";
- public static final String VIEW_REQUEST = MonitorUIPlugin.PLUGIN_ID + ".tmvw0004";
- public static final String VIEW_RESPONSE = MonitorUIPlugin.PLUGIN_ID + ".tmvw0006";
-
- public static final String PREF = MonitorUIPlugin.PLUGIN_ID + ".tmpr0000";
- public static final String PREF_SHOW = MonitorUIPlugin.PLUGIN_ID + ".tmpr0002";
- public static final String PREF_MONITORS = MonitorUIPlugin.PLUGIN_ID + ".tmpr0004";
- public static final String PREF_DIALOG = MonitorUIPlugin.PLUGIN_ID + ".tmpr0006";
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Messages.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Messages.java
deleted file mode 100644
index 29bd204..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Messages.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2007, 2008 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
- * Translated messages.
- */
-public class Messages extends NLS {
- public static String editMonitor;
- public static String newMonitor;
- public static String localPort;
- public static String remoteHost;
- public static String remotePort;
- public static String remoteGroup;
- public static String connectionTimeout;
- public static String autoStart;
- public static String parseType;
- public static String errorDialogTitle;
- public static String preferenceDescription;
- public static String prefShowView;
- public static String monitorList;
- public static String columnStatus;
- public static String columnRemote;
- public static String columnType;
- public static String columnLocal;
- public static String columnAutoStart;
- public static String add;
- public static String edit;
- public static String remove;
- public static String start;
- public static String stop;
- public static String started;
- public static String stopped;
- public static String headerLabel;
- public static String imageViewInvalid;
- public static String xmlViewInvalid;
- public static String htmlViewInvalid;
- public static String viewDateFormat;
- public static String viewTime;
- public static String viewResponseTime;
- public static String viewType;
- public static String viewResponseTimeFormat;
- public static String viewSize;
- public static String viewResponse;
- public static String viewRequest;
- public static String actionSortByResponseTime;
- public static String viewSizeFormat;
- public static String actionClearToolTip;
- public static String actionShowHeader;
- public static String actionPin;
- public static String actionProperties;
- public static String yes;
- public static String no;
-
- static {
- NLS.initializeMessages(MonitorUIPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Messages.properties b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Messages.properties
deleted file mode 100644
index 601417d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Messages.properties
+++ /dev/null
@@ -1,78 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2008 IBM 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
-# Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
-###############################################################################
-
-# --------------- TCP/IP Monitor view ---------------
-
-# Labels
-viewRequest=Request: {0}
-viewResponse=Response: {0}
-viewTime=Time of request: {0}
-viewType=Type: {0}
-viewResponseTime=Response Time: {0}
-viewSize=Size: {0}
-viewResponseTimeFormat={0} ms
-viewSizeFormat={0} ({1}) bytes
-
-# The following string allows you to change the time format of the TCP/IP monitor
-# view. It uses the formatting options found in java.text.SimpleDateFormat:
-# k - hour in day, h - hour in am/pm, m - minute, s - second, S - millisecond,
-# a - am/pm marker. use duplicate chars (e.g. 'mm') to fill with zeros (i.e.
-# '01' instead of '1')
-viewDateFormat=h:mm.s.S a
-
-# Actions
-actionSortByResponseTime=Sort By Response Time
-actionClearToolTip=Clear
-actionShowHeader=Show Header
-actionPin=Pin Selection
-actionProperties=Properties
-
-
-# --------------- RequestResponse Viewers ---------------
-headerLabel=Header: {0}
-imageViewInvalid=<Not a valid image file>
-xmlViewInvalid=<Not a valid XML file>
-htmlViewInvalid=<Not a valid HTML file>
-
-# --------------- Errors ---------------
-errorDialogTitle=Error
-
-# --------------- General UI ---------------
-monitorList=TCP/IP &Monitors:
-columnLocal=Local Port
-columnRemote=Host name
-columnType=Type
-columnStatus=Status
-columnAutoStart=Auto-start
-add=&Add...
-edit=&Edit...
-remove=&Remove
-start=&Start
-stop=S&top
-started=Started
-stopped=Stopped
-yes=Yes
-no=No
-
-newMonitor=New Monitor
-editMonitor=Edit Monitor
-
-localPort=&Local monitoring port:
-remoteGroup=Monitor
-remoteHost=&Host name:
-remotePort=&Port:
-parseType=&Type:
-autoStart=&Start monitor automatically
-connectionTimeout=T&imeout (in milliseconds):
-
-preferenceDescription=Configure TCP/IP monitors on local and remote ports.
-prefShowView=S&how the TCP/IP Monitor view when there is activity
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java
deleted file mode 100644
index e87b3cb..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.MonitorCore;
-/**
- * Monitor content provider.
- */
-public class MonitorContentProvider implements IStructuredContentProvider {
- /**
- * MonitorContentProvider constructor comment.
- */
- public MonitorContentProvider() {
- super();
- }
-
- /*
- * Disposes of this content provider.
- */
- public void dispose() {
- // do nothing
- }
-
- /*
- * Returns the elements to display in the viewer
- * when its input is set to the given element.
- */
- public Object[] getElements(Object inputElement) {
- return MonitorCore.getMonitors();
- }
-
- /*
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java
deleted file mode 100644
index b4ba878..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-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.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.core.internal.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.MonitorCore;
-/**
- *
- */
-public class MonitorDialog extends Dialog {
- protected IMonitorWorkingCopy monitor;
- protected boolean isEdit;
-
- private Button okButton;
- private Spinner monitorPort;
- private Label validateLabel;
-
- interface StringModifyListener {
- public void valueChanged(String s);
- }
-
- interface BooleanModifyListener {
- public void valueChanged(boolean b);
- }
-
- interface TypeModifyListener {
- public void valueChanged(IProtocolAdapter type);
- }
-
- interface IntModifyListener {
- public void valueChanged(int i);
- }
-
- /**
- * Create a new monitor dialog.
- *
- * @param parentShell
- * @param monitor
- */
- public MonitorDialog(Shell parentShell, IMonitorWorkingCopy monitor) {
- super(parentShell);
- this.monitor = monitor;
- isEdit = true;
- }
-
- public MonitorDialog(Shell parentShell) {
- super(parentShell);
- monitor = MonitorCore.createMonitor();
- isEdit = false;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (isEdit)
- shell.setText(Messages.editMonitor);
- else
- shell.setText(Messages.newMonitor);
- }
-
- protected Button createCheckBox(Composite comp, String txt, boolean selected, final BooleanModifyListener listener) {
- final Button button = new Button(comp, SWT.CHECK);
- button.setText(txt);
- button.setSelection(selected);
- button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER));
- if (listener != null)
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent arg0) {
- listener.valueChanged(button.getSelection());
- }
- });
- return button;
- }
-
- protected Label createLabel(Composite comp, String txt) {
- Label label = new Label(comp, SWT.NONE);
- label.setText(txt);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER));
- return label;
- }
-
- protected Text createText(Composite comp, String txt, final StringModifyListener listener) {
- final Text text = new Text(comp, SWT.BORDER);
- if (txt != null)
- text.setText(txt);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = 150;
- text.setLayoutData(data);
- if (listener != null)
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- listener.valueChanged(text.getText());
- }
- });
- return text;
- }
-
- protected Spinner createSpinner(Composite comp, int v, final IntModifyListener listener) {
- final Spinner s = new Spinner(comp, SWT.BORDER);
- s.setMinimum(0);
- s.setMaximum(Integer.MAX_VALUE);
- if (v != -1)
- s.setSelection(v);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = 150;
- s.setLayoutData(data);
- if (listener != null)
- s.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- listener.valueChanged(s.getSelection());
- }
- });
- return s;
- }
-
- protected Combo createTypeCombo(Composite comp, final String[] types, String sel, final StringModifyListener listener) {
- final Combo combo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
- int size = types.length;
- String[] items = new String[size];
- int index = -1;
- for (int i = 0; i < size; i++) {
- items[i] = types[i];
- if (types[i].equals(sel))
- index = i;
- }
- combo.setItems(items);
- if (index >= 0)
- combo.select(index);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = 150;
- combo.setLayoutData(data);
- if (listener != null)
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- listener.valueChanged(types[combo.getSelectionIndex()]);
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- return combo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- ((GridLayout)composite.getLayout()).numColumns = 2;
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.PREF_DIALOG);
-
- createLabel(composite, Messages.localPort);
- monitorPort = createSpinner(composite, monitor.getLocalPort(), new IntModifyListener() {
- public void valueChanged(int i) {
- try {
- monitor.setLocalPort(i);
- } catch (Exception e) {
- // ignore
- }
- validateFields();
- }
- });
-
- Group group = new Group(composite, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- group.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- group.setLayoutData(data);
- group.setText(Messages.remoteGroup);
-
- createLabel(group, Messages.remoteHost);
- createText(group, monitor.getRemoteHost(), new StringModifyListener() {
- public void valueChanged(String s) {
- monitor.setRemoteHost(s);
- validateFields();
- }
- });
-
- createLabel(group, Messages.remotePort);
- createSpinner(group, monitor.getRemotePort(), new IntModifyListener() {
- public void valueChanged(int i) {
- try {
- monitor.setRemotePort(i);
- } catch (Exception e) {
- // ignore
- }
- validateFields();
- }
- });
-
- createLabel(group, Messages.parseType);
- createTypeCombo(group, new String[] {"TCP/IP","HTTP"}, monitor.getProtocol(), new StringModifyListener() {
- public void valueChanged(String protocolId) {
- monitor.setProtocol(protocolId);
- }
- });
-
- createLabel(group, Messages.connectionTimeout);
- createSpinner(group, monitor.getTimeout(), new IntModifyListener() {
- public void valueChanged(int i) {
- monitor.setTimeout(i);
- validateFields();
- }
- });
-
- createLabel(group, "");
- createCheckBox(group, Messages.autoStart, monitor.isAutoStart(), new BooleanModifyListener() {
- public void valueChanged(boolean b) {
- monitor.setAutoStart(b);
- }
- });
-
- validateLabel = createLabel(composite, "");
- validateLabel.setForeground(composite.getDisplay().getSystemColor(SWT.COLOR_RED));
-
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- IMonitor savedMonitor = null;
- try {
- savedMonitor = monitor.save();
- } catch (CoreException ce) {
- ErrorDialog.openError(getShell(), Messages.errorDialogTitle, ce.getLocalizedMessage(), ce.getStatus());
- return;
- }
- if (savedMonitor != null && savedMonitor.isAutoStart())
- try {
- savedMonitor.start();
- } catch (CoreException ce) {
- ErrorDialog.openError(getShell(), Messages.errorDialogTitle, ce.getLocalizedMessage(), ce.getStatus());
- }
- super.okPressed();
- }
-
- protected Control createButtonBar(Composite parent) {
- Control buttonControl = super.createButtonBar(parent);
- validateFields();
- return buttonControl;
- }
-
- private void setOKButtonEnabled(boolean curIsEnabled) {
- if (okButton == null)
- okButton = getButton(IDialogConstants.OK_ID);
-
- if (okButton != null)
- okButton.setEnabled(curIsEnabled);
- }
-
- protected void validateFields() {
- if (monitorPort == null)
- return;
-
- boolean result = true;
- IStatus status = monitor.validate();
- if (!status.isOK()) {
- if (monitor.getRemoteHost() == null || monitor.getRemoteHost().length() < 1)
- validateLabel.setText("");
- else
- validateLabel.setText(status.getMessage());
- result = false;
- } else
- validateLabel.setText("");
-
- setOKButtonEnabled(result);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java
deleted file mode 100644
index c027481..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.*;
-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.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.MonitorCore;
-/**
- * The preference page that holds monitor properties.
- */
-public class MonitorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- protected Button displayButton;
-
- protected Table table;
- protected TableViewer tableViewer;
-
- protected Button edit;
- protected Button remove;
- protected Button start;
- protected Button stop;
-
- protected List<Object> selection2;
-
- /**
- * MonitorPreferencePage constructor comment.
- */
- public MonitorPreferencePage() {
- super();
- noDefaultAndApplyButton();
- }
-
- /**
- * Create the preference options.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @return org.eclipse.swt.widgets.Control
- */
- protected Control createContents(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
- layout.verticalSpacing = convertVerticalDLUsToPixels(3);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- composite.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ContextIds.PREF);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(Messages.preferenceDescription);
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- displayButton = new Button(composite, SWT.CHECK);
- displayButton.setText(Messages.prefShowView);
- displayButton.setSelection(MonitorUIPlugin.getShowOnActivityPreference());
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- data.verticalIndent = 8;
- displayButton.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(displayButton, ContextIds.PREF_SHOW);
-
- label = new Label(composite, SWT.WRAP);
- label.setText(Messages.monitorList);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- data.verticalIndent = 8;
- label.setLayoutData(data);
-
- table = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 350;
- table.setLayoutData(data);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(table, ContextIds.PREF_MONITORS);
-
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn statusColumn = new TableColumn(table, SWT.NONE);
- statusColumn.setText(Messages.columnStatus);
- ColumnWeightData colData = new ColumnWeightData(6, 60, true);
- tableLayout.addColumnData(colData);
-
- TableColumn remoteColumn = new TableColumn(table, SWT.NONE);
- remoteColumn.setText(Messages.columnRemote);
- colData = new ColumnWeightData(12, 120, true);
- tableLayout.addColumnData(colData);
-
- TableColumn httpColumn = new TableColumn(table, SWT.NONE);
- httpColumn.setText(Messages.columnType);
- colData = new ColumnWeightData(5, 50, true);
- tableLayout.addColumnData(colData);
-
- TableColumn localColumn = new TableColumn(table, SWT.NONE);
- localColumn.setText(Messages.columnLocal);
- colData = new ColumnWeightData(6, 60, true);
- tableLayout.addColumnData(colData);
-
- TableColumn startOnStartupColumn = new TableColumn(table, SWT.NONE);
- startOnStartupColumn.setText(Messages.columnAutoStart);
- colData = new ColumnWeightData(7, 70, true);
- tableLayout.addColumnData(colData);
-
- table.setLayout(tableLayout);
-
- tableViewer = new TableViewer(table);
- tableViewer.setContentProvider(new MonitorContentProvider());
- tableViewer.setLabelProvider(new MonitorTableLabelProvider());
- tableViewer.setInput("root");
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setSelection(event.getSelection());
- }
- });
-
- Composite buttonComp = new Composite(composite, SWT.NONE);
- layout = new GridLayout();
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = convertVerticalDLUsToPixels(3);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- buttonComp.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL);
- buttonComp.setLayoutData(data);
-
- Button add = SWTUtil.createButton(buttonComp, Messages.add);
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MonitorDialog dialog = new MonitorDialog(getShell());
- if (dialog.open() == Window.CANCEL)
- return;
- tableViewer.refresh();
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- Object monitor = monitors[monitors.length - 1];
- tableViewer.setSelection(new StructuredSelection(monitor));
- }
- });
-
- edit = SWTUtil.createButton(buttonComp, Messages.edit);
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IMonitor monitor = (IMonitor) getSelection().get(0);
- IMonitorWorkingCopy wc = monitor.createWorkingCopy();
-
- MonitorDialog dialog = new MonitorDialog(getShell(), wc);
- if (dialog.open() != Window.CANCEL) {
- try {
- tableViewer.refresh(wc.save());
- } catch (Exception ex) {
- // ignore
- }
- }
- }
- });
- edit.setEnabled(false);
-
- remove = SWTUtil.createButton(buttonComp, Messages.remove);
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.delete();
- } catch (Exception ex) {
- // ignore
- }
- tableViewer.remove(monitor);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- if (monitors.length > 0) {
- Object monitor2 = monitors[monitors.length - 1];
- tableViewer.setSelection(new StructuredSelection(monitor2));
- }
- }
- }
- });
- remove.setEnabled(false);
-
- start = SWTUtil.createButton(buttonComp, Messages.start);
- data = (GridData) start.getLayoutData();
- data.verticalIndent = 9;
- start.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.start();
- } catch (CoreException ce) {
- MessageDialog.openError(getShell(), Messages.errorDialogTitle, ce.getStatus().getMessage());
- } catch (Exception ce) {
- MessageDialog.openError(getShell(), Messages.errorDialogTitle, ce.getMessage());
- }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- start.setEnabled(false);
-
- stop = SWTUtil.createButton(buttonComp, Messages.stop);
- stop.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.stop();
- } catch (Exception ex) {
- // ignore
- }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- stop.setEnabled(false);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- /**
- * Initializes this preference page using the passed workbench.
- *
- * @param workbench the current workbench
- */
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- /**
- * Performs special processing when this page's Defaults button has been pressed.
- * <p>
- * This is a framework hook method for subclasses to do special things when
- * the Defaults button has been pressed.
- * Subclasses may override, but should call <code>super.performDefaults</code>.
- * </p>
- */
- protected void performDefaults() {
- displayButton.setSelection(MonitorUIPlugin.getDefaultShowOnActivityPreference());
- super.performDefaults();
- }
-
- /**
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- MonitorUIPlugin.setShowOnActivityPreference(displayButton.getSelection());
- MonitorUIPlugin.getInstance().savePluginPreferences();
- return true;
- }
-
- protected List getSelection() {
- return selection2;
- }
-
- protected void setSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- Iterator iterator = sel.iterator();
- selection2 = new ArrayList<Object>();
-
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof IMonitor)
- selection2.add(obj);
- }
-
- if (!selection2.isEmpty()) {
- remove.setEnabled(true);
-
- boolean allStopped = true;
- boolean allStarted = true;
-
- iterator = selection2.iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- if (monitor.isRunning())
- allStopped = false;
- else
- allStarted = false;
- }
- start.setEnabled(allStopped);
- stop.setEnabled(allStarted);
- edit.setEnabled(selection2.size() == 1 && allStopped);
- } else {
- edit.setEnabled(false);
- remove.setEnabled(false);
- start.setEnabled(false);
- stop.setEnabled(false);
- }
- }
-
- /**
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ContextIds.PREF);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java
deleted file mode 100644
index b875325..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- * Tianchao Li (Tianchao.Li@gmail.com) - Start monitors by default
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IMonitor;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-/**
- * Monitor table label provider.
- */
-public class MonitorTableLabelProvider implements ITableLabelProvider {
- /**
- * MonitorTableLabelProvider constructor comment.
- */
- public MonitorTableLabelProvider() {
- super();
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * @see ITableLabelProvider#getColumnImage(Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- IMonitor monitor = (IMonitor) element;
- if (monitor.isRunning())
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_MONITOR_ON);
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_MONITOR_OFF);
- }
- return null;
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- IMonitor monitor = (IMonitor) element;
- if (columnIndex == 0) {
- if (monitor.isRunning())
- return Messages.started;
- return Messages.stopped;
- } else if (columnIndex == 1)
- return monitor.getRemoteHost() + ":" + monitor.getRemotePort();
- else if (columnIndex == 2)
- return monitor.getProtocol();
- else if (columnIndex == 3)
- return monitor.getLocalPort() + "";
- else if (columnIndex == 4) {
- if (monitor.isAutoStart())
- return Messages.yes;
- return Messages.no;
- } else
- return "X";
- }
-
- protected String notNull(String s) {
- if (s == null)
- return "";
-
- return s;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java
deleted file mode 100644
index ed3cf28..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.*;
-import java.util.zip.GZIPInputStream;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.*;
-import org.eclipse.wst.internet.monitor.ui.internal.view.MonitorView;
-import org.osgi.framework.BundleContext;
-/**
- * The TCP/IP monitor UI plugin.
- */
-public class MonitorUIPlugin extends AbstractUIPlugin {
- public static final String PLUGIN_ID = "org.eclipse.wst.internet.monitor.ui";
-
- private static final byte[] BUFFER = new byte[4096];
-
- private static MonitorUIPlugin singleton;
-
- protected Map<String, ImageDescriptor> imageDescriptors = new HashMap<String, ImageDescriptor>();
-
- private static final String lineSeparator = System.getProperty("line.separator");
-
- private static URL ICON_BASE_URL;
- private static final String URL_CLCL = "clcl16/";
- private static final String URL_ELCL = "elcl16/";
- private static final String URL_DLCL = "dlcl16/";
- private static final String URL_OBJ = "obj16/";
-
- public static final String IMG_ELCL_SORT_RESPONSE_TIME = "IMG_ELCL_SORT_RESPONSE_TIME";
- public static final String IMG_ELCL_CLEAR = "IMG_ELCL_CLEAR";
- public static final String IMG_ELCL_HTTP_HEADER = "IMG_ELCL_HTTP_HEADER";
- public static final String IMG_ELCL_PIN = "IMG_ELCL_PIN";
- public static final String IMG_CLCL_SORT_RESPONSE_TIME = "IMG_CLCL_SORT_RESPONSE_TIME";
- public static final String IMG_CLCL_CLEAR = "IMG_CLCL_CLEAR";
- public static final String IMG_CLCL_HTTP_HEADER = "IMG_CLCL_HTTP_HEADER";
- public static final String IMG_CLCL_PIN = "IMG_CLCL_PIN";
- public static final String IMG_DLCL_SORT_RESPONSE_TIME = "IMG_DLCL_SORT_RESPONSE_TIME";
- public static final String IMG_DLCL_CLEAR = "IMG_DLCL_CLEAR";
- public static final String IMG_DLCL_HTTP_HEADER = "IMG_DLCL_HTTP_HEADER";
- public static final String IMG_DLCL_PIN = "IMG_DLCL_PIN";
-
- public static final String IMG_REQUEST_RESPONSE = "requestResponse";
- public static final String IMG_RESEND_REQUEST_RESPONSE = "resendRequestResponse";
-
- public static final String IMG_HOST = "host";
- public static final String IMG_MONITOR_ON = "monitorOn";
- public static final String IMG_MONITOR_OFF = "monitorOff";
-
- private static final String SHOW_VIEW_ON_ACTIVITY = "show-view";
- private static final String PIN_VIEW = "pin-view";
- private static final String SHOW_HEADER = "show-header";
-
- protected List<Request> requests = new ArrayList<Request>();
-
- protected IMonitorListener monitorListener = new IMonitorListener() {
- public void monitorAdded(IMonitor monitor) {
- monitor.addRequestListener(requestListener);
- }
-
- public void monitorChanged(IMonitor monitor) {
- // ignore
- }
-
- public void monitorRemoved(IMonitor monitor) {
- monitor.removeRequestListener(requestListener);
- }
- };
-
- protected IRequestListener requestListener = new IRequestListener() {
- public void requestAdded(IMonitor monitor, Request request) {
- addRequest(request);
-
- if (MonitorView.view != null)
- MonitorView.view.doRequestAdded(request);
- else if (MonitorUIPlugin.getShowOnActivityPreference())
- MonitorView.open(request);
- }
-
- public void requestChanged(IMonitor monitor, Request request) {
- if (MonitorView.view != null)
- MonitorView.view.doRequestChanged(request);
- }
- };
-
- /**
- * MonitorUIPlugin constructor comment.
- */
- public MonitorUIPlugin() {
- super();
- singleton = this;
- }
-
- /**
- * Creates and pre-loads the image registry.
- *
- * @return ImageRegistry
- */
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = super.createImageRegistry();
-
- registerImage(registry, IMG_REQUEST_RESPONSE, URL_OBJ + "tcp.gif");
- registerImage(registry, IMG_RESEND_REQUEST_RESPONSE, URL_ELCL + "resendRequest.gif");
-
- registerImage(registry, IMG_HOST, URL_OBJ + "host.gif");
- registerImage(registry, IMG_MONITOR_ON, URL_OBJ + "monitorOn.gif");
- registerImage(registry, IMG_MONITOR_OFF, URL_OBJ + "monitorOff.gif");
-
- registerImage(registry, IMG_CLCL_CLEAR, URL_CLCL + "clear.gif");
- registerImage(registry, IMG_CLCL_SORT_RESPONSE_TIME, URL_CLCL + "sortResponseTime.gif");
- registerImage(registry, IMG_CLCL_HTTP_HEADER, URL_CLCL + "httpHeader.gif");
- registerImage(registry, IMG_CLCL_PIN, URL_CLCL + "pin.gif");
-
- registerImage(registry, IMG_ELCL_CLEAR, URL_ELCL + "clear.gif");
- registerImage(registry, IMG_ELCL_SORT_RESPONSE_TIME, URL_ELCL + "sortResponseTime.gif");
- registerImage(registry, IMG_ELCL_HTTP_HEADER, URL_ELCL + "httpHeader.gif");
- registerImage(registry, IMG_ELCL_PIN, URL_ELCL + "pin.gif");
-
- registerImage(registry, IMG_DLCL_CLEAR, URL_DLCL + "clear.gif");
- registerImage(registry, IMG_DLCL_SORT_RESPONSE_TIME, URL_DLCL + "sortResponseTime.gif");
- registerImage(registry, IMG_DLCL_HTTP_HEADER, URL_DLCL + "httpHeader.gif");
- registerImage(registry, IMG_DLCL_PIN, URL_DLCL + "pin.gif");
-
- return registry;
- }
-
- /**
- * Return the image with the given key from the image registry.
- *
- * @param key the key
- * @return the image
- */
- public static Image getImage(String key) {
- return getInstance().getImageRegistry().get(key);
- }
-
- /**
- * Return the image with the given key from the image registry.
- *
- * @param key the key
- * @return an image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- try {
- getInstance().getImageRegistry();
- return getInstance().imageDescriptors.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return the plugin
- */
- public static MonitorUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Register an image with the registry.
- *
- * @param key the key
- * @param partialURL
- */
- private void registerImage(ImageRegistry registry, String key, String partialURL) {
- if (ICON_BASE_URL == null) {
- String pathSuffix = "icons/";
- ICON_BASE_URL = singleton.getBundle().getEntry(pathSuffix);
- }
-
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- registry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error registering image", e);
- }
- }
-
- /**
- * @see AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- getPreferenceStore().setDefault(MonitorUIPlugin.SHOW_VIEW_ON_ACTIVITY, true);
- getPreferenceStore().setDefault(MonitorUIPlugin.PIN_VIEW, false);
-
- MonitorCore.addMonitorListener(monitorListener);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- if (monitors != null) {
- for (IMonitor monitor : monitors)
- monitor.addRequestListener(requestListener);
- }
- }
-
- /**
- * @see AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- if (monitors != null) {
- for (IMonitor monitor : monitors)
- monitor.removeRequestListener(requestListener);
- }
-
- MonitorCore.removeMonitorListener(monitorListener);
- }
-
- public static boolean getDefaultShowOnActivityPreference() {
- return getInstance().getPreferenceStore().getDefaultBoolean(SHOW_VIEW_ON_ACTIVITY);
- }
-
- public static boolean getShowOnActivityPreference() {
- return getInstance().getPreferenceStore().getBoolean(SHOW_VIEW_ON_ACTIVITY);
- }
-
- public static void setShowOnActivityPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(SHOW_VIEW_ON_ACTIVITY, b);
- getInstance().savePluginPreferences();
- }
-
- public static boolean getPinViewPreference() {
- return getInstance().getPreferenceStore().getBoolean(PIN_VIEW);
- }
-
- public static void setPinViewPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(PIN_VIEW, b);
- getInstance().savePluginPreferences();
- }
-
- public static boolean getShowHeaderPreference() {
- return getInstance().getPreferenceStore().getBoolean(SHOW_HEADER);
- }
-
- public static void setShowHeaderPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(SHOW_HEADER, b);
- getInstance().savePluginPreferences();
- }
-
- /**
- * Convenience method to unzip the given bytes using gzip. The returned byte
- * array is either the unzipped results, or the original byte array if unzipping
- * was not successful. The byte array must not be null.
- *
- * @param b a byte array
- * @return the unzipped array, or the original array if unsuccessful
- */
- public static synchronized byte[] unzip(byte[] b) {
- if (b == null)
- throw new IllegalArgumentException();
-
- try {
- GZIPInputStream gin = new GZIPInputStream(new ByteArrayInputStream(b));
- byte[] t = new byte[0];
- while (gin.available() > 0) {
- int n = gin.read(BUFFER);
- if (n > 0) {
- byte[] temp = new byte[t.length + n];
- System.arraycopy(t, 0, temp, 0, t.length);
- System.arraycopy(BUFFER, 0, temp, t.length, n);
- t = temp;
- }
- }
- return t;
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Could not unzip byte array");
- return b;
- }
- }
-
- /**
- * Convenience method to parse the given bytes into String form. The bytes
- * are parsed into a line delimited string. The byte array must not be null.
- *
- * @param b a byte array
- * @return the string after the conversion
- */
- public static String parse(byte[] b) {
- if (b == null)
- throw new IllegalArgumentException();
-
- ByteArrayInputStream bin = new ByteArrayInputStream(b);
- BufferedReader br = new BufferedReader(new InputStreamReader(bin));
- StringBuffer sb = new StringBuffer();
- try {
- String s = br.readLine();
-
- while (s != null) {
- sb.append(s);
- s = br.readLine();
- if (s != null)
- sb.append(lineSeparator);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error parsing input", e);
- }
-
- return sb.toString();
- }
-
- public void addRequest(Request request) {
- if (!requests.contains(request))
- requests.add(request);
- }
-
- /**
- * Returns a list of the current requests.
- *
- * @return an array of requests
- */
- public Request[] getRequests() {
- Request[] r = new Request[requests.size()];
- requests.toArray(r);
- return r;
- }
-
- public void clearRequests() {
- requests = new ArrayList<Request>();
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java
deleted file mode 100644
index d2a927a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * An action filter for requests.
- */
-public class RequestActionFilter implements IActionFilter{
- public static final String REQUEST_SENT = "requestsent";
-
- /**
- * @see IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value) {
- Request request = (Request) target;
- if (name.equals(REQUEST_SENT)) {
- if (value.equals("true"))
- return request.getResponseTime() != -1;
-
- return request.getResponseTime() == -1;
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestAdapterFactory.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestAdapterFactory.java
deleted file mode 100644
index ac7d685..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestAdapterFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.IActionFilter;
-/**
- * Adapter factory to adapt Requests to IActionFilter.
- */
-public class RequestAdapterFactory implements IAdapterFactory {
- private RequestActionFilter reqActionFilter = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType == IActionFilter.class) {
- if (reqActionFilter == null) {
- reqActionFilter = new RequestActionFilter();
- }
- return reqActionFilter;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] { IActionFilter.class };
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java
deleted file mode 100644
index ac622b3..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-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;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- /**
- * Create a new button with the standard size.
- *
- * @param comp the component to add the button to
- * @param label the button label
- * @return a button
- */
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = getButtonWidthHint(b);
- b.setLayoutData(data);
- return b;
- }
-
- public static Button createCheckbox(Composite comp, String txt, boolean isSelected){
- Button button = new Button(comp, SWT.CHECK);
- button.setText(txt);
- GridLayout layout = new GridLayout();
- comp.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalIndent = 10;
- button.setLayoutData(data);
- button.setSelection(isSelected);
- return button;
- }
-
- public static Label createLabel(Composite comp, String txt) {
- Label label = new Label(comp, SWT.NONE);
- label.setText(txt);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- return label;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Startup.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Startup.java
deleted file mode 100644
index 3df7e03..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Startup.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.wst.internet.monitor.core.internal.IStartup;
-/**
- * Startup hook.
- */
-public class Startup implements IStartup {
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IStartup#startup()
- */
- public void startup() {
- // do nothing - plugin loading is enough
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
deleted file mode 100644
index 587ac3b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin;
-
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static final byte CONFIG = 0;
- public static final byte WARNING = 1;
- public static final byte SEVERE = 2;
- public static final byte FINEST = 3;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param level the trace level
- * @param s a message
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param level the trace level
- * @param s a message
- * @param t a throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (level == SEVERE)
- MonitorPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, MonitorPlugin.PLUGIN_ID, s, t));
-
- if (!MonitorUIPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(MonitorUIPlugin.PLUGIN_ID + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/MonitorStackLayout.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/MonitorStackLayout.java
deleted file mode 100644
index ff3b111..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/MonitorStackLayout.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.custom;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-/**
- * This Layout stacks all the controls one on top of the other and resizes all controls
- * to have the same size and location.
- * The control specified in topControl is visible and all other controls are not visible.
- * Users must set the topControl value to flip between the visible items and then call
- * layout() on the composite which has the MonitorStackLayout.
- */
-public class MonitorStackLayout extends Layout {
- /**
- * topControl the Control that is displayed at the top of the stack.
- * All other controls that are children of the parent composite will not be visible.
- */
- public Control topControl;
-
- protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
- Control children[] = composite.getChildren();
- int maxWidth = 0;
- int maxHeight = 0;
- for (Control child : children) {
- if (child == topControl) {
- Point size = child.computeSize(wHint, hHint, flushCache);
- maxWidth = Math.max(size.x, maxWidth);
- maxHeight = Math.max(size.y, maxHeight);
- }
- }
- int width = maxWidth;
- int height = maxHeight;
- if (wHint != SWT.DEFAULT)
- width = wHint;
- if (hHint != SWT.DEFAULT)
- height = hHint;
- return new Point(width, height);
- }
-
- protected boolean flushCache(Control control) {
- return true;
- }
-
- protected void layout(Composite composite, boolean flushCache) {
- Control children[] = composite.getChildren();
- Rectangle rect = composite.getClientArea();
- for (Control child : children) {
- if (child instanceof Label) {
- Rectangle r = new Rectangle(rect.x+2, rect.y, rect.width-2, rect.height);
- child.setBounds(r);
- } else
- child.setBounds(rect);
- child.setVisible(child == topControl);
- }
- }
-
- public String toString() {
- return "MonitorStackLayout";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashForm.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashForm.java
deleted file mode 100644
index 8b45120..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashForm.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.custom;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.graphics.*;
-/**
- * The SashForm is a composite control that lays out its children in a
- * row or column arrangement (as specified by the orientation) and places
- * a Sash between each child. One child may be maximized to occupy the
- * entire size of the SashForm. The relative sizes of the children may
- * be specified using weights.
- * <p>
- * <dl>
- * <dt><b>Styles:</b></dt>
- * <dd>HORIZONTAL, VERTICAL, SMOOTH</dd>
- * </dl>
- * </p>
- */
-public class SashForm extends Composite {
- public int SASH_WIDTH = 3;
-
- int sashStyle;
- Sash[] sashes = new Sash[0];
- // Remember background and foreground
- // colors to determine whether to set
- // sashes to the default color (null) or
- // a specific color
- Color background = null;
- Color foreground = null;
- Control[] controls = new Control[0];
- Control maxControl = null;
- Listener sashListener;
- static final int DRAG_MINIMUM = 20;
-
- protected boolean enableSash = false;
- protected boolean resize;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#HORIZONTAL
- * @see SWT#VERTICAL
- * @see #getStyle()
- */
-public SashForm(Composite parent, int style) {
- super(parent, checkStyle2(style));
- super.setLayout(new SashFormLayout());
- sashStyle = ((style & SWT.VERTICAL) != 0) ? SWT.HORIZONTAL : SWT.VERTICAL;
- if ((style & SWT.BORDER) != 0) sashStyle |= SWT.BORDER;
- if ((style & SWT.SMOOTH) != 0) sashStyle |= SWT.SMOOTH;
- sashListener = new Listener() {
- public void handleEvent(Event e) {
- onDragSash(e);
- }
- };
-}
-static int checkStyle2(int style) {
- int mask = SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- return style & mask;
-}
-/**
- * Returns SWT.HORIZONTAL if the controls in the SashForm are laid out side by side
- * or SWT.VERTICAL if the controls in the SashForm are laid out top to bottom.
- *
- * @return SWT.HORIZONTAL or SWT.VERTICAL
- */
-public int getOrientation() {
- //checkWidget();
- return (sashStyle & SWT.VERTICAL) != 0 ? SWT.HORIZONTAL : SWT.VERTICAL;
-}
-public int getStyle() {
- int style = super.getStyle();
- style |= getOrientation() == SWT.VERTICAL ? SWT.VERTICAL : SWT.HORIZONTAL;
- if ((sashStyle & SWT.SMOOTH) != 0) style |= SWT.SMOOTH;
- return style;
-}
-/**
- * Answer the control that currently is maximized in the SashForm.
- * This value may be null.
- *
- * @return the control that currently is maximized or null
- */
-public Control getMaximizedControl(){
- //checkWidget();
- return this.maxControl;
-}
-/**
- * Answer the relative weight of each child in the SashForm. The weight represents the
- * percent of the total width (if SashForm has Horizontal orientation) or
- * total height (if SashForm has Vertical orientation) each control occupies.
- * The weights are returned in order of the creation of the widgets (weight[0]
- * corresponds to the weight of the first child created).
- *
- * @return the relative weight of each child
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-
-public int[] getWeights() {
- checkWidget();
- Control[] cArray = getControls(false);
- int[] ratios = new int[cArray.length];
- for (int i = 0; i < cArray.length; i++) {
- Object data = cArray[i].getLayoutData();
- if (data != null && data instanceof SashFormData) {
- ratios[i] = (int)(((SashFormData)data).weight * 1000 >> 16);
- } else {
- ratios[i] = 200;
- }
- }
- return ratios;
-}
-Control[] getControls(boolean onlyVisible) {
- Control[] children = getChildren();
- Control[] result = new Control[0];
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof Sash) continue;
- if (onlyVisible && !children[i].getVisible()) continue;
-
- Control[] newResult = new Control[result.length + 1];
- System.arraycopy(result, 0, newResult, 0, result.length);
- newResult[result.length] = children[i];
- result = newResult;
- }
- return result;
-}
-void onDragSash(Event event) {
- if (!enableSash)
- return;
-
- Sash sash = (Sash)event.widget;
- int sashIndex = -1;
- for (int i= 0; i < sashes.length; i++) {
- if (sashes[i] == sash) {
- sashIndex = i;
- break;
- }
- }
- if (sashIndex == -1) return;
-
- Control c1 = controls[sashIndex];
- Control c2 = controls[sashIndex + 1];
- Rectangle b1 = c1.getBounds();
- Rectangle b2 = c2.getBounds();
-
- Rectangle sashBounds = sash.getBounds();
- Rectangle area = getClientArea();
- boolean correction = false;
- if (getOrientation() == SWT.HORIZONTAL) {
- correction = b1.width < DRAG_MINIMUM || b2.width < DRAG_MINIMUM;
- int totalWidth = b2.x + b2.width - b1.x;
- int shift = event.x - sashBounds.x;
- b1.width += shift;
- b2.x += shift;
- b2.width -= shift;
- if (b1.width < DRAG_MINIMUM) {
- b1.width = DRAG_MINIMUM;
- b2.x = b1.x + b1.width + sashBounds.width;
- b2.width = totalWidth - b2.x;
- event.x = b1.x + b1.width;
- event.doit = false;
- }
- if (b2.width < DRAG_MINIMUM) {
- b1.width = totalWidth - DRAG_MINIMUM - sashBounds.width;
- b2.x = b1.x + b1.width + sashBounds.width;
- b2.width = DRAG_MINIMUM;
- event.x = b1.x + b1.width;
- event.doit = false;
- }
- Object data1 = c1.getLayoutData();
- if (data1 == null || !(data1 instanceof SashFormData)) {
- data1 = new SashFormData();
- c1.setLayoutData(data1);
- }
- Object data2 = c2.getLayoutData();
- if (data2 == null || !(data2 instanceof SashFormData)) {
- data2 = new SashFormData();
- c2.setLayoutData(data2);
- }
- ((SashFormData)data1).weight = (((long)b1.width << 16) + area.width - 1) / area.width;
- ((SashFormData)data2).weight = (((long)b2.width << 16) + area.width - 1) / area.width;
- } else {
- correction = b1.height < DRAG_MINIMUM || b2.height < DRAG_MINIMUM;
- int totalHeight = b2.y + b2.height - b1.y;
- int shift = event.y - sashBounds.y;
- b1.height += shift;
- b2.y += shift;
- b2.height -= shift;
- if (b1.height < DRAG_MINIMUM) {
- b1.height = DRAG_MINIMUM;
- b2.y = b1.y + b1.height + sashBounds.height;
- b2.height = totalHeight - b2.y;
- event.y = b1.y + b1.height;
- event.doit = false;
- }
- if (b2.height < DRAG_MINIMUM) {
- b1.height = totalHeight - DRAG_MINIMUM - sashBounds.height;
- b2.y = b1.y + b1.height + sashBounds.height;
- b2.height = DRAG_MINIMUM;
- event.y = b1.y + b1.height;
- event.doit = false;
- }
- Object data1 = c1.getLayoutData();
- if (data1 == null || !(data1 instanceof SashFormData)) {
- data1 = new SashFormData();
- c1.setLayoutData(data1);
- }
- Object data2 = c2.getLayoutData();
- if (data2 == null || !(data2 instanceof SashFormData)) {
- data2 = new SashFormData();
- c2.setLayoutData(data2);
- }
- //((SashFormData)data1).weight = (((long)b1.height << 16) + area.height - 1) / area.height;
- //((SashFormData)data2).weight = (((long)b2.height << 16) + area.height - 1) / area.height;
- ((SashFormData)data1).weight = ((200 << 16) + 999) / 1000 * b1.height / b2.height;
- ((SashFormData)data2).weight = ((200 << 16) + 999) / 1000;
- }
- if (correction || (event.doit && event.detail != SWT.DRAG)) {
- c1.setBounds(b1);
- sash.setBounds(event.x, event.y, event.width, event.height);
- c2.setBounds(b2);
- }
-}
-/**
- * If orientation is SWT.HORIZONTAL, lay the controls in the SashForm
- * out side by side. If orientation is SWT.VERTICAL, lay the
- * controls in the SashForm out top to bottom.
- *
- * @param orientation SWT.HORIZONTAL or SWT.VERTICAL
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * <li>ERROR_INVALID_ARGUMENT - if the value of orientation is not SWT.HORIZONTAL or SWT.VERTICAL
- * </ul>
- */
-public void setOrientation(int orientation) {
- checkWidget();
- if (getOrientation() == orientation) return;
- if (orientation != SWT.HORIZONTAL && orientation != SWT.VERTICAL) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- sashStyle &= ~(SWT.HORIZONTAL | SWT.VERTICAL);
- sashStyle |= orientation == SWT.VERTICAL ? SWT.HORIZONTAL : SWT.VERTICAL;
- for (int i = 0; i < sashes.length; i++) {
- sashes[i].dispose();
- sashes[i] = new Sash(this, sashStyle);
- sashes[i].setBackground(background);
- sashes[i].setForeground(foreground);
- sashes[i].addListener(SWT.Selection, sashListener);
- }
- layout(false);
-}
-public void setBackground (Color color) {
- super.setBackground(color);
- background = color;
- for (int i = 0; i < sashes.length; i++) {
- sashes[i].setBackground(background);
- }
-}
-public void setForeground (Color color) {
- super.setForeground(color);
- foreground = color;
- for (int i = 0; i < sashes.length; i++) {
- sashes[i].setForeground(foreground);
- }
-}
-/**
- * Sets the layout which is associated with the receiver to be
- * the argument which may be null.
- * <p>
- * Note: No Layout can be set on this Control because it already
- * manages the size and position of its children.
- * </p>
- *
- * @param layout the receiver's new layout or null
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setLayout (Layout layout) {
- checkWidget();
- return;
-}
-/**
- * Specify the control that should take up the entire client area of the SashForm.
- * If one control has been maximized, and this method is called with a different control,
- * the previous control will be minimized and the new control will be maximized.
- * If the value of control is null, the SashForm will minimize all controls and return to
- * the default layout where all controls are laid out separated by sashes.
- *
- * @param control the control to be maximized or null
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setMaximizedControl(Control control){
- checkWidget();
- if (control == null) {
- if (maxControl != null) {
- this.maxControl = null;
- layout(false);
- for (int i= 0; i < sashes.length; i++){
- sashes[i].setVisible(true);
- }
- }
- return;
- }
-
- for (int i= 0; i < sashes.length; i++){
- sashes[i].setVisible(false);
- }
- maxControl = control;
- layout(false);
-}
-
-/**
- * Specify the relative weight of each child in the SashForm. This will determine
- * what percent of the total width (if SashForm has Horizontal orientation) or
- * total height (if SashForm has Vertical orientation) each control will occupy.
- * The weights must be positive values and there must be an entry for each
- * non-sash child of the SashForm.
- *
- * @param weights the relative weight of each child
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * <li>ERROR_INVALID_ARGUMENT - if the weights value is null or of incorrect length (must match the number of children)</li>
- * </ul>
- */
-public void setWeights(int[] weights) {
- checkWidget();
- Control[] cArray = getControls(false);
- if (weights == null || weights.length != cArray.length) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
-
- if (weights == null)
- return;
-
- int total = 0;
- for (int i = 0; i < weights.length; i++) {
- if (weights[i] < 0) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- total += weights[i];
- }
- if (total == 0) {
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- }
- for (int i = 0; i < cArray.length; i++) {
- Object data = cArray[i].getLayoutData();
- if (data == null || !(data instanceof SashFormData)) {
- data = new SashFormData();
- cArray[i].setLayoutData(data);
- }
- ((SashFormData)data).weight = (((long)weights[i] << 16) + total - 1) / total;
- }
-
- layout(false);
-}
-
-public void setSimpleLayout(boolean b) {
- Control[] cArray = getControls(false);
- if (cArray == null || cArray.length != 2)
- return;
- enableSash = b;
- SashFormLayout layout = (SashFormLayout) getLayout();
- layout.simple = !enableSash;
-
- if (enableSash)
- resize = true;
-}
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashFormData.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashFormData.java
deleted file mode 100644
index 48ba237..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashFormData.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.custom;
-
-class SashFormData {
-
- long weight;
-
-String getName () {
- String string = getClass ().getName ();
- int index = string.lastIndexOf ('.');
- if (index == -1) return string;
- return string.substring (index + 1, string.length ());
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString () {
- return getName()+" {weight="+weight+"}"; //$NON-NLS-2$
-}
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashFormLayout.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashFormLayout.java
deleted file mode 100644
index f750322..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/custom/SashFormLayout.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.custom;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-
-/**
- * This class provides the layout for SashForm
- *
- * @see SashForm
- */
-class SashFormLayout extends Layout {
- protected boolean simple;
-
-protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
- SashForm sashForm = (SashForm)composite;
- Control[] cArray = sashForm.getControls(true);
- int width = 0;
- int height = 0;
- if (cArray.length == 0) {
- if (wHint != SWT.DEFAULT) width = wHint;
- if (hHint != SWT.DEFAULT) height = hHint;
- return new Point(width, height);
- }
- // determine control sizes
- boolean vertical = sashForm.getOrientation() == SWT.VERTICAL;
- int maxIndex = 0;
- int maxValue = 0;
- Point[] sizes = new Point[cArray.length];
- for (int i = 0; i < cArray.length; i++) {
- if (vertical) {
- sizes[i] = cArray[i].computeSize(wHint, SWT.DEFAULT, flushCache);
- if (sizes[i].y > maxValue) {
- maxIndex = i;
- maxValue = sizes[i].y;
- }
- width = Math.max(width, sizes[i].x);
- } else {
- sizes[i] = cArray[i].computeSize(SWT.DEFAULT, hHint, flushCache);
- if (sizes[i].x > maxValue) {
- maxIndex = i;
- maxValue = sizes[i].x;
- }
- height = Math.max(height, sizes[i].y);
- }
- }
- // get the ratios
- long[] ratios = new long[cArray.length];
- long total = 0;
- for (int i = 0; i < cArray.length; i++) {
- Object data = cArray[i].getLayoutData();
- if (data != null && data instanceof SashFormData) {
- ratios[i] = ((SashFormData)data).weight;
- } else {
- data = new SashFormData();
- cArray[i].setLayoutData(data);
- ((SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
-
- }
- total += ratios[i];
- }
- if (ratios[maxIndex] > 0) {
- int sashwidth = sashForm.sashes.length > 0 ? sashForm.SASH_WIDTH + sashForm.sashes [0].getBorderWidth() * 2 : sashForm.SASH_WIDTH;
- if (vertical) {
- height += (int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
- } else {
- width += (int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
- }
- }
- width += sashForm.getBorderWidth()*2;
- height += sashForm.getBorderWidth()*2;
- if (wHint != SWT.DEFAULT) width = wHint;
- if (hHint != SWT.DEFAULT) height = hHint;
- return new Point(width, height);
-}
-
-protected boolean flushCache(Control control) {
- return true;
-}
-
-protected void layout(Composite composite, boolean flushCache) {
- SashForm sashForm = (SashForm)composite;
- Rectangle area = sashForm.getClientArea();
- if (area.width <= 1 || area.height <= 1) return;
-
- Control[] newControls = sashForm.getControls(true);
- if (sashForm.controls.length == 0 && newControls.length == 0)
- return;
- sashForm.controls = newControls;
-
- Control[] controls = sashForm.controls;
-
- if (sashForm.maxControl != null && !sashForm.maxControl.isDisposed()) {
- for (int i= 0; i < controls.length; i++){
- if (controls[i] != sashForm.maxControl) {
- controls[i].setBounds(-200, -200, 0, 0);
- } else {
- controls[i].setBounds(area);
- }
- }
- return;
- }
-
- // simple layout
- if (simple) {
- // hide sashes
- for (int i = 0; i < sashForm.sashes.length; i++) {
- sashForm.sashes[i].setEnabled(false);
- sashForm.sashes[i].setVisible(false);
- }
-
- Point p = controls[0].computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- controls[0].setBounds(0, 0, area.width, p.y);
- controls[1].setBounds(0, p.y + 2, area.width, area.height - p.y - 2);
-
- return;
- }
-
- // keep just the right number of sashes
- if (sashForm.sashes.length < controls.length - 1) {
- Sash[] newSashes = new Sash[controls.length - 1];
- System.arraycopy(sashForm.sashes, 0, newSashes, 0, sashForm.sashes.length);
- for (int i = sashForm.sashes.length; i < newSashes.length; i++) {
- newSashes[i] = new Sash(sashForm, sashForm.sashStyle);
- newSashes[i].setBackground(sashForm.background);
- newSashes[i].setForeground(sashForm.foreground);
- newSashes[i].addListener(SWT.Selection, sashForm.sashListener);
- }
- sashForm.sashes = newSashes;
- }
- if (sashForm.sashes.length > controls.length - 1) {
- if (controls.length == 0) {
- for (int i = 0; i < sashForm.sashes.length; i++) {
- sashForm.sashes[i].dispose();
- }
- sashForm.sashes = new Sash[0];
- } else {
- Sash[] newSashes = new Sash[controls.length - 1];
- System.arraycopy(sashForm.sashes, 0, newSashes, 0, newSashes.length);
- for (int i = controls.length - 1; i < sashForm.sashes.length; i++) {
- sashForm.sashes[i].dispose();
- }
- sashForm.sashes = newSashes;
- }
- }
- if (controls.length == 0) return;
- Sash[] sashes = sashForm.sashes;
-
- for (int i = 0; i < sashForm.sashes.length; i++) {
- sashes[i].setEnabled(true);
- sashes[i].setVisible(true);
- }
-
- if (sashForm.resize) {
- Control c1 = controls[0];
- Control c2 = controls[1];
-
- int h1 = area.height / 3;
- int h2 = area.height - h1 - sashes[0].getBounds().height;
-
- Object data1 = c1.getLayoutData();
- if (data1 == null || !(data1 instanceof SashFormData)) {
- data1 = new SashFormData();
- c1.setLayoutData(data1);
- }
- Object data2 = c2.getLayoutData();
- if (data2 == null || !(data2 instanceof SashFormData)) {
- data2 = new SashFormData();
- c2.setLayoutData(data2);
- }
- ((SashFormData)data1).weight = ((200 << 16) + 999) / 1000 * h1 / h2;
- ((SashFormData)data2).weight = ((200 << 16) + 999) / 1000;
- sashForm.resize = false;
- }
-
- // get the ratios
- long[] ratios = new long[controls.length];
- long total = 0;
- for (int i = 0; i < controls.length; i++) {
- Object data = controls[i].getLayoutData();
- if (data != null && data instanceof SashFormData) {
- ratios[i] = ((SashFormData)data).weight;
- } else {
- data = new SashFormData();
- controls[i].setLayoutData(data);
- ((SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
- }
- total += ratios[i];
- }
-
- int sashwidth = sashes.length > 0 ? sashForm.SASH_WIDTH + sashes [0].getBorderWidth() * 2 : sashForm.SASH_WIDTH;
- if (sashForm.getOrientation() == SWT.HORIZONTAL) {
- int width = (int)(ratios[0] * (area.width - sashes.length * sashwidth) / total);
- int x = area.x;
- controls[0].setBounds(x, area.y, width, area.height);
- x += width;
- for (int i = 1; i < controls.length - 1; i++) {
- sashes[i - 1].setBounds(x, area.y, sashwidth, area.height);
- x += sashwidth;
- width = (int)(ratios[i] * (area.width - sashes.length * sashwidth) / total);
- controls[i].setBounds(x, area.y, width, area.height);
- x += width;
- }
- if (controls.length > 1) {
- sashes[sashes.length - 1].setBounds(x, area.y, sashwidth, area.height);
- x += sashwidth;
- width = area.width - x;
- controls[controls.length - 1].setBounds(x, area.y, width, area.height);
- }
- } else {
- int height = (int)(ratios[0] * (area.height - sashes.length * sashwidth) / total);
- int y = area.y;
- controls[0].setBounds(area.x, y, area.width, height);
- y += height;
- for (int i = 1; i < controls.length - 1; i++) {
- sashes[i - 1].setBounds(area.x, y, area.width, sashwidth);
- y += sashwidth;
- height = (int)(ratios[i] * (area.height - sashes.length * sashwidth) / total);
- controls[i].setBounds(area.x, y, area.width, height);
- y += height;
- }
- if (controls.length > 1) {
- sashes[sashes.length - 1].setBounds(area.x, y, area.width, sashwidth);
- y += sashwidth;
- height = area.height - y;
- controls[controls.length - 1].setBounds(area.x, y, area.width, height);
- }
- }
-}
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/ContentViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/ContentViewer.java
deleted file mode 100644
index db500ab..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/ContentViewer.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.provisional;
-
-import org.eclipse.swt.widgets.Composite;
-/**
- * Editable viewer for displaying and editing requests and responses.
- * <p>
- * This abstract class is intended to be subclassed only by clients
- * to extend the <code>contentViewers</code> extension point.
- * The subclass must have a public 0-argument constructor, which will be used
- * automatically to instantiate the viewer when required.
- * Once instantiated, {@link #init(Composite)} is called to create
- * the viewer's controls. Then {@link #setContent(byte[])} is called,
- * one or more times, to cause the viewer to display particular
- * content. Finally, when the viewer is no longer needed, {@link #dispose()}
- * is called to free up any resources tied up by the viewer.
- * </p>
- * <p>
- * [issue: It's unclear how these content viewers are used.
- * Is it just that the UI provides a list of available
- * views for the user to make a manual selection from, regardless
- * of the actual content of the message traffic?]
- * </p>
- * [issue: CS - If a ContentViewer is editable, does that mean we can edit the
- * bytes of the message and resend it across the wire? How is an editable ContentViewer
- * handled differently by the framework? Perhaps an example of what an editeable viewer would do. ]
- */
-public abstract class ContentViewer {
- /**
- * Creates a new content viewer instance.
- */
- protected ContentViewer() {
- // do nothing
- }
-
- /**
- * Creates the controls for this viewer as children of the given composite.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method.
- * </p>
- *
- * @param parent the parent composite
- */
- public abstract void init(Composite parent);
-
- /**
- * Sets the content that the viewer should display.
- * The parameter may be null if no content should be displayed.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method.
- * </p>
- * <p>
- * [issue: Since this is for displaying request-reponse messages,
- * why not pass an Request? The problem as it stands now is that
- * it is unclear from specs how content viewers relate to anything
- * else having to do with the monitor.]
- * </p>
- *
- * @param b the content to display, or <code>null</code> to
- * display nothing
- */
- public abstract void setContent(byte[] b);
-
- /**
- * Get the content from the viewer. This is usually only interesting if the
- * content has changed.
- * <p>
- * The default implementation of this method does nothing and
- * returns null. Subclasses should override this method.
- * </p>
- *
- * @return the content from the viewer, or <code>null</code> if none
- */
- public abstract byte[] getContent();
-
- /**
- * Disposes this viewer and any underlying resources such as a composite.
- * This method will be called whenever the user switches to use another
- * viewer or the monitor view is closed. The parent composite should not
- * be disposed since it may be used to display another viewer.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method to provide specialized cleanup.
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Set whether the current viewer is editable, that is, the user is able to
- * edit the content.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method to allows instances
- * to be made editable.
- * </p>
- *
- * @param editable <code>true</code> if true the content can be edited,
- * and <code>false</code> otherwise
- */
- public void setEditable(boolean editable) {
- // do nothing
- }
-
- /**
- * Returns whether the current viewer is editable, that is, the user is able to
- * edit the content.
- * <p>
- * The default implementation of this method does nothing.
- * Subclasses should override this method to allows instances
- * to be made editable.
- * </p>
- *
- * @return <code>true</code> if true the content can be edited,
- * and <code>false</code> otherwise
- */
- public boolean getEditable() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/MonitorUICore.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/MonitorUICore.java
deleted file mode 100644
index 02ea44c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/MonitorUICore.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.provisional;
-
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * Main class for access to the monitor UI.
- * <p>
- * This class provides all functionality through static members. It is not intended
- * to be instantiated or subclassed.
- * </p>
- */
-public final class MonitorUICore {
- /**
- * Cannot create MonitorUICore - use static methods.
- */
- private MonitorUICore() {
- // can't create
- }
-
- /**
- * Returns an array of the requests currently being displayed in the TCP/IP
- * monitor view.
- *
- * @return an array of requests
- */
- public static Request[] getRequests() {
- return MonitorUIPlugin.getInstance().getRequests();
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/package.html b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/package.html
deleted file mode 100644
index d28b6c2..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="../../../../../..//apistyles.css" type="text/css">
-<title>WTP API overview</title>
-</head>
-<body>
-<p>TCP/IP monitor UI</p>
-<table width="500">
-<tr>
-<td>
-<p>The ContentViewer class is provided to
-implement the viewers extension point that allows external plugins to provide
-a view for viewing request and response data content in the monitor view.
-</p>
-</td>
-</tr>
-</table>
-</body>
-</html>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/package.xml b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/package.xml
deleted file mode 100644
index be41a27..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/provisional/package.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<html>
-<head>
- <!-- Escape to the root of your source folder -->
- <meta
- name="root"
- content="../../../../../../" />
- <title>WTP API overview</title>
-</head>
-
-<body>
-<abstract>TCP/IP monitor UI</abstract>
-
-<p>The ContentViewer class is provided to
-implement the viewers extension point that allows external plugins to provide
-a view for viewing request and response data content in the monitor view.
-</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java
deleted file mode 100644
index 3c4d83f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-/**
- *
- */
-public class FilterAction extends Action {
- protected ViewerManager vm;
- protected IContentFilter filter;
- protected boolean enabled;
-
- public FilterAction(ViewerManager vm, IContentFilter filter) {
- super(filter.getName(), IAction.AS_CHECK_BOX);
- this.vm = vm;
- this.filter = filter;
- }
-
- public void run() {
- if (!isChecked())
- vm.removeFilter(filter);
- else
- vm.addFilter(filter);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java
deleted file mode 100644
index f1f0f58..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * Modify the selected message. Creates a new resendrequest and adds it
- * to the tree.
- */
-public class ModifyMessageAction implements IViewActionDelegate{
- ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof Request) {
- Request req = (Request) element;
- ResendHTTPRequest newReq = MonitorManager.createResendRequest(req);
- MonitorManager.getInstance().addResendRequest(req, newReq);
- TreeViewer treeViewer = MonitorView.view.treeViewer;
- treeViewer.add(req, newReq);
- treeViewer.setSelection(new StructuredSelection(newReq), false);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java
deleted file mode 100644
index b45eb20..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * Content provider for the monitor server view.
- */
-public class MonitorTreeContentProvider implements ITreeContentProvider {
- protected static final String ROOT = "root";
-
- /**
- * ProxyTreeContentProvider constructor comment.
- */
- public MonitorTreeContentProvider() {
- super();
- }
-
- /**
- * Disposes of this content provider.
- * <p>
- * [Issue: This method should be changed to take a Viewer,
- * renamed and repurposed to disconnect a content provider from
- * a viewer. This is over and above what inputChanged does,
- * which is disconnecting a content provider from the viewer's
- * input (but not the viewer itself).
- * ]
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns an iterator over the child elements of the given element.
- * <p>
- * Note: The difference between this method and
- * <code>IStructuredContentProvider.getElements</code> is
- * that <code>getElements</code> is called to obtain the
- * tree viewer's root elements, whereas <code>getChildren</code> is used
- * to obtain the children of a given node in the tree
- * (including a root).
- * </p>
- * <p>
- * [Issue: Don't know what above is trying to say.
- * See IStructuredContentProvider.getElements.
- * ]
- * </p>
- *
- * @param element the element
- * @return an iterator over the child elements
- * (element type: <code>Object</code>)
- */
- public Object[] getChildren(Object element) {
- if (element instanceof Integer) {
- Integer in = (Integer) element;
- List<Request> list = new ArrayList<Request>();
- Request[] requests = MonitorUIPlugin.getInstance().getRequests();
- if (requests != null) {
- for (Request req : requests) {
- if ((req.getLocalPort() == in.intValue())
- && !(req instanceof ResendHTTPRequest))
- list.add(req);
- }
- }
- return list.toArray();
- } else if (element instanceof Request) {
- Request req = (Request) element;
- ResendHTTPRequest[] rr = MonitorManager.getInstance().getResendRequests(req);
- List<Request> list = new ArrayList<Request>();
- if (rr != null) {
- for (ResendHTTPRequest r : rr)
- list.add(r);
- }
- return list.toArray();
- }
- return null;
- }
-
- /*
- * Returns an iterator over the elements belonging to the
- * given element. These elements can be presented as rows in a table,
- * items in a list, etc.
- */
- public Object[] getElements(Object element) {
- if (ROOT.equals(element)) {
- List<Integer> list = new ArrayList<Integer>();
- Request[] requests = MonitorUIPlugin.getInstance().getRequests();
- if (requests != null) {
- for (Request req : requests) {
- Integer in = new Integer(req.getLocalPort());
- if (!list.contains(in))
- list.add(in);
- }
- }
- return list.toArray();
- }
- return getChildren(element);
- }
-
- /*
- * Returns the parent for the given element, or <code>null</code>
- * indicating that the parent can't be computed.
- */
- public Object getParent(Object element) {
- if (element != null) {
- if (element instanceof Integer)
- return ROOT;
- Request call = (Request) element;
- if (call instanceof ResendHTTPRequest) {
- ResendHTTPRequest callResend = (ResendHTTPRequest) call;
- Request parent = callResend.getOriginalRequest();
- if (parent != null)
- return parent;
- }
- return new Integer(call.getLocalPort());
- }
- return null;
- }
-
- /*
- * Returns whether the given element has children.
- */
- public boolean hasChildren(Object element) {
- if (element instanceof Integer)
- return true;
- if (element instanceof Request)
- return MonitorManager.getInstance().getResendRequests((Request) element).length > 0;
-
- return false;
- }
-
- /*
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java
deleted file mode 100644
index 5b38850..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.text.SimpleDateFormat;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.IRequestListener;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.*;
-/**
- * View of TCP/IP activity.
- */
-public class MonitorView extends ViewPart {
- protected Tree tree;
- protected TreeViewer treeViewer;
- protected MonitorTreeContentProvider contentProvider;
-
- protected IRequestListener listener;
- protected ViewerManager vm;
- protected List requestViewers;
- protected List responseViewers;
-
- protected static SimpleDateFormat format;
- protected static final String VIEW_ID = "org.eclipse.wst.internet.monitor.view";
- protected static final String DEFAULT_VIEWER = "org.eclipse.wst.internet.monitor.viewers.byte";
-
- protected IAction httpHeaderAction;
- protected IAction preferenceAction;
-
- public static MonitorView view;
-
- protected Request currentRequest = null;
- protected StructuredSelection currentSelection = null;
-
- /**
- * MonitorView constructor comment.
- */
- public MonitorView() {
- super();
- view = this;
-
- // try specified format, and fall back to standard format
- try {
- format = new SimpleDateFormat(Messages.viewDateFormat);
- } catch (Exception e) {
- format = new SimpleDateFormat("h:mm.s.S a");
- }
- }
-
- public void doRequestAdded(final Request rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (!(rr instanceof ResendHTTPRequest)) {
- treeViewer.refresh(MonitorTreeContentProvider.ROOT);
- if (!MonitorUIPlugin.getPinViewPreference())
- treeViewer.setSelection(new StructuredSelection(rr), true);
- }
- }
- });
- }
-
- public void doRequestChanged(final Request rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (treeViewer == null)
- return;
- IStructuredSelection sel = (IStructuredSelection) treeViewer.getSelection();
-
- treeViewer.refresh(rr);
- if (!sel.isEmpty())
- treeViewer.setSelection(sel);
- }
- });
- }
-
- /**
- * Clear the view.
- */
- protected void clear() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- treeViewer.setSelection(null);
- treeViewer.setInput(MonitorTreeContentProvider.ROOT);
- }
- });
- }
-
- protected void setSelection(Request request) {
- if (treeViewer != null)
- treeViewer.setSelection(new StructuredSelection(request));
- }
-
- /**
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- SashForm sashFparent = new SashForm(parent, SWT.VERTICAL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = 4;
- layout.verticalSpacing = 4;
- sashFparent.setLayout(layout);
- sashFparent.setLayoutData(new GridData(GridData.FILL_BOTH));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(sashFparent, ContextIds.VIEW);
-
- // create tree panel
- Composite treePanel = new Composite(sashFparent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- treePanel.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 110;
- data.horizontalSpan = 2;
- treePanel.setLayoutData(data);
-
- tree = new Tree(treePanel, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- data = new GridData(GridData.FILL_BOTH);
- //data.widthHint = 120;
- tree.setLayoutData(data);
- treeViewer = new TreeViewer(tree);
- contentProvider = new MonitorTreeContentProvider();
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setInput(MonitorTreeContentProvider.ROOT);
- treeViewer.setLabelProvider(new TreeLabelProvider());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(tree, ContextIds.VIEW_TREE);
-
- Composite detailsPanel = new Composite(treePanel, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- detailsPanel.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 200;
- detailsPanel.setLayoutData(data);
-
- final Label label = new Label(detailsPanel, SWT.NONE);
- label.setText(NLS.bind(Messages.viewTime, ""));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label label2 = new Label(detailsPanel, SWT.NONE);
- label2.setText(NLS.bind(Messages.viewResponseTime, ""));
- label2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label label3 = new Label(detailsPanel, SWT.NONE);
- label3.setText(NLS.bind(Messages.viewType, ""));
- label3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- // create center and right panels
- SashForm sashFchild = new SashForm(sashFparent, SWT.HORIZONTAL);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = 2;
- layout.verticalSpacing = 4;
- sashFchild.setLayout(layout);
- sashFparent.setWeights(new int[] { 30, 70 });
-
- // request panel
- Composite request = new Composite(sashFchild, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- request.setLayout(layout);
- request.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite requestHeader = new Composite(request, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 1;
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginLeft = 2;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- requestHeader.setLayout(layout);
- requestHeader.setLayoutData(data);
-
- final Label requestLabel = new Label(requestHeader, SWT.NONE);
- requestLabel.setText(NLS.bind(Messages.viewRequest, ""));
- requestLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Combo requestViewerCombo = new Combo(requestHeader, SWT.DROP_DOWN | SWT.READ_ONLY);
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- data.verticalSpan = 2;
- requestViewerCombo.setLayoutData(data);
-
- final Label requestSizeLabel = new Label(requestHeader, SWT.NONE);
- requestSizeLabel.setText(NLS.bind(Messages.viewSize, ""));
- requestSizeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // response panel
- Composite response = new Composite(sashFchild, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- response.setLayout(layout);
- response.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite responseHeader = new Composite(response, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 1;
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginLeft = 2;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- responseHeader.setLayout(layout);
- responseHeader.setLayoutData(data);
-
- final Label responseLabel = new Label(responseHeader, SWT.NONE);
- responseLabel.setText(NLS.bind(Messages.viewResponse, ""));
- responseLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Combo responseViewerCombo = new Combo(responseHeader, SWT.DROP_DOWN | SWT.READ_ONLY);
- data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- data.verticalSpan = 2;
- responseViewerCombo.setLayoutData(data);
-
- final Label responseSizeLabel = new Label(responseHeader, SWT.NONE);
- responseSizeLabel.setText(NLS.bind(Messages.viewSize, ""));
- responseSizeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // viewer manager
- vm = new ViewerManager(request, response);
- requestViewers = vm.getRequestViewers();
- responseViewers = vm.getResponseViewers();
-
- // set up the viewer combo boxes
- Iterator iterator = requestViewers.iterator();
- int ctr = 0;
- while (iterator.hasNext()) {
- Viewer viewer = (Viewer) iterator.next();
- requestViewerCombo.add(viewer.getLabel(), ctr);
- if (viewer.getId().equals(DEFAULT_VIEWER)) {
- requestViewerCombo.select(ctr);
- vm.setRequestViewer(viewer);
- }
- ctr++;
- }
- requestViewerCombo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- Viewer viewer = (Viewer) requestViewers.get(requestViewerCombo.getSelectionIndex());
- if (currentRequest != null && viewer != null)
- currentRequest.setProperty("request-viewer", viewer.getId());
- vm.setRequestViewer(viewer);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
- });
- requestHeader.layout(true);
-
- iterator = responseViewers.iterator();
- ctr = 0;
- while (iterator.hasNext()) {
- Viewer viewer = (Viewer) iterator.next();
- responseViewerCombo.add(viewer.getLabel(), ctr);
- if (viewer.getId().equals(DEFAULT_VIEWER)) {
- responseViewerCombo.select(ctr);
- vm.setResponseViewer(viewer);
- }
- ctr++;
- }
- responseViewerCombo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- Viewer viewer = (Viewer) responseViewers.get(responseViewerCombo.getSelectionIndex());
- if (currentRequest != null && viewer != null)
- currentRequest.setProperty("response-viewer", viewer.getId());
- vm.setResponseViewer(viewer);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
- });
- responseHeader.layout(true);
-
- // selection listener
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
-
- currentRequest = null;
- if (selection != null && !selection.isEmpty()) {
- StructuredSelection sel = (StructuredSelection) selection;
- currentSelection = sel;
- Object obj = sel.iterator().next();
- if (obj instanceof Request)
- currentRequest = (Request) obj;
- }
-
- if (currentRequest != null) {
- label.setText(NLS.bind(Messages.viewTime, format.format(currentRequest.getDate())));
-
- if (currentRequest.getResponseTime() == -1)
- label2.setText(NLS.bind(Messages.viewResponseTime, ""));
- else {
- String time = NLS.bind(Messages.viewResponseTimeFormat, currentRequest.getResponseTime() + "");
- label2.setText(NLS.bind(Messages.viewResponseTime, time));
- }
- label3.setText(NLS.bind(Messages.viewType, currentRequest.getProtocol()));
-
- // request information
- requestLabel.setText(NLS.bind(Messages.viewRequest, "localhost:" + currentRequest.getLocalPort()));
- requestSizeLabel.setText(getSizeString(currentRequest.getRequest(Request.CONTENT), currentRequest.getRequest(Request.ALL)));
-
- // response information
- responseLabel.setText(NLS.bind(Messages.viewResponse, currentRequest.getRemoteHost() + ":" + currentRequest.getRemotePort()));
- responseSizeLabel.setText(getSizeString(currentRequest.getResponse(Request.CONTENT), currentRequest.getResponse(Request.ALL)));
-
- vm.setRequest(currentRequest);
-
- Viewer viewer = vm.findViewer((String) currentRequest.getProperty("request-viewer"));
- if (viewer == null)
- viewer = vm.findViewer(DEFAULT_VIEWER);
- if (viewer != null) {
- vm.setRequestViewer(viewer);
- requestViewerCombo.select(requestViewers.indexOf(viewer));
- }
-
- viewer = vm.findViewer((String) currentRequest.getProperty("response-viewer"));
- if (viewer == null && currentRequest.getName() != null)
- viewer = vm.getDefaultViewer(currentRequest.getName());
- if (viewer != null) {
- vm.setResponseViewer(viewer);
- responseViewerCombo.select(responseViewers.indexOf(viewer));
- }
- } else {
- label.setText(NLS.bind(Messages.viewTime, ""));
- label2.setText(NLS.bind(Messages.viewResponseTime, ""));
- requestLabel.setText(NLS.bind(Messages.viewRequest, ""));
- requestSizeLabel.setText(NLS.bind(Messages.viewSize, ""));
- responseLabel.setText(NLS.bind(Messages.viewResponse, ""));
- responseSizeLabel.setText(NLS.bind(Messages.viewSize, ""));
- vm.setRequest(currentRequest);
- }
- }
- });
- treeViewer.expandToLevel(2);
-
- // create a menu manager for a context menu
- MenuManager menuManager = new MenuManager();
- menuManager.setRemoveAllWhenShown(true);
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager menu) {
- menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menu.add(preferenceAction);
- }
- });
-
- // create the menu
- Menu menu = menuManager.createContextMenu(treeViewer.getControl());
- treeViewer.getControl().setMenu(menu);
-
- // register the menu with the platform
- getSite().registerContextMenu(menuManager, treeViewer);
-
- initializeActions();
- }
-
- protected String getSizeString(byte[] a, byte[] b) {
- String aa = "0";
- String bb = "0";
- if (a != null)
- aa = a.length + "";
- if (b != null)
- bb = b.length + "";
- String size = NLS.bind(Messages.viewSizeFormat, new Object[] { aa, bb});
- return NLS.bind(Messages.viewSize, size);
- }
-
- public void dispose() {
- super.dispose();
- treeViewer = null;
- view = null;
- }
-
- /**
- * Initialize the tool-bar and menu actions.
- */
- public void initializeActions() {
- final IAction pinAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean pin = MonitorUIPlugin.getPinViewPreference();
- MonitorUIPlugin.setPinViewPreference(!pin);
- }
- });
- }
- };
- pinAction.setChecked(false);
- pinAction.setToolTipText(Messages.actionPin);
- pinAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_PIN));
- pinAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_PIN));
- pinAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_PIN));
-
-
- final IAction sortByResponseTimeAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (treeViewer.getComparator() == null) {
- setChecked(true);
- treeViewer.setComparator(new RequestComparator());
- } else {
- setChecked(false);
- treeViewer.setComparator(null);
- }
- }
- });
- }
- };
- sortByResponseTimeAction.setChecked(false);
- sortByResponseTimeAction.setToolTipText(Messages.actionSortByResponseTime);
- sortByResponseTimeAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_SORT_RESPONSE_TIME));
- sortByResponseTimeAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_SORT_RESPONSE_TIME));
- sortByResponseTimeAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_SORT_RESPONSE_TIME));
-
- IAction clearAction = new Action() {
- public void run() {
- MonitorUIPlugin.getInstance().clearRequests();
- clear();
- }
- };
- clearAction.setToolTipText(Messages.actionClearToolTip);
- clearAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_CLEAR));
- clearAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_CLEAR));
- clearAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_CLEAR));
-
- httpHeaderAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean b = vm.getDisplayHeaderInfo();
- vm.setDisplayHeaderInfo(!b);
- setChecked(!b);
- }
- });
- }
- };
- httpHeaderAction.setChecked(vm.getDisplayHeaderInfo());
- httpHeaderAction.setText(Messages.actionShowHeader);
-
- preferenceAction = new Action() {
- public void run() {
- showPreferencePage();
- }
- };
- preferenceAction.setText(Messages.actionProperties);
-
-
- IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
- tbm.add(sortByResponseTimeAction);
- tbm.add(clearAction);
- tbm.add(pinAction);
-
- IContentFilter[] filters = MonitorPlugin.getInstance().getContentFilters();
- IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
- menuManager.add(httpHeaderAction);
- for (IContentFilter cf : filters) {
- FilterAction action = new FilterAction(vm, cf);
- menuManager.add(action);
- }
- menuManager.add(new Separator());
- menuManager.add(preferenceAction);
- }
-
- protected boolean showPreferencePage() {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.debug.ui.DebugPreferencePage").findSubNode("org.eclipse.wst.internet.monitor.preferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
-
- final PreferenceDialog dialog = new PreferenceDialog(getSite().getShell(), manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(getSite().getShell().getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
- /**
- * Open a request.
- *
- * @param request the request
- */
- public static void open(final Request request) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbench workbench = MonitorUIPlugin.getInstance().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- IViewPart view2 = page.findView(VIEW_ID);
-
- if (view2 != null)
- page.bringToTop(view2);
- else
- page.showView(VIEW_ID);
-
- if (view != null && !MonitorUIPlugin.getPinViewPreference())
- view.setSelection(request);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error opening TCP/IP view", e);
- }
- }
- });
- }
-
- /**
- *
- */
- public void setFocus() {
- if (tree != null)
- tree.setFocus();
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/RequestComparator.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/RequestComparator.java
deleted file mode 100644
index cf7b68a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/RequestComparator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-
-public class RequestComparator extends ViewerComparator {
- /*
- * @see ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public int compare(Viewer viewer, Object o1, Object o2) {
- if (o1 instanceof Request && o2 instanceof Request) {
- Request r1 = (Request) o1;
- Request r2 = (Request) o2;
- if (r1.getResponseTime() < r2.getResponseTime())
- return -1;
- return 1;
- }
- return super.compare(viewer, o1, o2);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java
deleted file mode 100644
index 0df04de..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-/**
- * Resends the selected request and adds the result to the request/response tree.
- */
-public class ResendMessageAction implements IViewActionDelegate{
- protected ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof Request) {
- Request req = (Request) element;
- ResendHTTPRequest newReq = MonitorManager.createResendRequest(req);
- MonitorManager.getInstance().addResendRequest(req, newReq);
- TreeViewer treeViewer = MonitorView.view.treeViewer;
- treeViewer.add(req, newReq);
- treeViewer.setSelection(new StructuredSelection(newReq), false);
- newReq.sendRequest();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java
deleted file mode 100644
index 830b433..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- * Send a modified message.
- */
-public class SendModifiedMessageAction implements IViewActionDelegate{
- ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof ResendHTTPRequest) {
- ResendHTTPRequest req = (ResendHTTPRequest) element;
- ContentViewer curViewer = MonitorView.view.vm.getCurrentRequestViewer();
- HeaderViewer curHeaderViewer = MonitorView.view.vm.getCurrentRequestHeaderViewer();
- req.setRequest(curViewer.getContent(), Request.CONTENT);
-
- if (curHeaderViewer != null)
- req.setRequest(curHeaderViewer.getContent(), Request.TRANSPORT);
-
- req.sendRequest();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java
deleted file mode 100644
index 99c1df3..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * A label provider for the monitor server view.
- */
-public class TreeLabelProvider implements ILabelProvider {
- /**
- * TreeLabelProvider constructor comment.
- */
- public TreeLabelProvider() {
- super();
- }
-
- /*
- * Adds a listener to this label provider.
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /*
- * Disposes of this label provider.
- */
- public void dispose() {
- // do nothing
- }
-
- /*
- * Returns the image for the label of the given element for use
- * in the given viewer.
- */
- public Image getImage(Object element) {
- if (element instanceof Request) {
- if (element instanceof ResendHTTPRequest) {
- if (!((ResendHTTPRequest) element).hasBeenSent())
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_RESEND_REQUEST_RESPONSE);
- }
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_REQUEST_RESPONSE);
- }
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_HOST);
- }
-
- /*
- * Returns the text for the label of the given element for use
- * in the given viewer.
- */
- public String getText(Object element) {
- if (element instanceof Request) {
- Request call = (Request) element;
- return call.getName();
- } else if (element instanceof Integer) {
- Integer in = (Integer) element;
- return "localhost:" + in.intValue();
- } else
- return element.toString();
- }
-
- /*
- * Returns whether the label would be affected
- * by a change to the given property of the given element.
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /*
- * Removes a listener to this label provider.
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/Viewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/Viewer.java
deleted file mode 100644
index 748f938..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/Viewer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.ui.internal.Trace;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-/**
- *
- */
-public class Viewer {
- private IConfigurationElement element;
-
- /**
- * Create a new content viewer.
- *
- * @param element a configuration element
- */
- public Viewer(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- public String getId() {
- return element.getAttribute("id");
- }
-
- public String getLabel() {
- String label = element.getAttribute("label");
- if (label == null)
- return "n/a";
- return label;
- }
-
- /**
- * Create an instance of the viewer.
- *
- * @return the viewer, or <code>null</code> if it couldn't be loaded
- */
- public ContentViewer createViewer() {
- try {
- return (ContentViewer) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create viewer" + toString(), e);
- return null;
- }
- }
-
- public boolean isRequestViewer() {
- return element.getAttribute("type").toLowerCase().indexOf("request") >= 0;
- }
-
- public boolean isResponseViewer() {
- return element.getAttribute("type").toLowerCase().indexOf("response") >= 0;
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return String
- */
- public String toString() {
- return "ContentViewer[" + getId() + "]";
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java
deleted file mode 100644
index 0394414..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.internet.monitor.core.internal.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.Trace;
-import org.eclipse.wst.internet.monitor.ui.internal.custom.SashForm;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.ByteViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- *
- */
-public class ViewerManager {
- private boolean displayHeaderInf;
-
- protected ContentViewer reqViewer;
- protected ContentViewer respViewer;
- protected Viewer requestViewer;
- protected Viewer responseViewer;
-
- protected HeaderViewer reqHeader;
- protected HeaderViewer respHeader;
-
- protected Composite reqComp;
- protected Composite respComp;
-
- protected List<Viewer> viewers;
-
- protected Request request;
-
- protected SashForm reqSash;
- protected SashForm respSash;
-
- protected List<IContentFilter> filters = new ArrayList<IContentFilter>();
-
- public ViewerManager(Composite reqParent, Composite respParent) {
- reqSash = new SashForm(reqParent, SWT.VERTICAL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- layout.marginWidth = 0;
- reqSash.setLayout(layout);
- reqSash.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- respSash = new SashForm(respParent, SWT.VERTICAL);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- layout.marginWidth = 0;
- respSash.setLayout(layout);
- respSash.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- reqComp = reqSash;
- respComp = respSash;
-
- reqHeader = new HeaderViewer(reqSash, HeaderViewer.REQUEST_HEADER);
- respHeader = new HeaderViewer(respSash, HeaderViewer.RESPONSE_HEADER);
- reqViewer = new ByteViewer();
- reqViewer.init(reqSash);
- respViewer = new ByteViewer();
- respViewer.init(respSash);
-
- reqSash.setWeights(new int[] { 10, 90 });
- respSash.setWeights(new int[] { 10, 90 });
-
- setDisplayHeaderInfo(MonitorUIPlugin.getShowHeaderPreference());
- loadAvailableViewers();
- }
-
- protected Viewer getDefaultViewer(String name) {
- if (name == null)
- return null;
-
- String name2 = name.toLowerCase();
- if (name2.endsWith(".xml"))
- return findViewer("org.eclipse.wst.internet.monitor.viewers.xml");
- else if (name2.endsWith(".html"))
- return findViewer("org.eclipse.wst.internet.monitor.viewers.browser");
- else if (name2.endsWith(".gif") || name2.endsWith(".jpg") ||
- name2.endsWith(".jpeg") || name2.endsWith(".png"))
- return findViewer("org.eclipse.wst.internet.monitor.viewers.image");
- else
- return findViewer("org.eclipse.wst.internet.monitor.viewers.byte");
- }
-
- protected Viewer findViewer(String id) {
- if (id == null)
- return null;
-
- Iterator iterator = viewers.iterator();
- while (iterator.hasNext()) {
- Viewer viewer = (Viewer) iterator.next();
- if (id.equals(viewer.getId()))
- return viewer;
- }
- return null;
- }
-
- private void loadAvailableViewers() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorUIPlugin.PLUGIN_ID, "viewers");
- int size = cf.length;
- viewers = new ArrayList<Viewer>(size);
- for (IConfigurationElement ce : cf)
- viewers.add(new Viewer(ce));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.view.IViewerManager#setDisplayHeaderInfo(boolean)
- */
- public void setDisplayHeaderInfo(boolean b) {
- displayHeaderInf = b;
- reqHeader.setDisplayHeader(b);
- respHeader.setDisplayHeader(b);
- reqSash.setSimpleLayout(b);
- respSash.setSimpleLayout(b);
- reqSash.layout(true);
- respSash.layout(true);
-
- MonitorUIPlugin.setShowHeaderPreference(b);
- if (b) {
- reqHeader.setEditable(false);
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.TRANSPORT) == null) {
- reqHeader.setEditable(true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.view.IViewerManager#getDisplayHeaderInfo()
- */
- public boolean getDisplayHeaderInfo() {
- return displayHeaderInf;
- }
-
- public void setRequest(Request rr) {
- // maintain the state of the request and request header if they've been modified.
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.ALL) == null) {
- ResendHTTPRequest resRequest = (ResendHTTPRequest) request;
- //EditableContentViewer editViewer = (ContentViewer) reqViewer;
- byte[] content = reqViewer.getContent();
- byte[] b = resRequest.getRequest(Request.CONTENT);
- if (content != null && b != null && !MonitorUIPlugin.parse(b).equals(MonitorUIPlugin.parse(content))) {
- resRequest.setRequest(content, Request.CONTENT);
- }
- byte[] header = reqHeader.getContent();
- b = resRequest.getRequest(Request.TRANSPORT);
- if (header != null && b != null && !MonitorUIPlugin.parse(b).equals(MonitorUIPlugin.parse(header))) {
- resRequest.setRequest(header, Request.TRANSPORT);
- }
- }
- reqHeader.setRequestResponse(rr);
- respHeader.setRequestResponse(rr);
- byte[] b = null;
- if (rr != null)
- b = filter(rr.getRequest(Request.CONTENT));
- reqViewer.setContent(b);
- b = null;
- if (rr != null)
- b = filter(rr.getResponse(Request.CONTENT));
- respViewer.setContent(b);
- request = rr;
-
- // set the editor to editable if the request hasn't been sent and the
- // editor can be set as editable
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.ALL) == null) {
- if (displayHeaderInf)
- reqHeader.setEditable(true);
-
- reqViewer.setEditable(true);
- } else {
- if (displayHeaderInf)
- reqHeader.setEditable(false);
-
- reqViewer.setEditable(false);
- }
- }
-
- public void addFilter(IContentFilter filter) {
- filters.add(filter);
- setRequest(request);
- }
-
- public void removeFilter(IContentFilter filter) {
- filters.remove(filter);
- setRequest(request);
- }
-
- protected byte[] filter(byte[] b) {
- if (b == null)
- return null;
- Iterator iterator = filters.iterator();
- while (iterator.hasNext()) {
- IContentFilter filter = (IContentFilter) iterator.next();
- try {
- b = filter.filter(request, false, b);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error while filtering with " + filter.getId(), e);
- }
- }
- return b;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#getRequestViewers()
- */
- public List getRequestViewers() {
- Iterator iterator = viewers.iterator();
- List<Viewer> temp = new ArrayList<Viewer>();
- while (iterator.hasNext()) {
- Viewer viewer = (Viewer) iterator.next();
- if (viewer.isRequestViewer())
- temp.add(viewer);
- }
- return temp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#getResponseViewers()
- */
- public List getResponseViewers() {
- Iterator iterator = viewers.iterator();
- List<Viewer> temp = new ArrayList<Viewer>();
- while (iterator.hasNext()) {
- Viewer viewer = (Viewer) iterator.next();
- if (viewer.isResponseViewer())
- temp.add(viewer);
- }
- return temp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#setRequestViewer(java.lang.String)
- */
- public void setRequestViewer(Viewer viewer) {
- if (viewer != null && viewer.equals(requestViewer))
- return;
-
- // call set request to save and reset the request
- setRequest(request);
- reqViewer.dispose();
-
- requestViewer = viewer;
- if (viewer != null)
- reqViewer = viewer.createViewer();
- else
- reqViewer = null;
- if (reqViewer == null)
- return;
-
- reqViewer.init(reqComp);
- //reqViewer.setRequestResponse(rr);
- byte[] b = null;
- if (request != null) {
- b = filter(request.getRequest(Request.CONTENT));
- // set the editor to editable if the request hasn't been sent and the
- // editor can be set as editable
- if (request instanceof ResendHTTPRequest && request.getResponse(Request.TRANSPORT) == null) {
- reqViewer.setEditable(true);
- } else {
- reqViewer.setEditable(false);
- }
- }
- reqViewer.setContent(b);
- reqComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#setResponseViewer(java.lang.String)
- */
- public void setResponseViewer(Viewer viewer) {
- if (viewer != null && viewer.equals(responseViewer))
- return;
- respViewer.dispose();
-
- responseViewer = viewer;
- if (viewer != null)
- respViewer = viewer.createViewer();
- else
- respViewer = null;
- if (respViewer == null)
- return;
-
- respViewer.init(respComp);
- //respViewer.setRequestResponse(rr);
- byte[] b = null;
- if (request != null)
- b = filter(request.getResponse(Request.CONTENT));
- respViewer.setContent(b);
- respComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.internal.view.IViewerManager#getCurrentRequestViewer()
- */
- public ContentViewer getCurrentRequestViewer() {
- return reqViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.internal.view.IViewerManager#getCurrentRequestHeaderViewer()
- */
- public HeaderViewer getCurrentRequestHeaderViewer() {
- return reqHeader;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/BrowserViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/BrowserViewer.java
deleted file mode 100644
index 5b7a361..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/BrowserViewer.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.wst.internet.monitor.ui.internal.Messages;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-/**
- * A browser viewer.
- */
-public class BrowserViewer extends ContentViewer {
- protected static final byte CR = '\r';
- protected static final byte LF = '\n';
-
- protected Browser browser;
-
- protected byte[] content;
-
- /** (non-Javadoc)
- * @see ContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- browser = new Browser(parent, SWT.NONE);
- browser.addListener(SWT.MenuDetect, new Listener() {
- public void handleEvent(Event event) {
- event.doit = false;
- }
- });
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#setContent(byte[])
- */
- public void setContent(byte[] b) {
- content = b;
- if (b == null || b.length == 0) {
- browser.setText(Messages.htmlViewInvalid);
- } else {
- b = MonitorUIPlugin.unzip(b);
-
- int trimFront = 0;
- int trimBack = 0;
- int len = b.length - 1;
- while (trimFront < b.length && (b[trimFront] == CR || b[trimFront] == LF))
- trimFront++;
- while (trimBack < b.length && b.length > 0 && (b[len - trimBack] == CR || b[len - trimBack] == LF))
- trimBack++;
-
- if (trimFront + trimBack > 0) {
- if (trimFront + trimBack > b.length) {
- b = new byte[0];
- } else {
- byte[] temp = b;
- b = new byte[temp.length - trimBack - trimFront];
- for (int i = trimFront; i < temp.length - trimBack; i++) {
- b[i - trimFront] = temp[i];
- }
- }
- }
- browser.setText(new String(b));
- }
- }
-
- /**
- * @see ContentViewer#getContent()
- */
- public byte[] getContent() {
- return content;
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#dispose()
- */
- public void dispose() {
- browser.dispose();
- browser = null;
- content = null;
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java
deleted file mode 100644
index 3082e7c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-/**
- * A basic byte viewer.
- */
-public class ByteViewer extends ContentViewer {
- protected Text text;
-
- /** (non-Javadoc)
- * @see ContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = parent.getDisplay();
- text.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- text.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- text.setFont(JFaceResources.getTextFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(text, ContextIds.VIEW_RESPONSE);
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#setEditable(boolean)
- */
- public void setEditable(boolean editable) {
- text.setEditable(editable);
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#getContent()
- */
- public byte[] getContent() {
- if (text == null)
- return new byte[0];
-
- String content = text.getText().trim();
- if (content.equals(""))
- return new byte[0];
-
- // Need to ensure that there is a newline at the end of the content
- // getBytes() removes the newline
- byte[] twoNewlines = new byte[] { '\015', '\012' };
- byte[] contentBytes = content.getBytes();
- byte[] retBytes = new byte[contentBytes.length + 2];
- System.arraycopy(contentBytes, 0, retBytes, 0, contentBytes.length);
- System.arraycopy(twoNewlines, 0, retBytes, contentBytes.length, 2);
- return retBytes;
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#setContent(byte[])
- */
- public void setContent(byte[] b) {
- String out = "";
- if (b != null) {
- b = MonitorUIPlugin.unzip(b);
- out = MonitorUIPlugin.parse(b);
- }
-
- String lineSeparator = System.getProperty("line.separator");
- int ls = lineSeparator.length();
- if (out.length() > ls) {
- while (out.substring(0, ls).indexOf(lineSeparator) >= 0)
- out = out.substring(ls, out.length());
- }
-
- text.setText(out);
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#dispose()
- */
- public void dispose() {
- text.dispose();
- text = null;
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java
deleted file mode 100644
index ec4f4cf..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.core.internal.provisional.Request;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.Messages;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.custom.MonitorStackLayout;
-/**
- * An transport (header) viewer.
- */
-public class HeaderViewer {
- protected boolean displayHeader;
-
- protected Composite headerComp;
- protected MonitorStackLayout layout;
-
- protected Label headerLabel;
- protected Text headerText;
- protected Request rr;
- protected byte msg;
-
- protected boolean hidden;
-
- /**
- * Request header constant.
- */
- public static byte REQUEST_HEADER = 0;
-
- /**
- * Response header constant.
- */
- public static byte RESPONSE_HEADER = 1;
-
- /**
- * Create a new header viewer.
- *
- * @param parent
- * @param message
- */
- public HeaderViewer(Composite parent, byte message) {
- displayHeader = true;
- hidden = false;
-
- headerComp = new Composite(parent, SWT.NONE);
- layout = new MonitorStackLayout();
- headerComp.setLayout(layout);
-
- headerText = new Text(headerComp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = headerComp.getDisplay();
- headerText.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- headerText.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- headerText.setFont(JFaceResources.getTextFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(headerText, ContextIds.VIEW_RESPONSE);
-
- headerLabel = new Label(headerComp, SWT.NONE);
-
- layout.topControl = headerText;
-
- rr = null;
- msg = message;
-
- setDisplayHeader(false);
- }
-
- /**
- *
- * @param request
- */
- public void setRequestResponse(Request request) {
- rr = request;
- if (!hidden)
- getView();
- }
-
- /**
- *
- * @param b
- */
- public void setDisplayHeader(boolean b) {
- if (displayHeader != b) {
- displayHeader = b;
-
- if (displayHeader)
- layout.topControl = headerText;
- else
- layout.topControl = headerLabel;
-
- headerComp.layout(true);
- getView();
- }
- }
-
- private void getView() {
- String out = "";
- if (rr != null) {
- if (msg == REQUEST_HEADER) {
- byte[] b = rr.getRequest(Request.TRANSPORT);
- if (b != null)
- out = MonitorUIPlugin.parse(b);
- } else if (msg == RESPONSE_HEADER) {
- byte[] b = rr.getResponse(Request.TRANSPORT);
- if (b != null)
- out = MonitorUIPlugin.parse(b);
- }
- }
-
- if (displayHeader)
- headerText.setText(out);
- else {
- String lineSeparator = System.getProperty("line.separator");
- int index = out.indexOf(lineSeparator);
- if (index > 0)
- headerLabel.setText(NLS.bind(Messages.headerLabel, out.substring(0, index)));
- else
- headerLabel.setText(NLS.bind(Messages.headerLabel, out));
- }
- }
-
- /**
- * Dispose the header.
- */
- public void dispose() {
- headerComp.dispose();
- }
-
- /**
- * Set whether the header can be edited.
- *
- * @param editable If true the header can be edited, otherwise the header cannot be edited.
- */
- public void setEditable(boolean editable) {
- headerText.setEditable(editable);
- }
-
- /**
- * Get the content from the header.
- *
- * @return The content from the header.
- */
- public byte[] getContent() {
- if (headerText == null || headerText.isDisposed())
- return null;
-
- String header = headerText.getText().trim();
- // Need to ensure that the following 4 bytes end the header. The getBytes()
- // method removes spaces at the end of the string.
- byte[] twoNewlines = new byte[] { '\015', '\012', '\015', '\012' };
- byte[] headerBytes = header.getBytes();
- byte[] retBytes = new byte[headerBytes.length + 4];
- System.arraycopy(headerBytes, 0, retBytes, 0, headerBytes.length);
- System.arraycopy(twoNewlines, 0, retBytes, headerBytes.length, 4);
- return retBytes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java
deleted file mode 100644
index a8d4dbd..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.internet.monitor.ui.internal.Messages;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-/**
- * An image viewer.
- */
-public class ImageViewer extends ContentViewer {
- protected static final byte CR = '\r';
- protected static final byte LF = '\n';
-
- protected ScrolledComposite scroll;
- protected Label messageLabel;
-
- protected byte[] content;
-
- /** (non-Javadoc)
- * @see ContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- scroll = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- messageLabel = new Label(scroll, SWT.NONE);
- messageLabel.setText(Messages.imageViewInvalid);
- messageLabel.setFont(parent.getFont());
- messageLabel.setSize(messageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- scroll.setContent(messageLabel);
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#setContent(byte[])
- */
- public void setContent(byte[] b) {
- content = b;
- if (b == null || b.length == 0) {
- messageLabel.setImage(null);
- } else {
- b = MonitorUIPlugin.unzip(b);
-
- int trimFront = 0;
- int trimBack = 0;
- int len = b.length - 1;
- while (trimFront < b.length && b[trimFront] == CR || b[trimFront] == LF)
- trimFront++;
- while (trimBack < b.length && b[len - trimBack] == CR || b[len - trimBack] == LF)
- trimBack++;
-
- if (trimFront + trimBack > 0) {
- if (trimFront + trimBack > b.length) {
- b = new byte[0];
- } else {
- byte[] temp = b;
- b = new byte[temp.length - trimBack - trimFront];
- for (int i = trimFront; i < temp.length - trimBack; i++) {
- b[i - trimFront] = temp[i];
- }
- }
- }
-
- try {
- ImageData imgD = new ImageData(new ByteArrayInputStream(b));
- Image img = new Image(null, imgD);
- messageLabel.setImage(img);
- } catch(Exception e) {
- messageLabel.setImage(null);
- messageLabel.setText(Messages.imageViewInvalid);
- }
- }
-
- messageLabel.setSize(messageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- }
-
- /**
- * @see ContentViewer#getContent()
- */
- public byte[] getContent() {
- return content;
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#dispose()
- */
- public void dispose() {
- scroll.dispose();
- scroll = null;
- messageLabel = null;
- content = null;
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java
deleted file mode 100644
index 36bce7f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM 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
- *
- * 2005-11-25 Arthur Ryman, ryman@ca.ibm.com
- * - fixed bug 118102: set xmlTagMissing correctly each time setContent() is called
- *******************************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import java.io.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.Messages;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-/**
- * XML Viewer.
- */
-public class XMLViewer extends ContentViewer {
- protected Composite viewerComp;
- protected StackLayout layout;
- protected Text messageText;
- protected Label messageLabel;
-
- protected boolean xmlTagMissing = false;
- protected boolean setEncoding = false;
- protected boolean missingEncoding = false;
- protected String originalEncoding;
-
- protected byte[] content;
-
- /** (non-Javadoc)
- * @see ContentViewer#setContent(byte[])
- */
- public void setContent(byte[] b) {
- content = b;
- String out = "";
- if (b != null) {
- b = MonitorUIPlugin.unzip(b);
- out = MonitorUIPlugin.parse(b);
- }
-
- String lineSeparator = System.getProperty("line.separator");
- int ls = lineSeparator.length();
- if (out.length() > ls) {
- while (out.substring(0, ls).indexOf(lineSeparator) >= 0)
- out = out.substring(ls, out.length());
- }
-
- String out_temp = out.toLowerCase();
- xmlTagMissing = !out_temp.startsWith("<?xml");
-
- if (out.length() > 0) {
- String finalMsg = null;
- try {
- byte[] b1 = createDocument(out);
- finalMsg = new String(b1).trim();
- } catch (Exception e) {
- // case: error parsing
- messageText.setVisible(false);
- layout.topControl = messageLabel;
- messageLabel.setVisible(true);
- messageLabel.setText(Messages.xmlViewInvalid);
- return;
- }
- if (xmlTagMissing && (finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\"?>")
- || finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>")
- || finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>"))) {
- int x = finalMsg.indexOf(">") + 1;
- //remove <?xml version="1.0" encoding="UTF-8"?>
- String Msg = finalMsg.substring(x);
- //remove starting newlines
- while (Msg.substring(0, ls).indexOf(lineSeparator) >= 0){
- Msg = Msg.substring(ls, Msg.length());
- }
- finalMsg = Msg;
-
- messageText.setText(finalMsg);
- } else if (setEncoding) {
- // change back to original encoding
- int begin = finalMsg.toLowerCase().indexOf("utf-8"); // location of opening "
- if (begin >= 0) {
- int last = begin + 5; // location of closing "
- String first_half = finalMsg.substring(0,begin);
- String second_half = finalMsg.substring(last);
- finalMsg = first_half + originalEncoding + second_half;
- }
-
- messageText.setText(finalMsg);
- } else if (missingEncoding) {
- // remove encoding completely
- int begin = finalMsg.toLowerCase().indexOf("encoding=\"utf-8\""); //location of opening "
- int last = begin + 16; //location of closing "
- String first_half = finalMsg.substring(0,begin);
- String second_half = finalMsg.substring(last);
- finalMsg = first_half + second_half;
-
- messageText.setText(finalMsg);
- } else
- messageText.setText(finalMsg);
- } else
- messageText.setText(out);
-
- messageLabel.setVisible(false);
- layout.topControl = messageText;
- messageText.setVisible(true);
- }
-
- /**
- * @see ContentViewer#getContent()
- */
- public byte[] getContent() {
- return content;
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- viewerComp = new Composite(parent, SWT.NONE);
- layout = new StackLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- viewerComp.setLayout(layout);
-
- messageText = new Text(viewerComp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = viewerComp.getDisplay();
- messageText.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- messageText.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- messageText.setFont(JFaceResources.getTextFont());
- messageText.setVisible(true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(messageText, ContextIds.VIEW_RESPONSE);
-
- messageLabel = new Label(viewerComp, SWT.NONE);
- messageLabel.setVisible(false);
-
- layout.topControl = messageText;
- }
-
- /* (non-Javadoc)
- * @#createDocument(String)
- */
- protected byte[] createDocument(String str) throws IOException {
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- factory.setAttribute("http://apache.org/xml/features/allow-java-encodings", new Boolean(true));
- factory.setAttribute("http://apache.org/xml/features/continue-after-fatal-error", new Boolean(true));
- } catch (Exception e) {
- // ignore
- }
- DocumentBuilder parser = factory.newDocumentBuilder();
-
- if (xmlTagMissing) {
- str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + str;
- } else {
- String str_temp = str.toLowerCase();
-
- // if encoding present, then save original encoding and change to UTF-8
- int ind = str_temp.indexOf("encoding=");
- if (ind >= 0) {
- String temp1 = str.substring(ind);
- int beginIndex = temp1.indexOf("\"") + 1;
- String temp2 = temp1.substring(beginIndex);
- int endIndex = temp2.indexOf("\"");
- originalEncoding = temp2.substring(0, endIndex);
- if (!"utf-8".equals(originalEncoding))
- setEncoding = true;
- } else if (ind < 0) { //if no encoding at all,then no changes to be made
- setEncoding = false;
- missingEncoding = true;
- }
- }
- byte[] parseArray = str.getBytes();
- Document document = parser.parse(new InputSource(new ByteArrayInputStream(parseArray)));
- return getContents(document);
- } catch (Exception e) {
- throw new IOException("Invalid XML");
- }
- }
-
- protected byte[] getContents(Document document) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- Result result = new StreamResult(out);
- Source source = new DOMSource(document);
- try {
- TransformerFactory tf = TransformerFactory.newInstance();
- try {
- tf.setAttribute("indent-number", new Integer(2));
- } catch (Exception e) {
- e.printStackTrace();
- // ignore - fails on JDK 1.4
- }
- Transformer transformer = tf.newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.STANDALONE, "no"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (TransformerConfigurationException e) {
- throw (IOException) (new IOException().initCause(e));
- } catch (TransformerException e) {
- throw (IOException) (new IOException().initCause(e));
- }
- return out.toByteArray();
- }
-
- /** (non-Javadoc)
- * @see ContentViewer#dispose()
- */
- public void dispose() {
- viewerComp.dispose();
- viewerComp = null;
- content = null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties b/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties
deleted file mode 100644
index 6a48576..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM 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
-###############################################################################
-pluginName=TCP/IP Monitor
-providerName=Eclipse.org
-
-extensionPointViewers=Viewers
-
-viewTitle=TCP/IP Monitor
-actionResend=Resend request
-actionModify=Modify request
-actionModifyResend=Send Modified Request
-
-byteView=Byte
-imageView=Image
-xmlView=XML
-browserView=Web Browser
-
-preferenceTitle=TCP/IP Monitor
-preferenceKeywords=debug
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml b/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml
deleted file mode 100644
index 383610e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
-
-<extension-point name="%extensionPointViewers" id="viewers" schema="schema/viewers.exsd"/>
-
-<extension point="org.eclipse.wst.internet.monitor.core.internalStartup">
- <startup
- id="org.eclipse.wst.internet.monitor.ui"
- class="org.eclipse.wst.internet.monitor.ui.internal.Startup"/>
-</extension>
-
-<extension point="org.eclipse.ui.views">
- <view
- id="org.eclipse.wst.internet.monitor.view"
- name="%viewTitle"
- category="org.eclipse.debug.ui"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.MonitorView"
- icon="icons/cview16/monitorView.gif">
- </view>
-</extension>
-
-<extension point="org.eclipse.ui.preferencePages">
- <page
- id="org.eclipse.wst.internet.monitor.preferencePage"
- name="%preferenceTitle"
- category="org.eclipse.debug.ui.DebugPreferencePage"
- class="org.eclipse.wst.internet.monitor.ui.internal.MonitorPreferencePage">
- <keywordReference id="org.eclipse.wst.internet.monitor.preferenceKeywords"/>
- </page>
-</extension>
-
-<extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords"
- id="org.eclipse.wst.internet.monitor.preferenceKeywords"/>
-</extension>
-
-<extension point="org.eclipse.wst.internet.monitor.ui.viewers">
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.byte"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.ByteViewer"
- type="requestresponse"
- label="%byteView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.image"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.ImageViewer"
- type="requestresponse"
- label="%imageView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.xml"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.XMLViewer"
- type="requestresponse"
- label="%xmlView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.browser"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.BrowserViewer"
- type="requestresponse"
- label="%browserView"/>
-</extension>
-
-<extension point="org.eclipse.core.runtime.adapters">
- <factory
- class="org.eclipse.wst.internet.monitor.ui.internal.RequestAdapterFactory"
- adaptableType="org.eclipse.wst.internet.monitor.core.internal.provisional.Request">
- <adapter type="org.eclipse.ui.IActionFilter"/>
- </factory>
-</extension>
-
-<extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.wst.internet.monitor.core.internal.provisional.Request"
- id="org.eclipse.wst.internet.monitor.ui.modifyaction">
- <filter name="requestsent" value="true"/>
- <action
- label="%actionResend"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.ResendMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.ResendMessageAction"
- icon="icons/elcl16/resendRequest.gif">
- </action>
- <action
- label="%actionModify"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.ModifyMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.ModifyMessageAction"
- icon="icons/etool16/editRequest.gif">
- </action>
- </objectContribution>
- <objectContribution
- objectClass="org.eclipse.wst.internet.monitor.core.internal.provisional.Request"
- id="org.eclipse.wst.internet.monitor.ui.sendmodifyaction">
- <filter name="requestsent" value="false"/>
- <action
- label="%actionModifyResend"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.SendModifiedMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.SendModifiedMessageAction"
- icon="icons/elcl16/resendRequest.gif">
- </action>
- </objectContribution>
-</extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd b/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd
deleted file mode 100644
index 6d76378..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.ui" id="viewers" name="Content Viewers"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a viewer for a specific type of content. (e.g. a viewer for a particular image format)
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="viewer" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="viewer">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer</samp>. Viewers instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the content viewer
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- [issue: what is this used for?]
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content viewer extension point:
-
-<pre>
- <extension
- point="org.eclipse.wst.internet.monitor.ui.viewers">
- <viewer
- id="com.example.byteviewer"
- class="com.example.ByteContentViewer"
- type="requestresponse"
- label="%byteView"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <code>org.eclipse.wst.internet.monitor.ui.internal.provisional.ContentViewer</code>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/.project b/plugins/org.eclipse.wst.server.core/.project
index bf1e7ef..7593f12 100644
--- a/plugins/org.eclipse.wst.server.core/.project
+++ b/plugins/org.eclipse.wst.server.core/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.core.prefs
index 2920850..ceff3f3 100644
--- a/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,77 +1,87 @@
-#Thu Sep 13 15:25:06 EDT 2007
-eclipse.preferences.version=1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+#Tue Mar 09 16:20:32 EST 2010
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.incompatibleJDKLevel=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=error
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled
-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.maxProblemPerUnit=1000
-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=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=error
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-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.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.incompatibleJDKLevel=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.builder.duplicateResourceTask=error
+org.eclipse.jdt.core.compiler.problem.fieldHiding=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+eclipse.preferences.version=1
org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
diff --git a/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.ui.prefs
index a7cc1d0..fc7e3c7 100644
--- a/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.ui.prefs
+++ b/plugins/org.eclipse.wst.server.core/.settings/org.eclipse.jdt.ui.prefs
@@ -1,3 +1,10 @@
-#Fri Feb 23 21:11:52 EST 2007
+#Tue Mar 09 16:20:35 EST 2010
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.ondemandthreshold=4
+org.eclipse.jdt.ui.staticondemandthreshold=4
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.gettersetter.use.is=true
eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\n<templates/>
+org.eclipse.jdt.ui.keywordthis=false
diff --git a/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF
index 702a393..23e3bc5 100644
--- a/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.server.core; singleton:=true
-Bundle-Version: 1.1.13.qualifier
+Bundle-Version: 1.1.204.qualifier
Bundle-Activator: org.eclipse.wst.server.core.internal.ServerPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.wst.server.core/plugin.properties b/plugins/org.eclipse.wst.server.core/plugin.properties
index 7dda41d..e0d08e7 100644
--- a/plugins/org.eclipse.wst.server.core/plugin.properties
+++ b/plugins/org.eclipse.wst.server.core/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM 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
@@ -14,6 +14,7 @@
extensionPointServerStartup=Server Startup
extensionPointModuleTypes=Module Types
extensionPointRuntimeTypes=Runtime Types
+extensionPointRuntimeModuleType=Runtime Module Types
extensionPointRuntimeTargetHandlers=Runtime Target Handlers
extensionPointRuntimeLocators=Runtime Locators
extensionPointServerTypes=Server Types
@@ -24,10 +25,10 @@
extensionPointClients=Clients
extensionPointPublishTasks=Publish Tasks
extensionPointPublishers=Publishers
+extensionPointPublishController=Publish Controller
extensionPointServerMonitors=Server Monitors
extensionPointInstallableServers=Installable Servers
extensionPointInstallableRuntimes=Installable Runtimes
-extensionPointSaveEditorPrompter=Save Editor Prompter
extensionPointRuntimeFacetComponentProviders=Runtime Facet Component Providers
diff --git a/plugins/org.eclipse.wst.server.core/plugin.xml b/plugins/org.eclipse.wst.server.core/plugin.xml
index 10a1fcf..344f9cc 100644
--- a/plugins/org.eclipse.wst.server.core/plugin.xml
+++ b/plugins/org.eclipse.wst.server.core/plugin.xml
@@ -14,12 +14,12 @@
<extension-point id="clients" name="%extensionPointClients" schema="schema/clients.exsd"/>
<extension-point id="publishTasks" name="%extensionPointPublishTasks" schema="schema/publishTasks.exsd"/>
<extension-point id="publishers" name="%extensionPointPublishers" schema="schema/publishers.exsd"/>
+ <extension-point id="publishController" name="%extensionPointPublishController" schema="schema/publishController.exsd"/>
<extension-point id="internalServerMonitors" name="%extensionPointServerMonitors" schema="schema/serverMonitors.exsd"/>
<extension-point id="internalStartup" name="%extensionPointServerStartup" schema="schema/startup.exsd"/>
- <extension-point id="installableServers" name="%extensionPointInstallableServers" schema="schema/installableServers.exsd"/>
<extension-point id="installableRuntimes" name="%extensionPointInstallableRuntimes" schema="schema/installableRuntimes.exsd"/>
<extension-point id="runtimeFacetComponentProviders" name="%extensionPointRuntimeFacetComponentProviders" schema="schema/runtimeFacetComponentProviders.exsd"/>
- <extension-point id="saveEditorPrompter" name="%extensionPointSaveEditorPrompter" schema="schema/saveEditorPrompter.exsd"/>
+ <extension-point id="runtimeModuleType" name="%runtimeModuleType" schema="schema/runtimeModuleType.exsd"/>
<extension point="org.eclipse.wst.server.core.moduleTypes">
<moduleType
@@ -35,4 +35,10 @@
id="org.eclipse.wst.server.core.default"
class="org.eclipse.wst.server.core.internal.facets.RuntimeBridge"/>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <modifier
+ class="org.eclipse.wst.server.core.internal.ServerPreferenceModifyListener">
+ </modifier>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd b/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd
index e01e92b..2dfa416 100644
--- a/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/installableRuntimes.exsd
@@ -138,6 +138,20 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="archiveSize" type="string">
+ <annotation>
+ <documentation>
+ anticipated size of the archive in bytes for progress monitor use
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="fileCount" type="string">
+ <annotation>
+ <documentation>
+ anticipated number of files in the archive for progress monitor use
+ </documentation>
+ </annotation>
+ </attribute>
<attribute name="licenseUrl" type="string">
<annotation>
<documentation>
diff --git a/plugins/org.eclipse.wst.server.core/schema/installableServers.exsd b/plugins/org.eclipse.wst.server.core/schema/installableServers.exsd
deleted file mode 100644
index f7e2708..0000000
--- a/plugins/org.eclipse.wst.server.core/schema/installableServers.exsd
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="installableServers" name="Installable Servers"/>
- </appInfo>
- <documentation>
- This extension point is used to install new server adapters from remote update manager sites.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="installableServer" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="installableServer">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name" deprecated="true"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- a translatable name used to identify the runtime type
- </documentation>
- <appInfo>
- <meta.attribute translatable="true" deprecated="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- a translatable description of the runtime type
- </documentation>
- <appInfo>
- <meta.attribute translatable="true" deprecated="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="vendor" type="string">
- <annotation>
- <documentation>
- a translatable vendor name
- </documentation>
- <appInfo>
- <meta.attribute deprecated="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="version" type="string">
- <annotation>
- <documentation>
- a translatable version number
- </documentation>
- <appInfo>
- <meta.attribute deprecated="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="featureId" type="string" use="required">
- <annotation>
- <documentation>
- the id of the feature containing the server adapter bundle
- </documentation>
- </annotation>
- </attribute>
- <attribute name="featureVersion" type="string" use="required">
- <annotation>
- <documentation>
- the version of the feature containing the server adapter bundle
- </documentation>
- </annotation>
- </attribute>
- <attribute name="featureSite" type="string" use="required">
- <annotation>
- <documentation>
- the feature (update manager) site URL
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of an installable server extension point:
-
-<pre>
- <extension
- point="org.eclipse.wst.server.core.installableServers">
- <installableServer
- id="com.myserver.id"
- name="My runtime name"
- description="My runtime description"
- vendor="xyz"
- version="1.0"
- featureVersion="1.0.0"
- featureId="com.myfeature"
- featureSite="xyz"/>
- </extension>
-</pre>
- </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) 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/publishController.exsd b/plugins/org.eclipse.wst.server.core/schema/publishController.exsd
new file mode 100644
index 0000000..b1f6ddb
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.core/schema/publishController.exsd
@@ -0,0 +1,152 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.server.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.wst.server.core" id="publishController" name="Publish Controller"/>
+ </appInfo>
+ <documentation>
+ This extension point is used to have granual control of the publish action of a server.
+
+<b>Provisional API:</b>
+This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="publishController" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="publishController">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a unique identifier for this extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="typeIds" type="string" use="required">
+ <annotation>
+ <documentation>
+ a comma separated list of server type ids that this task may apply to. Used for memory & performance reasons
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ a translatable name used to identify this PublishController
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string" use="required">
+ <annotation>
+ <documentation>
+ a translatable description of the PublishController
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.server.core.model.PublishControllerDelegate</samp>.
+PublishController instances of this type will delegate to instances of this class.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.PublishControllerDelegate:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="order" type="string" use="required">
+ <annotation>
+ <documentation>
+ an integer that specifies the order that the publisher is processed. if the value is less than 0 it will be processed before calling the server behaviour delegate's publishing methods, and may modify the workspace. if the value is more than 0, it will be called after the server behaviour delegate's publishing methods and may not modify the workspace
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 3.2
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ The following is an example of a PublishController extension point:
+
+<pre>
+
+</pre>
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2010 IBM Corporation and others.<br>
+All rights reserved. This program and the accompanying materials are made
+available under the terms of the Eclipse Public License v1.0 which accompanies
+this distribution, and is available at
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <code>org.eclipse.wst.server.core.model.PublishController</code>.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.server.core/schema/saveEditorPrompter.exsd b/plugins/org.eclipse.wst.server.core/schema/runtimeModuleType.exsd
similarity index 62%
rename from plugins/org.eclipse.wst.server.core/schema/saveEditorPrompter.exsd
rename to plugins/org.eclipse.wst.server.core/schema/runtimeModuleType.exsd
index aeafbb7..f97ac9d 100644
--- a/plugins/org.eclipse.wst.server.core/schema/saveEditorPrompter.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/runtimeModuleType.exsd
@@ -3,10 +3,13 @@
<schema targetNamespace="org.eclipse.wst.server.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
- <meta.schema plugin="org.eclipse.wst.server.core" id="saveEditorPrompter" name="%saveEditorPrompter"/>
+ <meta.schema plugin="org.eclipse.wst.server.core" id="runtimeModuleType" name="Runtime Module type"/>
</appInfo>
<documentation>
- This is an internal extension point that should only be adopted by org.eclipse.wst.server.core. It is used to transfer the control to the UI and save all the editors are open before continuing
+ This extension point is used to provide a supported ModuleType for a Runtime
+
+<b>Provisional API:</b>
+This class/interface/extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
</documentation>
</annotation>
@@ -18,7 +21,7 @@
</annotation>
<complexType>
<sequence>
- <element ref="saveEditorPrompter"/>
+ <element ref="runtimeModuleType" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
@@ -47,23 +50,42 @@
</complexType>
</element>
- <element name="saveEditorPrompter">
+ <element name="runtimeModuleType">
<complexType>
- <attribute name="id" type="string" use="required">
+ <sequence>
+ <element ref="moduleType" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="runtimeTypes" type="string" use="required">
<annotation>
<documentation>
-
+ specifies a comma separated list of the unique identifier of the runtimeTypes that supports this module
</documentation>
</annotation>
</attribute>
- <attribute name="class" type="string" use="required">
+ <attribute name="id" type="string" use="required">
<annotation>
<documentation>
-
+ specifies a unique identifier for this extension point
</documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.internal.SaveEditorPrompter:"/>
- </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="moduleType">
+ <complexType>
+ <attribute name="types" type="string" use="required">
+ <annotation>
+ <documentation>
+ a comma separated list of the module types that this runtime supports
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="versions" type="string" use="required">
+ <annotation>
+ <documentation>
+ a comma separated list of the module versions that this runtime supports
+ </documentation>
</annotation>
</attribute>
</complexType>
@@ -74,7 +96,7 @@
<meta.section type="since"/>
</appInfo>
<documentation>
- [Enter the first release in which this extension point appears.]
+ 3.2
</documentation>
</annotation>
diff --git a/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd b/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd
index b296f1b..b6dd595 100644
--- a/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/runtimeTypes.exsd
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.server.core">
+<schema targetNamespace="org.eclipse.wst.server.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="org.eclipse.wst.server.core" id="runtimeTypes" name="Runtime Types"/>
@@ -11,6 +11,11 @@
</annotation>
<element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
<complexType>
<sequence>
<element ref="runtimeType" minOccurs="1" maxOccurs="unbounded"/>
@@ -104,7 +109,7 @@
Runtime instances of this type will delegate to instances of this class. Delegates must also have a public 0-arg constructor.
</documentation>
<appInfo>
- <meta.attribute kind="java"/>
+ <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.RuntimeDelegate"/>
</appInfo>
</annotation>
</attribute>
@@ -179,23 +184,6 @@
</documentation>
</annotation>
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <code>org.eclipse.wst.server.core.model.RuntimeDelegate</code> and contains a public 0-arg constructor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
<annotation>
<appInfo>
@@ -210,4 +198,13 @@
</documentation>
</annotation>
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <code>org.eclipse.wst.server.core.model.RuntimeDelegate</code> and contains a public 0-arg constructor.
+ </documentation>
+ </annotation>
+
</schema>
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java
index db7209b..7aad1e3 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IModule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM 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
@@ -41,13 +41,8 @@
* (optional) project attribute is equal.
* </p>
* <p>This interface is not intended to be implemented by clients.</p>
- * <p>
- * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
*
+ * @noimplement
* @since 1.0
*/
public interface IModule extends IAdaptable {
@@ -97,6 +92,16 @@
public boolean isExternal();
/**
+ * Returns <code>true</code> if the module exists (e.g. is in the workspace)
+ * and <code>false</code> otherwise (e.g. if the module has been deleted).
+ *
+ * @return <code>true</code> if the module exists,
+ * and <code>false</code> otherwise
+ * @since 1.1
+ */
+ public boolean exists();
+
+ /**
* Returns an object which is an instance of the given class
* associated with this object. Returns <code>null</code> if
* no such object can be found, or if the delegate is not
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java
index 0418174..4ff9ab8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM 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
@@ -69,6 +69,7 @@
*
* <p>This interface is not intended to be implemented by clients.</p>
*
+ * @noimplement
* @since 1.0
*/
public interface IServer extends IServerAttributes, ISchedulingRule {
@@ -467,7 +468,9 @@
/**
* Synchronously restarts this server. This operation does
* nothing if this server cannot be stopped ({@link #canRestart(String)}
- * returns <code>false</code>.
+ * returns <code>false</code>. Restarting the server may cause a publish
+ * during the start if necessary and according to the server definition.
+ *
* This method cannot be used to start the server from a stopped state.
* <p>
* If the caller wants to listen for failure or success of the
@@ -488,7 +491,8 @@
/**
* Asynchronously restarts this server. This operation does
* nothing if this server cannot be stopped ({@link #canRestart(String)}
- * returns <code>false</code>.
+ * returns <code>false</code>. Restarting the server may cause a publish
+ * during the start if necessary and according to the server definition.
* This method cannot be used to start the server from a stopped state.
* <p>
* The operation listener can be used to add a listener for notification
@@ -606,10 +610,41 @@
* reporting and cancellation are not desired
* @return a status object with code <code>IStatus.OK</code> if the module can
* be restarted, otherwise a status object indicating why it can't
+ * @deprecated
*/
public IStatus canControlModule(IModule[] module, IProgressMonitor monitor);
/**
+ * Returns whether the given module can be restarted.
+ * <p>
+ * This method has a progress monitor because it may involve plugin
+ * and class loading. No communication to the server will occur.
+ * </p>
+ *
+ * @param module the module
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @return a status object with code <code>IStatus.OK</code> if the module can
+ * be restarted, otherwise a status object indicating why it can't
+ */
+ public IStatus canRestartModule(IModule[] module, IProgressMonitor monitor);
+
+ /**
+ * Returns whether the given module can be published.
+ * <p>
+ * This method has a progress monitor because it may involve plugin
+ * and class loading. No communication to the server will occur.
+ * </p>
+ *
+ * @param module the module
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @return a status object with code <code>IStatus.OK</code> if the module can
+ * be published, otherwise a status object indicating why it can't
+ */
+ public IStatus canPublishModule(IModule[] module, IProgressMonitor monitor);
+
+ /**
* Asynchronously starts this server in the given launch mode.
* <p>
* If canStart(launchMode) is false, this method will throw an
@@ -691,7 +726,7 @@
*
* @return the launch used to start the currently running server, or <code>null</code>
* if the launch is unavailable or could not be found
- * @since 3.0
+ * @since 1.1
*/
public ILaunch getLaunch();
@@ -699,7 +734,7 @@
* Returns the start timeout in seconds.
*
* @return the start timeout in seconds
- * @since 3.0
+ * @since 1.1
*/
public int getStartTimeout();
@@ -707,7 +742,7 @@
* Returns the stop timeout in seconds.
*
* @return the stop timeout in seconds
- * @since 3.0
+ * @since 1.1
*/
public int getStopTimeout();
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java
index 28b883c..3ada0f9 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerAttributes.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM 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
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.wst.server.core;
+import java.util.List;
+import java.util.Map;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.*;
/**
@@ -298,6 +301,46 @@
public IStatus canModifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor);
/**
+ * Get the server attribute value that is stored in this server attribute object.
+ * @param attributeName name of the attribute that is being queried.
+ * @param defaultValue the default value if the given attribute is not defined.
+ * @return the value of the given attribute.
+ */
+ public int getAttribute(String attributeName, int defaultValue);
+
+ /**
+ * Get the server attribute value that is stored in this server attribute object.
+ * @param attributeName name of the attribute that is being queried.
+ * @param defaultValue the default value if the given attribute is not defined.
+ * @return the value of the given attribute.
+ */
+ public boolean getAttribute(String attributeName, boolean defaultValue);
+
+ /**
+ * Get the server attribute value that is stored in this server attribute object.
+ * @param attributeName name of the attribute that is being queried.
+ * @param defaultValue the default value if the given attribute is not defined.
+ * @return the value of the given attribute.
+ */
+ public String getAttribute(String attributeName, String defaultValue);
+
+ /**
+ * Get the server attribute value that is stored in this server attribute object.
+ * @param attributeName name of the attribute that is being queried.
+ * @param defaultValue the default value if the given attribute is not defined.
+ * @return the value of the given attribute.
+ */
+ public List<String> getAttribute(String attributeName, List<String> defaultValue);
+
+ /**
+ * Get the server attribute value that is stored in this server attribute object.
+ * @param attributeName name of the attribute that is being queried.
+ * @param defaultValue the default value if the given attribute is not defined.
+ * @return the value of the given attribute.
+ */
+ public Map getAttribute(String attributeName, Map defaultValue);
+
+ /**
* Returns the child module(s) of this module. If this
* module contains other modules, it should list those
* modules. If not, it should return an empty list.
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java
index d58a88f..2851734 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/IServerWorkingCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM 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
@@ -11,6 +11,9 @@
package org.eclipse.wst.server.core;
import java.beans.PropertyChangeListener;
+import java.util.List;
+import java.util.Map;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -226,6 +229,46 @@
public void setRuntime(IRuntime runtime);
/**
+ * Set the server attribute value that is stored in the server working copy. Throws
+ * {@link IllegalArgumentException} if the attribute can't be modified
+ * @param attributeName name of the attribute that needs to be modified.
+ * @param value the new value of the given attribute.
+ */
+ public void setAttribute(String attributeName, int value);
+
+ /**
+ * Set the server attribute value that is stored in the server working copy. Throws
+ * {@link IllegalArgumentException} if the attribute can't be modified
+ * @param attributeName name of the attribute that needs to be modified.
+ * @param value the new value of the given attribute.
+ */
+ public void setAttribute(String attributeName, boolean value);
+
+ /**
+ * Set the server attribute value that is stored in the server working copy. Throws
+ * {@link IllegalArgumentException} if the attribute can't be modified
+ * @param attributeName name of the attribute that needs to be modified.
+ * @param value the new value of the given attribute.
+ */
+ public void setAttribute(String attributeName, String value);
+
+ /**
+ * Set the server attribute value that is stored in the server working copy. Throws
+ * {@link IllegalArgumentException} if the attribute can't be modified
+ * @param attributeName name of the attribute that needs to be modified.
+ * @param value the new value of the given attribute.
+ */
+ public void setAttribute(String attributeName, List<String> value);
+
+ /**
+ * Set the server attribute value that is stored in the server working copy. Throws
+ * {@link IllegalArgumentException} if the attribute can't be modified
+ * @param attributeName name of the attribute that needs to be modified.
+ * @param value the new value of the given attribute.
+ */
+ public void setAttribute(String attributeName, Map value);
+
+ /**
* Changes the host for the server.
* The format of the host can be either a qualified or unqualified hostname,
* or an IP address and must conform to RFC 2732.
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java
index 66b6f0f..d226f33 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerCore.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -13,6 +13,7 @@
import java.util.*;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.*;
import org.eclipse.wst.server.core.internal.*;
/**
@@ -458,9 +459,20 @@
*
* @return <code>true</code> if the preference is set to automatically
* publish when starting servers, or <code>false</code> otherwise
- * @since 3.0
+ * @since 1.1
*/
public static boolean isAutoPublishing() {
return ServerPreferences.getInstance().isAutoPublishing();
}
+
+ public static boolean isPublishRequired(IServer server, IResourceDelta delta2) {
+ PublishController[] controllers = ServerPlugin.getPublishController();
+ if (controllers.length > 0){
+ for (PublishController controller : controllers){
+ if (controller.supportsType(server.getServerType().getId()))
+ return controller.isPublishRequired(server, delta2);
+ }
+ }
+ return true;
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java
index 55b1f13..ac021cb 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerEvent.java
@@ -220,4 +220,19 @@
public IServer getServer() {
return server;
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString(){
+ return "<Server-Event"
+ + " id="+this.hashCode()
+ + " kind="+getKind()
+ + " server="+getServer()
+ + " module="+getModule()
+ + " state="+getState()
+ + " publishState="+getPublishState()
+ + " restartState="+getRestartState()
+ + ">";
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java
index 20f8363..51b30c8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/ServerUtil.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -88,7 +88,7 @@
throw new IllegalArgumentException();
// use a set for better contains() performance
- Set<IModule> set = new HashSet<IModule>();
+ List<IModule> list = new ArrayList<IModule>();
ModuleFactory[] factories = ServerPlugin.getModuleFactories();
if (factories != null) {
@@ -96,15 +96,13 @@
IModule[] modules = factory.getModules(project, null);
if (modules != null) {
for (IModule module : modules) {
- if (!set.contains(module))
- set.add(module);
+ if (!list.contains(module))
+ list.add(module);
}
}
}
}
- IModule[] modules = new IModule[set.size()];
- set.toArray(modules);
- return modules;
+ return list.toArray(new IModule[list.size()]);
}
/**
@@ -376,15 +374,37 @@
* @param runtime a runtime
*/
public static void setRuntimeDefaultName(IRuntimeWorkingCopy runtime) {
+ setRuntimeDefaultName(runtime, -1);
+ }
+
+ /**
+ * Sets a default name on the given runtime.
+ *
+ * @param runtime
+ * a runtime
+ * @param suffix
+ * the numbering to start at for the suffix, if suffix is -1, then the no suffix name will be tried first.
+ * @return the suffix it found no name conflicts at and is using as part of
+ * the default name
+ */
+ public static int setRuntimeDefaultName(IRuntimeWorkingCopy runtime, int suffix) {
String typeName = runtime.getRuntimeType().getName();
-
- String name = NLS.bind(Messages.defaultRuntimeName, typeName);
- int i = 2;
+
+ String name = null;
+ if (suffix == -1) {
+ name = NLS.bind(Messages.defaultRuntimeName, typeName);
+ // Start next suffix from 2 to preserve the original behaviour before this change.
+ suffix = 2;
+ } else {
+ name = NLS.bind(Messages.defaultRuntimeName2, new String[] { typeName, suffix + "" });
+ }
+
while (ServerPlugin.isNameInUse(runtime.getOriginal(), name)) {
- name = NLS.bind(Messages.defaultRuntimeName2, new String[] {typeName, i + ""});
- i++;
+ suffix++;
+ name = NLS.bind(Messages.defaultRuntimeName2, new String[] { typeName, suffix + "" });
}
runtime.setName(name);
+ return suffix;
}
/**
@@ -401,7 +421,7 @@
// base the name on the runtime if it exists and has been changed from the default
IRuntime runtime = server.getRuntime();
- if (runtime != null) {
+ if (runtime != null && !(runtime instanceof RuntimeWorkingCopy)) {
IRuntimeWorkingCopy wc = runtime.createWorkingCopy();
setRuntimeDefaultName(wc);
if (!wc.getName().equals(runtime.getName()))
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java
index b26dbc9..4c4c3d3 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/DeletedModule.java
@@ -76,6 +76,10 @@
return false;
}
+ public boolean exists() {
+ return false;
+ }
+
public String toString() {
return "DeletedModule[" + name + "," + id + "]";
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IInstallableServer.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IInstallableServer.java
deleted file mode 100644
index 0d92beb..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/IInstallableServer.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * Represents an installable server adapter.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
-public interface IInstallableServer {
- /**
- * Returns the id of this runtime type.
- * Each known server runtime type has a distinct id.
- * Ids are intended to be used internally as keys; they are not
- * intended to be shown to end users.
- *
- * @return the runtime type id
- */
- public String getId();
-
- /**
- * Returns the displayable name for this runtime type.
- * <p>
- * Note that this name is appropriate for the current locale.
- * </p>
- *
- * @return a displayable name for this runtime type
- */
- public String getName();
-
- /**
- * Returns the displayable description for this runtime type.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable description for this runtime type
- */
- public String getDescription();
-
- /**
- * Returns the displayable vendor name for this runtime type. If the
- * runtime type did not specific a vendor, an empty string is returned.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable vendor name for this runtime type
- */
- public String getVendor();
-
- /**
- * Returns the displayable version name for this runtime type. If the
- * runtime type did not specific a vendor, an empty string is returned.
- * <p>
- * Note that this description is appropriate for the current locale.
- * </p>
- *
- * @return a displayable version name for this runtime type
- */
- public String getVersion();
-
- /**
- * Downloads the license from the update site.
- *
- * @param monitor a progress monitor
- * @return the license
- * @throws CoreException
- */
- public String getLicense(IProgressMonitor monitor) throws CoreException;
-
- /**
- * Install this server.
- *
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @throws CoreException if an exception occurs while creating this runtime
- * or setting it's default values
- */
- public void install(IProgressMonitor monitor) throws CoreException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime2.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime2.java
index e1b31b3..8b4769e 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime2.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableRuntime2.java
@@ -19,6 +19,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
+import java.util.zip.GZIPInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -34,6 +35,10 @@
private IConfigurationElement element;
private byte[] BUFFER = null;
+ // Default sizes (infinite logarithmic progress will be used when default is employed)
+ private int DEFAULT_DOWNLOAD_SIZE = 10000000;
+ private int DEFAULT_FILE_COUNT = 1000;
+
public InstallableRuntime2(IConfigurationElement element) {
super();
this.element = element;
@@ -73,6 +78,26 @@
return null;
}
+ public int getArchiveSize() {
+ try {
+ String size = element.getAttribute("archiveSize");
+ return Integer.parseInt(size);
+ } catch (Exception e) {
+ // ignore
+ }
+ return -1;
+ }
+
+ public int getFileCount() {
+ try {
+ String size = element.getAttribute("fileCount");
+ return Integer.parseInt(size);
+ } catch (Exception e) {
+ // ignore
+ }
+ return -1;
+ }
+
public String getLicenseURL() {
try {
return element.getAttribute("licenseUrl");
@@ -96,7 +121,7 @@
url = new URL(licenseURL);
InputStream in = url.openStream();
out = new ByteArrayOutputStream();
- copy(in, out);
+ copyWithSize(in, out, null, 0);
return new String(out.toByteArray());
} catch (Exception e) {
Trace.trace(Trace.WARNING, "Error loading license", e);
@@ -135,12 +160,43 @@
installRuntimeJob.schedule();
}
- private void copy(InputStream in, OutputStream out) throws IOException {
+ private void copyWithSize(InputStream in, OutputStream out, IProgressMonitor monitor, int size) throws IOException {
if (BUFFER == null)
BUFFER = new byte[8192];
+ SubMonitor progress = SubMonitor.convert(monitor, size);
int r = in.read(BUFFER);
while (r >= 0) {
out.write(BUFFER, 0, r);
+ progress.worked(r);
+ r = in.read(BUFFER);
+ }
+ }
+
+ private void download(InputStream in, OutputStream out, IProgressMonitor monitor, String name, int size) throws IOException {
+ if (BUFFER == null)
+ BUFFER = new byte[8192];
+
+ String msg = NLS.bind((size > 0) ? Messages.taskDownloadSizeKnown : Messages.taskDownloadSizeUnknown,
+ new Object [] { name, "{0}", Integer.toString(size / 1024) });
+ SubMonitor progress = SubMonitor.convert(monitor, NLS.bind(msg, "0"), (size > 0) ? size : DEFAULT_DOWNLOAD_SIZE);
+
+ int r = in.read(BUFFER);
+ int total = 0;
+ int lastTotal = 0;
+ while (r >= 0) {
+ out.write(BUFFER, 0, r);
+ total += r;
+ if (total >= lastTotal + 8192) {
+ lastTotal = total;
+ progress.subTask(NLS.bind(msg, Integer.toString(lastTotal / 1024)));
+ }
+ progress.worked(r);
+ // if size is not known, use infinite logarithmic progress
+ if (size <= 0)
+ progress.setWorkRemaining(DEFAULT_DOWNLOAD_SIZE);
+
+ if (progress.isCanceled())
+ break;
r = in.read(BUFFER);
}
}
@@ -149,6 +205,7 @@
* @see IInstallableRuntime#install(IPath, IProgressMonitor)
*/
public void install(IPath path, IProgressMonitor monitor) throws CoreException {
+ SubMonitor progress = SubMonitor.convert(monitor, 1000);
URL url = null;
File temp = null;
try {
@@ -156,19 +213,29 @@
temp = File.createTempFile("runtime", "");
temp.deleteOnExit();
} catch (IOException e) {
+ if (monitor != null)
+ monitor.done();
Trace.trace(Trace.WARNING, "Error creating url and temp file", e);
throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorInstallingServer, e.getLocalizedMessage()), e));
}
String name = url.getPath();
+ int slashIdx = name.lastIndexOf('/');
+ if (slashIdx >= 0)
+ name = name.substring(slashIdx + 1);
+
+ int archiveSize = getArchiveSize();
// download
FileOutputStream fout = null;
try {
InputStream in = url.openStream();
fout = new FileOutputStream(temp);
- copy(in, fout);
+ download(in, fout, progress.newChild(500), name, archiveSize);
+ progress.setWorkRemaining(500);
} catch (Exception e) {
+ if (monitor != null)
+ monitor.done();
Trace.trace(Trace.WARNING, "Error downloading runtime", e);
throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorInstallingServer, e.getLocalizedMessage()), e));
@@ -180,14 +247,35 @@
// ignore
}
}
+ if (progress.isCanceled())
+ throw new CoreException(Status.CANCEL_STATUS);
FileInputStream in = null;
try {
in = new FileInputStream(temp);
if (name.endsWith("zip"))
- unzip(in, path, monitor);
+ unzip(in, path, progress.newChild(500));
else if (name.endsWith("tar"))
- untar(in, path, monitor);
+ untar(in, path, progress.newChild(500));
+ else if (name.endsWith("tar.gz")) {
+ File tarFile = File.createTempFile("runtime", ".tar");
+ tarFile.deleteOnExit();
+ String tarName = name;
+ if (slashIdx >= 0)
+ tarName = name.substring(0, name.length() - 3);
+
+ progress.subTask(NLS.bind(Messages.taskUncompressing, tarName));
+ int tempSize = Integer.MAX_VALUE;
+ if (temp.length() < Integer.MAX_VALUE)
+ tempSize = (int)temp.length();
+
+ ungzip(in, tarFile, progress.newChild(250), tempSize);
+ progress.setWorkRemaining(250);
+ if (!progress.isCanceled()) {
+ in = new FileInputStream(tarFile);
+ untar(in, path, progress.newChild(250));
+ }
+ }
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error uncompressing runtime", e);
throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
@@ -199,6 +287,7 @@
} catch (IOException e) {
// ignore
}
+ progress.done();
}
}
@@ -211,13 +300,15 @@
* @throws IOException
*/
private void unzip(InputStream in, IPath path, IProgressMonitor monitor) throws IOException {
+ int fileCnt = getFileCount();
+ SubMonitor progress = SubMonitor.convert(monitor, (fileCnt > 0) ? fileCnt : DEFAULT_FILE_COUNT);
String archivePath = getArchivePath();
BufferedInputStream bin = new BufferedInputStream(in);
ZipInputStream zin = new ZipInputStream(bin);
ZipEntry entry = zin.getNextEntry();
while (entry != null) {
String name = entry.getName();
- monitor.setTaskName("Unzipping: " + name);
+ progress.subTask(NLS.bind(Messages.taskUncompressing, name));
if (archivePath != null && name.startsWith(archivePath)) {
name = name.substring(archivePath.length());
if (name.length() > 1)
@@ -229,8 +320,11 @@
path.append(name).toFile().mkdirs();
else {
FileOutputStream fout = new FileOutputStream(path.append(name).toFile());
- copy(zin, fout);
+ copyWithSize(zin, fout, progress.newChild(1), (int)entry.getSize());
fout.close();
+ // if count is not known, use infinite logarithmic progress
+ if (fileCnt <= 0)
+ progress.setWorkRemaining(DEFAULT_FILE_COUNT);
}
}
zin.closeEntry();
@@ -248,13 +342,15 @@
* @throws IOException
*/
protected void untar(InputStream in, IPath path, IProgressMonitor monitor) throws IOException {
+ int fileCnt = getFileCount();
+ SubMonitor progress = SubMonitor.convert(monitor, (fileCnt > 0) ? fileCnt : 500);
String archivePath = getArchivePath();
BufferedInputStream bin = new BufferedInputStream(in);
TarInputStream zin = new TarInputStream(bin);
TarEntry entry = zin.getNextEntry();
while (entry != null) {
String name = entry.getName();
- monitor.setTaskName("Untarring: " + name);
+ progress.subTask(NLS.bind(Messages.taskUncompressing, name));
if (archivePath != null && name.startsWith(archivePath)) {
name = name.substring(archivePath.length());
if (name.length() > 1)
@@ -265,17 +361,47 @@
if (entry.getFileType() == TarEntry.DIRECTORY)
path.append(name).toFile().mkdirs();
else {
+ File dir = path.append(name).removeLastSegments(1).toFile();
+ if (!dir.exists())
+ dir.mkdirs();
+
FileOutputStream fout = new FileOutputStream(path.append(name).toFile());
- copy(zin, fout);
+ copyWithSize(zin, fout, progress.newChild(1), (int)entry.getSize());
fout.close();
+ if (fileCnt <= 0)
+ progress.setWorkRemaining(500);
}
}
- zin.close();
entry = zin.getNextEntry();
}
zin.close();
}
+ protected void ungzip(InputStream in, File tarFile, IProgressMonitor monitor, int size) throws IOException {
+ GZIPInputStream gzin = null;
+ FileOutputStream fout = null;
+ try {
+ gzin = new GZIPInputStream(in);
+ fout = new FileOutputStream(tarFile);
+ copyWithSize(gzin, fout, monitor, size);
+ } finally {
+ if (gzin != null) {
+ try {
+ gzin.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ if (fout != null) {
+ try {
+ fout.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ }
+
public String toString() {
return "InstallableRuntime2[" + getId() + "]";
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java
deleted file mode 100644
index fd93a7f..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.core.internal;
-
-import java.net.ConnectException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.update.core.IFeature;
-import org.eclipse.update.core.ISite;
-import org.eclipse.update.core.ISiteFeatureReference;
-import org.eclipse.update.core.IURLEntry;
-import org.eclipse.update.standalone.InstallCommand;
-import org.osgi.framework.Version;
-/**
- *
- */
-public class InstallableServer implements IInstallableServer {
- private IConfigurationElement element;
-
- public InstallableServer(IConfigurationElement element) {
- super();
- this.element = element;
- }
-
- /**
- *
- * @return the id
- */
- public String getId() {
- try {
- return element.getAttribute("id");
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- *
- * @return the name
- */
- public String getName() {
- try {
- return element.getAttribute("name");
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- *
- * @return the description
- */
- public String getDescription() {
- try {
- return element.getAttribute("description");
- } catch (Exception e) {
- return null;
- }
- }
-
- public String getVendor() {
- try {
- String vendor = element.getAttribute("vendor");
- if (vendor != null)
- return vendor;
- } catch (Exception e) {
- // ignore
- }
- return Messages.defaultVendor;
- }
-
- public String getVersion() {
- try {
- String version = element.getAttribute("version");
- if (version != null)
- return version;
- } catch (Exception e) {
- // ignore
- }
- return Messages.defaultVersion;
- }
-
- public String getFeatureVersion() {
- try {
- return element.getAttribute("featureVersion");
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- public String getFeatureId() {
- try {
- return element.getAttribute("featureId");
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- public String getFromSite() {
- try {
- return element.getAttribute("featureSite");
- } catch (Exception e) {
- // ignore
- }
- return null;
- }
-
- /*
- * @see IInstallableServer#getLicense(IProgressMonitor)
- */
- public String getLicense(IProgressMonitor monitor) throws CoreException {
- String featureId = getFeatureId();
- String featureVersion = getFeatureVersion();
- String fromSite = getFromSite();
-
- if (featureId == null || featureVersion == null || fromSite == null)
- return null;
-
- ISite site = InstallableRuntime.getSite(fromSite, monitor);
- ISiteFeatureReference[] featureRefs = site.getFeatureReferences();
- for (int i = 0; i < featureRefs.length; i++) {
- String ver = featureRefs[i].getVersionedIdentifier().toString();
- int ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- if (featureId.equals(featureRefs[i].getVersionedIdentifier().getIdentifier()) && featureVersion.equals(ver)) {
- IFeature feature = featureRefs[i].getFeature(monitor);
- IURLEntry license = feature.getLicense();
- if (license != null)
- return license.getAnnotation();
- return null;
- }
- }
- return null;
- }
-
- public IFeature getFeature(IProgressMonitor monitor) {
- String featureId = getFeatureId();
- String featureVersion = getFeatureVersion();
- String fromSite = getFromSite();
-
- if (featureId == null || featureVersion == null || fromSite == null)
- return null;
-
- monitor.beginTask("Searching " + fromSite, 100);
- int mirror = 0;
- ISite site = InstallableRuntime.getSite(fromSite, ProgressUtil.getSubMonitorFor(monitor, 50));
- if (site == null)
- return null;
- fromSite = InstallableRuntime.getMirror(fromSite, site, mirror);
-
- Version latestVersion = new Version(featureVersion);
- ISiteFeatureReference last = null;
- try {
- ISiteFeatureReference[] features = site.getFeatureReferences();
- for (int i = 0; i < features.length; i++) {
- if (features[i].getVersionedIdentifier().getIdentifier().equals(featureId)) {
- String ver = features[i].getVersionedIdentifier().toString();
- int ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- Version nextCand = new Version(ver);
- if (nextCand.compareTo(latestVersion) >= 0) {
- latestVersion = nextCand;
- last = features[i];
- }
- }
- }
- if (last != null)
- return last.getFeature(ProgressUtil.getSubMonitorFor(monitor, 50));
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error searching for latest feature version", e);
- } finally {
- monitor.done();
- }
- return null;
- }
-
- /*
- * @see IInstallableServer#install(IProgressMonitor)
- */
- public void install(IProgressMonitor monitor) throws CoreException {
- String featureId = getFeatureId();
- String featureVersion = getFeatureVersion();
- String fromSite = getFromSite();
-
- if (featureId == null || featureVersion == null || fromSite == null)
- return;
-
- int mirror = 0;
- ISite site = InstallableRuntime.getSite(fromSite, monitor);
- fromSite = InstallableRuntime.getMirror(fromSite, site, mirror);
- featureVersion = getLatestVersion(site, featureVersion, featureId);
-
- boolean complete = false;
- while (!complete) {
- try {
- InstallCommand command = new InstallCommand(featureId, featureVersion, fromSite, null, "false");
- boolean b = command.run(monitor);
- if (!b)
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
- Messages.errorInstallingServerFeature, null));
- //command.applyChangesNow();
- } catch (ConnectException ce) {
- mirror++;
- fromSite = InstallableRuntime.getMirror(fromSite, site, mirror);
- if (fromSite == null)
- complete = true;
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error installing feature", e);
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
- NLS.bind(Messages.errorInstallingServer, e.getLocalizedMessage()), e));
- }
- }
-
- try {
- Thread.sleep(1000);
- } catch (Exception e) {
- // ignore
- }
- }
-
- public static String getLatestVersion(ISite site, String version, String featureId) {
- Version latestVersion = new Version(version);
- try {
- ISiteFeatureReference[] features = site.getFeatureReferences();
- for (int i = 0; i < features.length; i++) {
- if (features[i].getVersionedIdentifier().getIdentifier().equals(featureId)) {
- String ver = features[i].getVersionedIdentifier().toString();
- int ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- Version nextCand = new Version(ver);
- if (nextCand.compareTo(latestVersion) > 0) {
- latestVersion = nextCand;
- }
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error searching for latest feature version", e);
- }
-
- return latestVersion.toString();
- }
-
- public String toString() {
- return "InstallableServer[" + getId() + ", " + getName() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.java
index bc38d47..0133dc7 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -24,7 +24,6 @@
public static String defaultVendor;
public static String defaultVersion;
public static String savingTask;
- public static String taskPerforming;
public static String deletingTask;
public static String defaultServerProjectName;
public static String defaultRuntimeName;
@@ -33,7 +32,6 @@
public static String defaultServerName2;
public static String defaultServerName3;
public static String defaultServerName4;
- public static String taskModifyModules;
public static String errorWorkingCopyTimestamp;
public static String errorPublishStarting;
public static String errorPublishNoRuntime;
@@ -49,19 +47,22 @@
public static String errorStartTimeout;
public static String errorStartFailed;
public static String errorStopFailed;
+ public static String errorRestartTimeout;
public static String errorRestartFailed;
public static String errorModuleRestartFailed;
public static String errorInstallingServer;
public static String errorInstallingServerFeature;
public static String errorRestartModule;
+ public static String errorPublishModule;
public static String canStartErrorState;
public static String errorLaunchMode;
public static String errorRestartNotStarted;
public static String errorStopAlreadyStopped;
public static String moduleTypeUnknown;
- public static String jobStartingServer;
- public static String jobStoppingServer;
- public static String jobRestartingServer;
+ public static String jobStarting;
+ public static String jobStopping;
+ public static String jobRestarting;
+ public static String jobUpdatingServers;
public static String jobUpdateServer;
public static String jobInstallingRuntime;
public static String errorMissingAdapter;
@@ -78,6 +79,12 @@
public static String errorNoRuntime;
public static String errorFacet;
+ public static String taskModifyModules;
+ public static String taskPerforming;
+ public static String taskUncompressing;
+ public static String taskDownloadSizeKnown;
+ public static String taskDownloadSizeUnknown;
+
static {
NLS.initializeMessages(ServerPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.properties b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.properties
index 8f96c2e..c4ef915 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.properties
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM 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
@@ -14,7 +14,10 @@
deletingTask=Deleting {0}
taskPerforming=Performing Tasks
-taskModifyModules=Adding and/or removing projects.
+taskModifyModules=Adding and/or removing resources.
+taskUncompressing=Uncompressing: {0}
+taskDownloadSizeKnown=Downloading: {0}, received {1} of {2} kbytes
+taskDownloadSizeUnknown=Downloading: {0}, received {1} kbytes
publishing=Publishing to {0}...
publishingStatusInfo=Publishing completed with information
@@ -25,9 +28,10 @@
publishingModule=Publishing: {0}
publishedModule={0} published successfully
-jobStartingServer=Starting {0}
-jobStoppingServer=Stopping {0}
-jobRestartingServer=Restarting {0}
+jobStarting=Starting {0}
+jobStopping=Stopping {0}
+jobRestarting=Restarting {0}
+jobUpdatingServers=Updating server status
jobUpdateServer=Updating status for {0}...
jobInstallingRuntime=Installing server runtime environment
@@ -45,6 +49,7 @@
errorStartTimeout=Server {0} was unable to start within {1} seconds. If the server requires more time, try increasing the timeout in the server editor.
errorStartFailed=Server {0} failed to start.
errorStopFailed=Server {0} failed to stop.
+errorRestartTimeout=Server {0} failed to restart within {1} seconds.
errorRestartFailed=Server {0} failed to restart.
errorCannotAddModule=The server does not support version {1} of the {0} specification.
errorInstallingServer=Error occurred installing server: {0}
@@ -73,9 +78,9 @@
errorPublishNoConfiguration=Cannot publish to the server because the configuration is missing.
errorStopAlreadyStopped=The server cannot be stopped because it is already stopped or stopping.
errorRestartModule=The module cannot be restarted.
+errorPublishModule=The module cannot be published.
errorMissingAdapter=Could not load server adapter. Check to make sure that the installation is complete.
-
errorCopyingFile=Error copying file {0}: {1}
errorDeleting=Could not delete {0}. May be locked by another process.
errorMkdir=Could not create directory {0}.
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java
index 021ff97..8231056 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Module.java
@@ -244,6 +244,13 @@
return false;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.core.IModule#exists()
+ */
+ public boolean exists() {
+ return true;
+ }
+
/**
* Return a string representation of this object.
*
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleProperties.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleProperties.java
index ac0279a..ec45afd 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleProperties.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModuleProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM 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
@@ -106,7 +106,14 @@
if (serverId == null || serverId.length() == 0)
return null;
- return ServerCore.findServer(serverId);
+ IServer server = ServerCore.findServer(serverId);
+
+ // in the case that the preferred server doesn't exists in the wrks reset the attribute
+ if (server == null){
+ modules.remove(module.getId());
+ }
+
+ return server;
}
/*
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
index fec87e0..d61985e 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
@@ -319,6 +319,9 @@
try {
long time = System.currentTimeMillis();
IModuleResource[] x = pm.members();
+ if (ServerPlugin.getInstance().isDebugging())
+ printModule(x,"resources: ");
+
Trace.trace(Trace.PERFORMANCE, "Time to get members() for " + module[size - 1].getName() + ": " + (System.currentTimeMillis() - time));
return x;
} catch (CoreException ce) {
@@ -326,6 +329,23 @@
}
return EMPTY_MODULE_RESOURCE;
}
+
+ private void printModule(IModuleResource[] r, String s) {
+ for (IModuleResource mrr : r) {
+ printModule(mrr, s + " ");
+ }
+ }
+
+ private void printModule(IModuleResource r, String s) {
+ Trace.trace(Trace.RESOURCES, s + r.getName());
+ if (r instanceof IModuleFolder) {
+ IModuleFolder mf = (IModuleFolder) r;
+ IModuleResource[] mr = mf.members();
+ for (IModuleResource mrr : mr) {
+ printModule(mrr, s + " ");
+ }
+ }
+ }
protected IModuleResourceDelta[] getDelta(IModule[] module) {
if (module == null)
@@ -344,6 +364,7 @@
IModuleResource[] resources2 = null;
try {
resources2 = pm.members();
+ printModule(resources2, "delta:");
} catch (CoreException ce) {
Trace.trace(Trace.WARNING, "Possible failure in getDelta", ce);
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishController.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishController.java
new file mode 100644
index 0000000..aa1c124
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/PublishController.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.core.internal;
+
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.PublishControllerDelegate;
+/**
+ *
+ */
+public class PublishController {
+ private IConfigurationElement element;
+ private PublishControllerDelegate delegate;
+
+ /**
+ * Publisher constructor comment.
+ *
+ * @param element a configuration element
+ */
+ public PublishController(IConfigurationElement element) {
+ super();
+ this.element = element;
+ }
+
+ /*
+ * @see
+ */
+ public String getId() {
+ return element.getAttribute("id");
+ }
+
+ public String getName() {
+ return element.getAttribute("name");
+ }
+
+ public String getDescription() {
+ return element.getAttribute("description");
+ }
+
+ protected String[] getTypeIds() {
+ try {
+ return ServerPlugin.tokenize(element.getAttribute("typeIds"), ",");
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ public boolean supportsType(String id) {
+ return ServerPlugin.contains(getTypeIds(), id);
+ }
+
+ /*
+ * @see IPublisher#getDelegate()
+ */
+ public PublishControllerDelegate getDelegate() {
+ if (delegate == null) {
+ try {
+ long time = System.currentTimeMillis();
+ delegate = (PublishControllerDelegate) element.createExecutableExtension("class");
+ Trace.trace(Trace.PERFORMANCE, "PublishTask.getDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getId());
+ } catch (Throwable t) {
+ Trace.trace(Trace.SEVERE, "Could not create delegate" + toString(), t);
+ }
+ }
+ return delegate;
+ }
+
+ public boolean isPublishRequired(IServer server, IResourceDelta delta) {
+ try {
+ Trace.trace(Trace.FINEST, "Task.init " + this);
+ return getDelegate().isPublishRequired(server, delta);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error calling delegate " + toString(), e);
+ return true;
+ }
+ }
+
+
+ /**
+ * Return a string representation of this object.
+ *
+ * @return a string
+ */
+ public String toString() {
+ return "PublishController[" + getId() + "]";
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Publisher.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Publisher.java
index 9ce8781..0dbb618 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Publisher.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Publisher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM 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
@@ -10,12 +10,14 @@
*******************************************************************************/
package org.eclipse.wst.server.core.internal;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.TaskModel;
import org.eclipse.wst.server.core.model.PublisherDelegate;
/**
@@ -24,6 +26,7 @@
public class Publisher {
private IConfigurationElement element;
private PublisherDelegate delegate;
+ private boolean modifyModules = false;
/**
* Publisher constructor comment.
@@ -78,14 +81,101 @@
return delegate;
}
- public IStatus execute(int kind, IProgressMonitor monitor, IAdaptable info) throws CoreException {
- try {
- Trace.trace(Trace.FINEST, "Task.init " + this);
- return getDelegate().execute(kind, monitor, info);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString(), e);
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, "Error in delegate", e); // TODO
+ /**
+ * Should the original {@link ISchedulingRule} be changed with the new {@link ISchedulingRule}?
+ *
+ * @param originalRule
+ * The original {@link ISchedulingRule}
+ * @param newRule
+ * The new {@link ISchedulingRule}
+ * @return <code>true</code> if the new scheduling rule should be applied; Otherwise <code>false</code>.
+ */
+ private boolean changeSchedulingRule(ISchedulingRule originalRule, ISchedulingRule newRule) {
+
+ boolean changeRule = false;
+ if ((originalRule == null) && (newRule == null)) {
+ // no need to change rules if they're both null
+ changeRule = false;
}
+ else if((originalRule == null) && (newRule != null)) {
+ // there is currently no rule and a new not-null rule wants to be added
+ changeRule = true;
+ }
+ else if((originalRule != null) && (newRule == null)) {
+ // there is currently a rule and a new null rule wants to be applied
+ changeRule = true;
+ }
+ else if((originalRule != null) && (newRule != null)) {
+ // there is currently a rule and a new not-null rule wants to be applied.
+ changeRule = !originalRule.equals(newRule);
+ }
+ return changeRule;
+ }
+
+ /**
+ * rebuild the cache for the modules involved with this task.
+ */
+ private void rebuildModuleCache() {
+
+ // reset the publishing cache for the modules that are part of this task.
+ Server server = (Server) getDelegate().getTaskModel().getObject(TaskModel.TASK_SERVER);
+ if (server != null) {
+ // make sure the right server is used.
+ if(server.isWorkingCopy()) {
+ IServerWorkingCopy workingCopy = (IServerWorkingCopy)server;
+ server = (Server) workingCopy.getOriginal();
+ }
+ final List<IModule[]> moduleList = getDelegate().getModifiedModules();
+ if (moduleList != null) {
+ final Iterator<IModule[]> moduleIterator = moduleList.iterator();
+ while (moduleIterator.hasNext()) {
+ IModule[] module = moduleIterator.next();
+ if (module != null) {
+ Trace.trace(Trace.FINEST, "rebuilding cache for module: " + module[module.length - 1]);
+ server.getServerPublishInfo().rebuildCache(module);
+ }
+ }
+ }
+ }
+ }
+
+ public IStatus execute(int kind, IProgressMonitor monitor, IAdaptable info) throws CoreException {
+
+ Trace.trace(Trace.FINEST, "Task.init " + this);
+ ISchedulingRule delegatePublisherRule = null;
+ final ISchedulingRule originalPublisherRule = Job.getJobManager().currentRule();
+ IStatus resultStatus = null;
+ boolean changeSchedulingRules = false;
+ try {
+ delegatePublisherRule = getDelegate().getRule();
+ changeSchedulingRules = this.changeSchedulingRule(originalPublisherRule, delegatePublisherRule);
+ Trace.trace(Trace.FINEST, "Change the scheduling rule to execute delegate: " + changeSchedulingRules);
+ if (changeSchedulingRules) {
+ Trace.trace(Trace.FINEST, "Ending the current scheduling rule " + originalPublisherRule);
+ Job.getJobManager().endRule(originalPublisherRule);
+ Trace.trace(Trace.FINEST, "Beginning the new scheduling rule: " + delegatePublisherRule);
+ Job.getJobManager().beginRule(delegatePublisherRule, monitor);
+ }
+ resultStatus = getDelegate().execute(kind, monitor, info);
+ this.modifyModules = getDelegate().isModifyModules();
+ Trace.trace(Trace.FINEST, "The publisher delegate stated that it modified modules: " + this.modifyModules);
+ if(this.modifyModules) {
+ this.rebuildModuleCache();
+ }
+ }
+ catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error calling delegate " + toString(), e);
+ resultStatus = new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, "Error in delegate", e);
+ }
+ finally {
+ if (changeSchedulingRules) {
+ Trace.trace(Trace.FINEST, "Reseting the scheduling rules... ending: " + delegatePublisherRule);
+ Job.getJobManager().endRule(delegatePublisherRule);
+ Trace.trace(Trace.FINEST, "Reseting the scheduling rules... beginning: " + originalPublisherRule);
+ Job.getJobManager().beginRule(originalPublisherRule, monitor);
+ }
+ }
+ return resultStatus;
}
public void setTaskModel(TaskModel taskModel) {
@@ -97,6 +187,16 @@
}
/**
+ * Accessor to find out if this publisher modified any modules that are published on the server.
+ *
+ * @return <code>true</code> if the publisher modified the contents of any modules that are published on the server.
+ */
+ public boolean isModifyModules() {
+
+ return this.modifyModules;
+ }
+
+ /**
* Return a string representation of this object.
*
* @return a string
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java
index 1ca7d55..2659997 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ResourceManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -61,7 +61,7 @@
private static boolean initialized;
private static boolean initializing;
- protected static List<String> serverProjects = new ArrayList<String>();
+ protected static List<String> serverProjects = new ArrayList<String>(2);
/**
* Server resource change listener.
@@ -90,7 +90,7 @@
*
* @param event a resource change event
*/
- public void resourceChanged(IResourceChangeEvent event) {
+ public void resourceChanged(final IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta == null)
return;
@@ -99,6 +99,7 @@
if (event.getBuildKind() == IncrementalProjectBuilder.CLEAN_BUILD)
return;
+ // search for changes related to Server projects
Trace.trace(Trace.RESOURCES, "->- ServerResourceChangeListener responding to resource change: " + event.getType() + " ->-");
IResourceDelta[] children = delta.getAffectedChildren();
if (children != null) {
@@ -119,7 +120,7 @@
// only respond to project changes
if (resource != null && resource instanceof IProject) {
- publishHandleProjectChange(visitorDelta);
+ publishHandleProjectChange(visitorDelta, event);
return false;
}
return true;
@@ -457,19 +458,19 @@
if (runtimeListeners.isEmpty())
return;
- synchronized (runtimeListeners) {
- for (IRuntimeLifecycleListener srl : runtimeListeners) {
- Trace.trace(Trace.LISTENERS, " Firing runtime event to " + srl);
- try {
- if (b == EVENT_ADDED)
- srl.runtimeAdded(runtime);
- else if (b == EVENT_CHANGED)
- srl.runtimeChanged(runtime);
- else
- srl.runtimeRemoved(runtime);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing runtime event to " + srl, e);
- }
+ List<IRuntimeLifecycleListener> clone = new ArrayList<IRuntimeLifecycleListener>();
+ clone.addAll(runtimeListeners);
+ for (IRuntimeLifecycleListener srl : clone) {
+ Trace.trace(Trace.LISTENERS, " Firing runtime event to " + srl);
+ try {
+ if (b == EVENT_ADDED)
+ srl.runtimeAdded(runtime);
+ else if (b == EVENT_CHANGED)
+ srl.runtimeChanged(runtime);
+ else
+ srl.runtimeRemoved(runtime);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, " Error firing runtime event to " + srl, e);
}
}
Trace.trace(Trace.LISTENERS, "-<- Done firing runtime event -<-");
@@ -484,19 +485,19 @@
if (serverListeners.isEmpty())
return;
- synchronized (serverListeners) {
- for (IServerLifecycleListener srl : serverListeners) {
- Trace.trace(Trace.LISTENERS, " Firing server event to " + srl);
- try {
- if (b == EVENT_ADDED)
- srl.serverAdded(server);
- else if (b == EVENT_CHANGED)
- srl.serverChanged(server);
- else
- srl.serverRemoved(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, " Error firing server event to " + srl, e);
- }
+ List<IServerLifecycleListener> clone = new ArrayList<IServerLifecycleListener>();
+ clone.addAll(serverListeners);
+ for (IServerLifecycleListener srl : clone) {
+ Trace.trace(Trace.LISTENERS, " Firing server event to " + srl);
+ try {
+ if (b == EVENT_ADDED)
+ srl.serverAdded(server);
+ else if (b == EVENT_CHANGED)
+ srl.serverChanged(server);
+ else
+ srl.serverRemoved(server);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, " Error firing server event to " + srl, e);
}
}
Trace.trace(Trace.LISTENERS, "-<- Done firing server event -<-");
@@ -950,14 +951,24 @@
* @param delta org.eclipse.core.resources.IResourceDelta
*/
protected void publishHandleProjectChange(IResourceDelta delta) {
+ publishHandleProjectChange(delta, null);
+ }
+
+ /**
+ * A project has changed. If this is an add or remove, check
+ * to see if it is part of a current server configuration.
+ *
+ * @param delta org.eclipse.core.resources.IResourceDelta
+ * @param buildEvent whether this event was a build event
+ */
+ protected void publishHandleProjectChange(IResourceDelta delta, IResourceChangeEvent event) {
Trace.trace(Trace.FINEST, "> publishHandleProjectChange " + delta.getResource());
IProject project = (IProject) delta.getResource();
if (project == null)
return;
- if (!deltaContainsChangedFiles(delta))
- return;
+ IServer[] servers2 = getPublishRequiredServers(delta);
// process module changes
ProjectModuleFactoryDelegate.handleGlobalProjectChange(project, delta);
@@ -967,19 +978,67 @@
return;
Trace.trace(Trace.FINEST, "- publishHandleProjectChange");
-
- IServer[] servers2 = getServers();
+
int size = modules.length;
int size2 = servers2.length;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size2; j++) {
if (servers2[j].getAdapter(ServerDelegate.class) != null)
- ((Server) servers2[j]).handleModuleProjectChange(modules[i]);
+ ((Server) servers2[j]).handleModuleProjectChange(modules[i], event);
}
}
Trace.trace(Trace.FINEST, "< publishHandleProjectChange");
}
+ private IServer[] getPublishRequiredServers(IResourceDelta delta){
+ // The list of servers that will require publish
+ final List<IServer> servers2 = new ArrayList<IServer>();
+
+ // wrksServers = Workspaces Servers
+ final IServer[] wrksServers = getServers();
+
+ try {
+ delta.accept(new IResourceDeltaVisitor() {
+ public boolean visit(IResourceDelta delta2) throws CoreException {
+ // servers2 is the same size as the list of servers in the workspace, all servers require
+ // publishing. Exit the visitor
+ if (servers2.size() == wrksServers.length)
+ return false;
+ // has this deltaResource been changed?
+ if (delta2.getKind() == IResourceDelta.NO_CHANGE)
+ return false;
+
+ if (delta2.getResource() instanceof IFile) {
+ if (delta2.getKind() == IResourceDelta.CHANGED
+ && (delta2.getFlags() & IResourceDelta.CONTENT) == 0
+ && (delta2.getFlags() & IResourceDelta.REPLACED) == 0
+ && (delta2.getFlags() & IResourceDelta.SYNC) == 0){
+ // this resource is effectively a no change
+ return true;
+ }
+ // This is a changed file.
+ // Iterate through all servers for each changed resource, if the server needs publishing
+ // for one single resource and the server is not on the list(servers2) then add it, as it
+ // will require publishing
+ for (IServer server:wrksServers){
+ if (ServerCore.isPublishRequired(server,delta2)){
+ if (!servers2.contains(server))
+ servers2.add(server);
+ }
+ }
+ return false;
+ }
+ // This is a changed folder, so visit the child elements.
+ return true;
+ }
+ });
+ } catch (Exception e) {
+ // ignore
+ }
+ //Trace.trace(Trace.FINEST, "Delta contains change: " + t.b);
+ return servers2.toArray(new IServer[0]);
+ }
+
/**
* Returns <code>true</code> if at least one file in the delta is changed,
* and <code>false</code> otherwise.
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RestartServerJob.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RestartServerJob.java
index fe0f2be..ede16ca 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RestartServerJob.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RestartServerJob.java
@@ -24,7 +24,7 @@
protected IStatus resultStatus;
public RestartServerJob(IServer server, String launchMode) {
- super(NLS.bind(Messages.jobRestartingServer, server.getName()), server);
+ super(NLS.bind(Messages.jobRestarting, server.getName()), server);
this.launchMode = launchMode;
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java
index 8c381c7..04e3bc0 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Runtime.java
@@ -63,7 +63,7 @@
try {
return getDelegate(monitor).validate();
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate validate() " + toString(), e);
+ ServerPlugin.logExtensionFailure(toString(), e);
return null;
}
}
@@ -77,11 +77,11 @@
try {
long time = System.currentTimeMillis();
delegate = ((RuntimeType) runtimeType).createRuntimeDelegate();
- InternalInitializer.initializeRuntimeDelegate(delegate, this, monitor);
- //delegate.initialize(this);
+ if (delegate != null)
+ InternalInitializer.initializeRuntimeDelegate(delegate, this, monitor);
Trace.trace(Trace.PERFORMANCE, "Runtime.getDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getRuntimeType().getId());
} catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
+ ServerPlugin.logExtensionFailure(toString(), t);
}
}
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java
index d1d1def..afa1ee8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -12,9 +12,7 @@
import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.*;
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.model.RuntimeDelegate;
/**
@@ -119,7 +117,7 @@
public IModuleType[] getModuleTypes() {
try {
if (moduleTypes == null)
- moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType"));
+ loadModuleTypes();
IModuleType[] mt = new IModuleType[moduleTypes.size()];
moduleTypes.toArray(mt);
@@ -128,6 +126,28 @@
return new IModuleType[0];
}
}
+
+ protected void loadModuleTypes(){
+ moduleTypes = ServerPlugin.getModuleTypes(element.getChildren("moduleType"));
+ ServerPlugin.loadRuntimeModuleTypes(this);
+ }
+
+ /**
+ * Adds a Loose ModuleType to this runtime
+ * @param moduleType
+ * @throws CoreException if the moduleType is null or if already added
+ */
+ public void addModuleType(IConfigurationElement cfe) throws CoreException{
+ if (cfe == null)
+ throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"<null> moduleType"));
+
+ IConfigurationElement [] childs = cfe.getChildren("moduleType");
+ if (childs.length < 1)
+ throw new CoreException(new Status(IStatus.ERROR,ServerPlugin.PLUGIN_ID,"No moduleType found for runtime"));
+
+ List<IModuleType> extraModuleTypes = ServerPlugin.getModuleTypes(childs);
+ moduleTypes.addAll(extraModuleTypes);
+ }
public boolean canCreate() {
try {
@@ -143,7 +163,6 @@
return null;
RuntimeWorkingCopy rwc = new RuntimeWorkingCopy(null, id, this);
- ServerUtil.setRuntimeDefaultName(rwc);
rwc.setDefaults(monitor);
return rwc;
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java
index f93051a..2823425 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/RuntimeWorkingCopy.java
@@ -23,6 +23,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.model.InternalInitializer;
import org.eclipse.wst.server.core.model.RuntimeDelegate;
/**
@@ -242,12 +243,13 @@
}
/**
- * Set the defaults.
+ * Set the defaults for this runtime, including the name.
*
- * @param monitor
+ * @param monitor a progress monitor, or null
*/
protected void setDefaults(IProgressMonitor monitor) {
try {
+ ServerUtil.setRuntimeDefaultName(this);
getWorkingCopyDelegate(monitor).setDefaults(monitor);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error calling delegate setDefaults() " + toString(), e);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/SaveEditorPrompter.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/SaveEditorPrompter.java
deleted file mode 100644
index 8e45842..0000000
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/SaveEditorPrompter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM 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
- *******************************************************************************/
-
-package org.eclipse.wst.server.core.internal;
-
-/**
- * <p>
- * SaveEditorPrompter is the abstract implementation of the .saveEditorPrompter extension
- * point. This class is used for prompting to the user to save all the editors. The class
- * transfer the control from the non-ui code to the UI code via an the extension point
- * </p>
- * <b>This class is not intended to be extended adopters.</b>
- *
- */
-public class SaveEditorPrompter {
-
- /**
- * Move the control to the UI and save all the editors according to <code>org.eclipse.debug.internal.ui.IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</code>
- */
- public void saveAllEditors(){
- // nothing to do, should be implemented
- }
- public void setDebugNeverSave(){
- // nothing to do, should be implemented
- }
- public void setDebugOriginalValue(){
- // nothing to do, should be implemented
- }
-}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
index 3fcd580..a74e444 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
@@ -50,7 +50,8 @@
public static final String FILE_EXTENSION = "server";
public static final int AUTO_PUBLISH_DISABLE = 1;
- public static final int AUTO_PUBLISH_ENABLE = 2;
+ public static final int AUTO_PUBLISH_RESOURCE = 2;
+ public static final int AUTO_PUBLISH_BUILD = 3;
private static String PUBLISH_AUTO_STRING = "auto";
private static String PUBLISH_CLEAN_STRING = "clean";
@@ -149,12 +150,32 @@
}
}
- public class ResourceChangeJob extends Job {
+ private abstract class ServerJob extends Job {
+ public ServerJob(String name) {
+ super(name);
+ }
+
+ public boolean belongsTo(Object family) {
+ return ServerUtil.SERVER_JOB_FAMILY.equals(family);
+ }
+
+ public IServer getServer() {
+ return Server.this;
+ }
+ }
+
+ public class ResourceChangeJob extends ServerJob {
private IModule module;
+ private IResourceChangeEvent event;
public ResourceChangeJob(IModule module) {
+ this(module, null);
+ }
+
+ public ResourceChangeJob(IModule module, IResourceChangeEvent event) {
super(NLS.bind(Messages.jobUpdateServer, Server.this.getName()));
this.module = module;
+ this.event = event;
if (module.getProject() == null)
setRule(Server.this);
@@ -167,14 +188,6 @@
}
}
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
- protected IServer getServer() {
- return Server.this;
- }
-
protected IModule getModule() {
return module;
}
@@ -183,6 +196,7 @@
final boolean[] changed = new boolean[1];
final List<IModule[]> modules2 = new ArrayList<IModule[]>();
+ // create the visitor that will reset the module publish state flag
IModuleVisitor visitor = new IModuleVisitor() {
public boolean visit(IModule[] module2) {
modules2.add(module2);
@@ -195,17 +209,21 @@
if (getModule().equals(m)) {
if (hasPublishedResourceDelta(module2)) {
changed[0] = true;
- setModulePublishState(module2, IServer.PUBLISH_STATE_INCREMENTAL);
+ int newState = getModulePublishState(module2) == IServer.PUBLISH_STATE_FULL ? IServer.PUBLISH_STATE_FULL : IServer.PUBLISH_STATE_INCREMENTAL;
+ setModulePublishState(module2, newState);
}
}
return true;
}
};
+ // run the visitor
visit(visitor, null);
- if (getServerPublishInfo().hasStructureChanged(modules2))
- setServerPublishState(IServer.PUBLISH_STATE_INCREMENTAL);
+ if (getServerPublishInfo().hasStructureChanged(modules2)) {
+ int newState = getServerPublishState() == IServer.PUBLISH_STATE_FULL ? IServer.PUBLISH_STATE_FULL : IServer.PUBLISH_STATE_INCREMENTAL;
+ setServerPublishState(newState);
+ }
if (!changed[0])
return Status.OK_STATUS;
@@ -214,17 +232,17 @@
behaviourDelegate.handleResourceChange();
if (getServerState() == IServer.STATE_STARTED)
- autoPublish();
+ autoPublish(event);
return Status.OK_STATUS;
}
}
- public class PublishJob extends Job {
- protected int kind;
- protected List<IModule[]> modules4;
- protected IAdaptable info;
- protected boolean start;
+ public final class PublishJob extends ServerJob {
+ private final int kind;
+ private final List<IModule[]> modules4;
+ private final IAdaptable info;
+ private final boolean start;
/**
* Create a new publishing job.
@@ -246,9 +264,35 @@
this.start = start;
this.info = info;
}
-
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
+
+ /**
+ * Returns the list of projects that requires to be locked during a publish.
+ * @return the list of projects
+ */
+ @SuppressWarnings("synthetic-access")
+ List<IProject> getProjectPublishLockList(IProgressMonitor monitor) {
+ final List<IProject> projectPublishLockList = new ArrayList<IProject>();
+
+ IModule[] curModules = getModules();
+ // Check empty module list since the visitModule does not handle that properly.
+ if (curModules != null && curModules.length > 0) {
+ for (IModule curModule: curModules) {
+ // Get all the affected projects during the publish.
+ visitModule(new IModule[] { curModule }, new IModuleVisitor(){
+ public boolean visit(IModule[] modules2) {
+ for (IModule curModule2 : modules2) {
+ IProject curProject = curModule2.getProject();
+ if (curProject != null) {
+ if (!projectPublishLockList.contains(curProject)) {
+ projectPublishLockList.add(curProject);
+ }
+ }
+ }
+ return true;
+ }}, monitor);
+ }
+ }
+ return projectPublishLockList;
}
protected IStatus run(IProgressMonitor monitor) {
@@ -264,11 +308,28 @@
Job.getJobManager().endRule(Server.this);
}
}
-
- // 102227 - lock entire workspace during publish
- ISchedulingRule publishRule = MultiRule.combine(new ISchedulingRule[] {
- ResourcesPlugin.getWorkspace().getRoot(), Server.this
- });
+
+ ServerDelegate curDelegate = getDelegate(monitor);
+ ISchedulingRule[] publishScheduleRules = null;
+ if (curDelegate != null && curDelegate.isUseProjectSpecificSchedulingRuleOnPublish()) {
+ // 288863 - lock only affected projects during publish
+ // Find out all the projects that contains modules added to this server for workspace lock.
+ List<IProject> curProjectPublishLockList = getProjectPublishLockList(monitor);
+
+ publishScheduleRules = new ISchedulingRule[curProjectPublishLockList.size()+1];
+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
+ publishScheduleRules[0] = Server.this;
+ int i=1;
+ for (IProject curProj : curProjectPublishLockList) {
+ publishScheduleRules[i++] = ruleFactory.modifyRule(curProj);
+ }
+ } else {
+ // 102227 - lock entire workspace during publish
+ publishScheduleRules = new ISchedulingRule[] {
+ ResourcesPlugin.getWorkspace().getRoot(), Server.this
+ };
+ }
+ ISchedulingRule publishRule = MultiRule.combine(publishScheduleRules);
try{
// 237222 - Apply the rules only when the job has started
@@ -280,7 +341,7 @@
}
}
- public class StartJob extends Job {
+ public class StartJob extends ServerJob {
protected static final byte PUBLISH_NONE = 0;
protected static final byte PUBLISH_BEFORE = 1;
protected static final byte PUBLISH_AFTER = 2;
@@ -288,57 +349,41 @@
protected String launchMode;
public StartJob(String launchMode) {
- super(NLS.bind(Messages.jobStartingServer, Server.this.getName()));
+ super(NLS.bind(Messages.jobStarting, Server.this.getName()));
this.launchMode = launchMode;
setRule(Server.this);
}
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
- public IServer getServer() {
- return Server.this;
- }
-
protected IStatus run(IProgressMonitor monitor) {
IStatus stat = startImpl(launchMode, monitor);
return stat;
}
}
- public class RestartJob extends Job {
+ public class RestartJob extends ServerJob {
protected String launchMode;
public RestartJob(String launchMode) {
- super(NLS.bind(Messages.jobRestartingServer, Server.this.getName()));
+ super(NLS.bind(Messages.jobRestarting, Server.this.getName()));
this.launchMode = launchMode;
setRule(Server.this);
}
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
protected IStatus run(IProgressMonitor monitor) {
return restartImpl(launchMode, monitor);
}
}
- public class StopJob extends Job {
+ public class StopJob extends ServerJob {
protected boolean force;
public StopJob(boolean force) {
- super(NLS.bind(Messages.jobStoppingServer, Server.this.getName()));
+ super(NLS.bind(Messages.jobStopping, Server.this.getName()));
setRule(Server.this);
this.force = force;
}
- public boolean belongsTo(Object family) {
- return ServerUtil.SERVER_JOB_FAMILY.equals(family);
- }
-
protected IStatus run(IProgressMonitor monitor) {
return stopImpl(force, monitor);
}
@@ -464,8 +509,9 @@
if (behaviourDelegate != null)
InternalInitializer.initializeServerBehaviourDelegate(behaviourDelegate, Server.this, monitor);
Trace.trace(Trace.PERFORMANCE, "Server.getBehaviourDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
-
- if (getServerState() == IServer.STATE_STARTED)
+
+ // publish only if the server is started but respect Server > Launching > PREF_AUTO_PUBLISH
+ if (getServerState() == IServer.STATE_STARTED && ServerCore.isAutoPublishing())
autoPublish();
} catch (Throwable t) {
ServerPlugin.logExtensionFailure(toString(), t);
@@ -495,7 +541,7 @@
}
public int getAutoPublishSetting() {
- return getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_ENABLE);
+ return getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_RESOURCE);
}
public int getStartTimeout() {
@@ -763,6 +809,10 @@
}
protected void handleModuleProjectChange(IModule module) {
+ handleModuleProjectChange(module, null);
+ }
+
+ protected void handleModuleProjectChange(IModule module, IResourceChangeEvent buildEvent) {
Trace.trace(Trace.FINEST, "> handleDeployableProjectChange() " + this + " " + module);
if (!isModuleDeployed(module)){
@@ -782,7 +832,7 @@
}
}
- ResourceChangeJob job = new ResourceChangeJob(module);
+ ResourceChangeJob job = new ResourceChangeJob(module, buildEvent);
job.setSystem(true);
job.setPriority(Job.BUILD);
job.schedule();
@@ -834,11 +884,21 @@
* thread if automatic publishing is currently enabled.
*/
protected void autoPublish() {
+ autoPublish(null);
+ }
+
+ protected void autoPublish(IResourceChangeEvent event) {
stopAutoPublish();
+ boolean buildOccurred = event != null && didBuildOccur(event);
+ boolean projectClosedOrDeleted = event != null && isProjectCloseOrDeleteEvent(event);
if (getAutoPublishSetting() == AUTO_PUBLISH_DISABLE)
return;
+ if( (getAutoPublishSetting() == AUTO_PUBLISH_BUILD) &&
+ !buildOccurred && !projectClosedOrDeleted)
+ return;
+
int time = getAutoPublishTime();
if (time >= 0) {
autoPublishThread = new AutoPublishThread();
@@ -848,6 +908,24 @@
autoPublishThread.start();
}
}
+
+ private boolean isProjectCloseOrDeleteEvent(IResourceChangeEvent event) {
+ int kind = event.getType();
+ if( (kind & IResourceChangeEvent.PRE_CLOSE) > 0 ||
+ (kind & IResourceChangeEvent.PRE_DELETE) > 0)
+ return true;
+ return false;
+ }
+
+ private boolean didBuildOccur(IResourceChangeEvent event) {
+ int kind = event.getBuildKind();
+ final boolean eventOccurred =
+ (kind == IncrementalProjectBuilder.INCREMENTAL_BUILD) ||
+ (kind == IncrementalProjectBuilder.FULL_BUILD) ||
+ ((kind == IncrementalProjectBuilder.AUTO_BUILD &&
+ ResourcesPlugin.getWorkspace().isAutoBuilding()));
+ return eventOccurred;
+ }
/**
* Returns the event notification manager.
@@ -1014,8 +1092,8 @@
if (getServerType().hasServerConfiguration() && configuration == null)
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorPublishNoConfiguration, null);
- if (behaviourDelegate != null)
- return behaviourDelegate.canPublish();
+ if (getBehaviourDelegate(new NullProgressMonitor()) != null)
+ return getBehaviourDelegate(new NullProgressMonitor()).canPublish();
return Status.OK_STATUS;
}
@@ -1131,9 +1209,9 @@
/*
* Publish the given modules to the server.
+ * TODO: Implementation of publishing individual modules!
*/
public void publish(final int kind, final List<IModule[]> modules2, final IAdaptable info, final IOperationListener opListener) {
- Trace.trace(Trace.FINEST, "-->-- publish() kind: <"+getPublishKindString(kind)+"> modules=" + modules2 + " -->--");
if (getServerType() == null) {
if (opListener != null)
opListener.done(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorMissingAdapter, null));
@@ -1162,6 +1240,11 @@
}
});
}
+
+ // to make the publishing dialog appear, require adaptable to covert String.class
+ // into "user" string. a bit of a kludge, but works fine for now
+ if (info != null && "user".equals(info.getAdapter(String.class)))
+ publishJob.setUser(true);
publishJob.schedule();
}
@@ -1432,8 +1515,8 @@
if (!getServerType().supportsLaunchMode(mode2))
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorLaunchMode, null);
- if (behaviourDelegate != null)
- return behaviourDelegate.canStart(mode2);
+ if (getBehaviourDelegate(new NullProgressMonitor()) != null)
+ return getBehaviourDelegate(new NullProgressMonitor()).canStart(mode2);
return Status.OK_STATUS;
}
@@ -1601,8 +1684,8 @@
if (getServerState() != STATE_STARTED)
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorRestartNotStarted, null);
- if (behaviourDelegate != null)
- return behaviourDelegate.canRestart(mode2);
+ if (getBehaviourDelegate(new NullProgressMonitor()) != null)
+ return getBehaviourDelegate(new NullProgressMonitor()).canRestart(mode2);
return Status.OK_STATUS;
}
@@ -1667,8 +1750,8 @@
if (!getServerType().supportsLaunchMode(getMode()))
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorLaunchMode, null);
- if (behaviourDelegate != null)
- return behaviourDelegate.canStop();
+ if (getBehaviourDelegate(new NullProgressMonitor()) != null)
+ return getBehaviourDelegate(new NullProgressMonitor()).canStop();
return Status.OK_STATUS;
}
@@ -1770,13 +1853,12 @@
*/
public void start(String mode2, IProgressMonitor monitor) throws CoreException {
Trace.trace(Trace.FINEST, "Starting server: " + toString() + ", launchMode: " + mode2);
+ if (getServerType() == null)
+ return;
// make sure that the delegate is loaded and the server state is correct
loadAdapter(ServerBehaviourDelegate.class, null);
- if (getServerType() == null)
- return;
-
IStatus status = publishBeforeStart(monitor,false);
if (status != null && status.getSeverity() == IStatus.ERROR){
@@ -1784,31 +1866,36 @@
return;
}
- if (ServerPlugin.isRunningGUIMode()){
- ServerPlugin.getSaveEditorHelper().saveAllEditors();
- }
-
StartJob startJob = new StartJob(mode2);
+ // 287442 - only do publish after start if the server start is successful.
+ final IProgressMonitor monitor2 = monitor;
+ startJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ IStatus resultStatus = event.getResult();
+ if (resultStatus != null && resultStatus.getSeverity() == IStatus.ERROR) {
+ // Do not launch the publish.
+ Trace.trace(Trace.INFO,"Skipping auto publish after server start since the server start failed.");
+ } else {
+ publishAfterStart(monitor2,false,null);
+ }
+ }
+ });
startJob.schedule();
-
- publishAfterStart(monitor,false,null);
-
}
/**
* @see IServer#start(String, IOperationListener)
*/
public void start(String mode2, final IOperationListener opListener) {
-
- // make sure that the delegate is loaded and the server state is correct
- loadAdapter(ServerBehaviourDelegate.class, null);
-
if (getServerType() == null) {
if (opListener != null)
opListener.done(Status.OK_STATUS);
return;
}
+ // make sure that the delegate is loaded and the server state is correct
+ loadAdapter(ServerBehaviourDelegate.class, null);
+
IStatus status = publishBeforeStart(null,false);
if (status != null && status.getSeverity() == IStatus.ERROR){
@@ -1824,11 +1911,7 @@
else
pub = StartJob.PUBLISH_BEFORE;
}
-
- if (ServerPlugin.isRunningGUIMode()){
- ServerPlugin.getSaveEditorHelper().saveAllEditors();
- }
-
+
StartJob startJob = new StartJob(mode2);
if (opListener != null && pub != StartJob.PUBLISH_AFTER) {
startJob.addJobChangeListener(new JobChangeAdapter() {
@@ -1837,19 +1920,30 @@
}
});
}
+ // 287442 - only do publish after start if the server start is successful.
+ if (pub == StartJob.PUBLISH_AFTER) {
+ startJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ IStatus resultStatus = event.getResult();
+ if (resultStatus != null && resultStatus.getSeverity() == IStatus.ERROR) {
+ // Do not launch the publish.
+ Trace.trace(Trace.INFO,"Skipping auto publish after server start since the server start failed.");
+ } else {
+ publishAfterStart(null,false,opListener);
+ }
+ }
+ });
+ }
startJob.schedule();
-
- publishAfterStart(null,false, opListener);
}
public void synchronousStart(String mode2, IProgressMonitor monitor) throws CoreException {
-
- // make sure that the delegate is loaded and the server state is correct
- loadAdapter(ServerBehaviourDelegate.class, null);
-
if (getServerType() == null)
return;
+ // make sure that the delegate is loaded and the server state is correct
+ loadAdapter(ServerBehaviourDelegate.class, monitor);
+
IStatus status = publishBeforeStart(monitor,true);
if (status != null && status.getSeverity() == IStatus.ERROR){
@@ -1857,11 +1951,20 @@
return;
}
- if (ServerPlugin.isRunningGUIMode()){
- ServerPlugin.getSaveEditorHelper().saveAllEditors();
- }
-
StartJob startJob = new StartJob(mode2);
+ // 287442 - only do publish after start if the server start is successful.
+ final IProgressMonitor monitor2 = monitor;
+ startJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ IStatus resultStatus = event.getResult();
+ if (resultStatus != null && resultStatus.getSeverity() == IStatus.ERROR) {
+ // Do not launch the publish.
+ Trace.trace(Trace.INFO,"Skipping auto publish after server start since the server start failed.");
+ } else {
+ publishAfterStart(monitor2,true,null);
+ }
+ }
+ });
startJob.schedule();
try {
@@ -1869,8 +1972,6 @@
} catch (InterruptedException e) {
Trace.trace(Trace.WARNING, "Error waiting for job", e);
}
-
- publishAfterStart(monitor,true,null);
}
/*
@@ -2052,6 +2153,10 @@
return ServerPlugin.getInstance().getTempDirectory(getId());
}
+ public IPath getTempDirectory(boolean recycle) {
+ return ServerPlugin.getInstance().getTempDirectory(getId(), recycle);
+ }
+
protected String getXMLRoot() {
return "server";
}
@@ -2088,9 +2193,9 @@
configuration = ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(configPath));
// for migration from WTP 2.0 -> WTP 3.0
- int autoPubSetting = getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_ENABLE);
+ int autoPubSetting = getAttribute(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_RESOURCE);
if (autoPubSetting == 0)
- map.put(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_ENABLE);
+ map.put(PROP_AUTO_PUBLISH_SETTING, AUTO_PUBLISH_RESOURCE);
}
protected void setInternal(ServerWorkingCopy wc) {
@@ -2124,17 +2229,9 @@
else
memento.putString(RUNTIME_ID, null);
}
-
- /*public void updateConfiguration() {
- try {
- getDelegate(null).updateConfiguration();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate updateConfiguration() " + toString(), e);
- }
- }*/
/* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IServerConfiguration#canModifyModule(org.eclipse.wst.server.core.model.IModule)
+ * @see org.eclipse.wst.server.core.IServer#canModifyModule(org.eclipse.wst.server.core.model.IModule)
*/
public IStatus canModifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) {
if ((add == null || add.length == 0) && (remove == null || remove.length == 0))
@@ -2174,6 +2271,10 @@
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, e.getMessage(), e);
}
}
+
+ public void clearModuleCache() {
+ modules = null;
+ }
/* (non-Javadoc)
* @see org.eclipse.wst.server.core.IServer#getModules()
@@ -2298,14 +2399,13 @@
try {
return getDelegate(monitor).getRootModules(module);
} catch (CoreException se) {
- //Trace.trace(Trace.FINER, "CoreException calling delegate getParentModules() " + toString(), se);
throw se;
} catch (Exception e) {
ServerPlugin.logExtensionFailure(toString(), e);
return null;
}
}
-
+
/**
* Returns whether the given module can be restarted.
*
@@ -2313,15 +2413,23 @@
* @param monitor
* @return <code>true</code> if the given module can be
* restarted, and <code>false</code> otherwise
+ * @deprecated use canRestartModule or canPublishModule
*/
- public IStatus canControlModule(IModule[] module, IProgressMonitor monitor) {
+ public IStatus canControlModule(IModule[] module, IProgressMonitor monitor) {
+ return canRestartModule(module,monitor);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.core.IServer#canRestartModule(org.eclipse.wst.server.core.IModule[], org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus canRestartModule(IModule[] module, IProgressMonitor monitor) {
if (module == null || module.length == 0)
throw new IllegalArgumentException("Module cannot be null or empty");
try {
ServerBehaviourDelegate bd = getBehaviourDelegate(monitor);
if (bd == null)
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorRestartModule, null);
- boolean b = bd.canControlModule(module);
+ boolean b = bd.canRestartModule(module);
if (b)
return Status.OK_STATUS;
} catch (Exception e) {
@@ -2329,6 +2437,25 @@
}
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorRestartModule, null);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.core.IServer#canPublishModule(org.eclipse.wst.server.core.IModule[], org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus canPublishModule(IModule[] module, IProgressMonitor monitor) {
+ if (module == null || module.length == 0)
+ throw new IllegalArgumentException("Module cannot be null or empty");
+ try {
+ ServerBehaviourDelegate bd = getBehaviourDelegate(monitor);
+ if (bd == null)
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorPublishModule, null);
+ boolean b = bd.canPublishModule(module);
+ if (b)
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ ServerPlugin.logExtensionFailure(toString(), e);
+ }
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorPublishModule, null);
+ }
/**
* Check if the given module is in sync on the server. It should
@@ -2351,43 +2478,254 @@
return false;
}
+ abstract class OperationContext {
+ public abstract void run(IProgressMonitor monitor) throws CoreException;
+ public void cancel() {
+ // do nothing
+ }
+ public abstract String getTimeoutMessage();
+ public abstract String getFailureMessage();
+ }
+ /**
+ *
+ * @param module the module that the operation applies to, or null for a server operation
+ * @param monitor cannot be null
+ * @return the status
+ */
+ protected IStatus runAndWait(final IModule[] module, OperationContext runnable, final int operationTimeout, IProgressMonitor monitor) {
+ final boolean[] notified = new boolean[1];
+ IServerListener listener = new IServerListener() {
+ public void serverChanged(ServerEvent event) {
+ int eventKind = event.getKind();
+ if ((eventKind | ServerEvent.STATE_CHANGE) != 0) {
+ if ((module == null && (eventKind | ServerEvent.SERVER_CHANGE) != 0) ||
+ (module != null && module.equals(event.getModule()) && (eventKind | ServerEvent.MODULE_CHANGE) != 0)) {
+ int state = getServerState();
+ if (state == IServer.STATE_STARTED || state == IServer.STATE_STOPPED) {
+ // notify waiter
+ synchronized (notified) {
+ try {
+ Trace.trace(Trace.FINEST, "runAndWait notify");
+ notified[0] = true;
+ notified.notifyAll();
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error notifying runAndWait", e);
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ class Timer {
+ boolean timeout;
+ boolean alreadyDone;
+ }
+ final Timer timer = new Timer();
+
+ final IProgressMonitor monitor2 = monitor;
+ Thread thread = new Thread("Server RunAndWait Timeout") {
+ public void run() {
+ try {
+ int totalTimeout = operationTimeout;
+ if (totalTimeout < 0)
+ totalTimeout = 1;
+ boolean userCancelled = false;
+ int retryPeriod = 1;
+ while (!notified[0] && totalTimeout > 0 && !userCancelled && !timer.alreadyDone) {
+ // The operationTimeout is in seconds. Therefore, each retry period have to wait for 1 sec.
+ Thread.sleep(retryPeriod * 1000);
+ if (operationTimeout > 0)
+ totalTimeout -= retryPeriod;
+ if (!notified[0] && !timer.alreadyDone && monitor2.isCanceled()) {
+ // user canceled
+ userCancelled = true;
+ if (launch != null && !launch.isTerminated())
+ launch.terminate();//TODO
+ // notify waiter
+ synchronized (notified) {
+ Trace.trace(Trace.FINEST, "runAndWait user cancelled");
+ notified[0] = true;
+ notified.notifyAll();
+ }
+ }
+ }
+ if (!userCancelled && !timer.alreadyDone && !notified[0]) {
+ // notify waiter
+ synchronized (notified) {
+ Trace.trace(Trace.FINEST, "runAndWait notify timeout");
+ if (!timer.alreadyDone && totalTimeout <= 0)
+ timer.timeout = true;
+ notified[0] = true;
+ notified.notifyAll();
+ }
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error notifying runAndWait timeout", e);
+ }
+ }
+ };
+ thread.setDaemon(true);
+ thread.start();
+
+ Trace.trace(Trace.FINEST, "runAndWait 2");
+
+ // do the operation
+ try {
+ runnable.run(monitor);
+ } catch (CoreException e) {
+ removeServerListener(listener);
+ timer.alreadyDone = true;
+ return e.getStatus();
+ }
+ if (monitor.isCanceled()) {
+ removeServerListener(listener);
+ timer.alreadyDone = true;
+ return Status.CANCEL_STATUS;
+ }
+
+ Trace.trace(Trace.FINEST, "runAndWait 3");
+
+ // wait for it! wait for it! ...
+ synchronized (notified) {
+ try {
+ while (!notified[0] && !monitor.isCanceled() && !timer.timeout
+ && !(getServerState() == IServer.STATE_STARTED || getServerState() == IServer.STATE_STOPPED)) {
+ notified.wait();
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error waiting for operation", e);
+ }
+ timer.alreadyDone = true;
+ }
+ removeServerListener(listener);
+
+ if (timer.timeout) {
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 1, NLS.bind(Messages.errorStartTimeout, new String[] { getName(), (operationTimeout / 1000) + "" }), null);
+ }
+
+ if (!monitor.isCanceled() && getServerState() == IServer.STATE_STOPPED)
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 2, NLS.bind(Messages.errorStartFailed, getName()), null);
+
+ return Status.OK_STATUS;
+ }
+
/*
* @see IServer#startModule(IModule[], IOperationListener)
*/
- public void startModule(IModule[] module, IOperationListener listener) {
+ public void startModule(final IModule[] module, final IOperationListener opListener) {
if (module == null || module.length == 0)
throw new IllegalArgumentException("Module cannot be null or empty or empty");
- try {
- getBehaviourDelegate(null).startModule(module, null);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate startModule() " + toString(), e);
+
+ Job moduleJob = new ServerJob(NLS.bind(Messages.jobStarting, module[0].getName())) {
+ protected IStatus run(IProgressMonitor monitor) {
+ return runAndWait(module, new OperationContext() {
+ public String getFailureMessage() {
+ return Messages.errorStartFailed;
+ }
+
+ public String getTimeoutMessage() {
+ return Messages.errorStartTimeout;
+ }
+
+ public void run(IProgressMonitor monitor2) throws CoreException {
+ try {
+ getBehaviourDelegate(monitor2).startModule(module, monitor2);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error calling delegate startModule() " + toString(), e);
+ throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, e.getMessage()));
+ }
+ }
+ }, getStartTimeout(), monitor);
+ }
+ };
+ if (opListener != null) {
+ moduleJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ opListener.done(event.getResult());
+ }
+ });
}
+ moduleJob.schedule();
}
/*
* @see IServer#stopModule(IModule[], IOperationListener)
*/
- public void stopModule(IModule[] module, IOperationListener listener) {
+ public void stopModule(final IModule[] module, final IOperationListener opListener) {
if (module == null || module.length == 0)
- throw new IllegalArgumentException("Module cannot be null or empty or empty");
- try {
- getBehaviourDelegate(null).stopModule(module, null);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate stopModule() " + toString(), e);
+ throw new IllegalArgumentException("Module cannot be null or empty");
+
+ Job moduleJob = new ServerJob(NLS.bind(Messages.jobStopping, module[0].getName())) {
+ protected IStatus run(IProgressMonitor monitor) {
+ return runAndWait(module, new OperationContext() {
+ public String getFailureMessage() {
+ return Messages.errorStopFailed;
+ }
+
+ public String getTimeoutMessage() {
+ return Messages.errorStopFailed;
+ }
+
+ public void run(IProgressMonitor monitor2) throws CoreException {
+ try {
+ getBehaviourDelegate(monitor2).stopModule(module, monitor2);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error calling delegate stopModule() " + toString(), e);
+ throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, e.getMessage()));
+ }
+ }
+ }, getStopTimeout(), monitor);
+ }
+ };
+ if (opListener != null) {
+ moduleJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ opListener.done(event.getResult());
+ }
+ });
}
+ moduleJob.schedule();
}
/*
* @see IServer#restartModule(IModule[], IOperationListener, IProgressMonitor)
*/
- public void restartModule(IModule[] module, IOperationListener listener) {
+ public void restartModule(final IModule[] module, final IOperationListener opListener) {
if (module == null || module.length == 0)
throw new IllegalArgumentException("Module cannot be null or empty");
- try {
- getBehaviourDelegate(null).restartModule(module, null);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate restartModule() " + toString(), e);
+
+ Job moduleJob = new ServerJob(NLS.bind(Messages.jobRestarting, module[0].getName())) {
+ protected IStatus run(IProgressMonitor monitor) {
+ return runAndWait(module, new OperationContext() {
+ public String getFailureMessage() {
+ return Messages.errorRestartFailed;
+ }
+
+ public String getTimeoutMessage() {
+ return Messages.errorRestartTimeout;
+ }
+
+ public void run(IProgressMonitor monitor2) throws CoreException {
+ try {
+ getBehaviourDelegate(monitor2).restartModule(module, monitor2);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Error calling delegate restartModule() " + toString(), e);
+ throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, e.getMessage()));
+ }
+ }
+ }, getStopTimeout() + getStartTimeout(), monitor);
+ }
+ };
+ if (opListener != null) {
+ moduleJob.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ opListener.done(event.getResult());
+ }
+ });
}
+ moduleJob.schedule();
}
/**
@@ -2581,73 +2919,26 @@
protected IStatus restartImpl(String launchMode, IProgressMonitor monitor) {
Trace.trace(Trace.FINEST, "Restarting server: " + getName());
- //final IStatus[] status2 = new IStatus[1];
-
try {
- IServerListener curListener = new IServerListener() {
- public void serverChanged(ServerEvent event) {
- int eventKind = event.getKind();
- IServer server = event.getServer();
- if (eventKind == (ServerEvent.SERVER_CHANGE | ServerEvent.STATE_CHANGE)) {
- if (server.getServerState() == STATE_STARTED) {
- server.removeServerListener(this);
- //status2[0] = Status.OK_STATUS;
- }
- }
- }
- };
-
try {
- addServerListener(curListener);
-
- // Synchroneous restart
+ // synchronous restart
restartImpl2(launchMode, monitor);
return Status.OK_STATUS;
} catch (CoreException ce) {
- removeServerListener(curListener);
if (ce.getStatus().getCode() != -1) {
Trace.trace(Trace.SEVERE, "Error calling delegate restart() " + Server.this.toString());
return ce.getStatus();
}
}
-
- final String mode3 = launchMode;
- // add listener to start it as soon as it is stopped
- addServerListener(new IServerListener() {
- public void serverChanged(ServerEvent event) {
- int eventKind = event.getKind();
- IServer server = event.getServer();
- if (eventKind == (ServerEvent.SERVER_CHANGE | ServerEvent.STATE_CHANGE)) {
- if (server.getServerState() == STATE_STOPPED) {
- server.removeServerListener(this);
-
- // restart in a quarter second (give other listeners a chance
- // to hear the stopped message)
- Thread t = new Thread("Server Restart") {
- public void run() {
- try {
- Thread.sleep(250);
- } catch (Exception e) {
- // ignore
- }
-
- Server.this.start(mode3, (IOperationListener)null);
- }
- };
- t.setDaemon(true);
- t.setPriority(Thread.NORM_PRIORITY - 2);
- t.start();
- }
- }
- }
- });
-
- // stop the server
+ // if restart is not implemented by the server adopter
+ // lets provide a default implementation
stop(false);
+ start(launchMode, monitor);
+
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error restarting server", e);
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorStartFailed, getName()), null);
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorStartFailed, getName()), e);
}
return Status.OK_STATUS;
}
@@ -2709,7 +3000,8 @@
if (!notified[0] && !timer.alreadyDone && monitor2.isCanceled()) {
// user canceled - set the server state to stopped
userCancelled = true;
- setServerState(IServer.STATE_STOPPED);
+ if (launch != null && !launch.isTerminated())
+ launch.terminate();
// notify waiter
synchronized (notified) {
Trace.trace(Trace.FINEST, "synchronousRestart user cancelled");
@@ -2735,9 +3027,9 @@
};
thread.setDaemon(true);
thread.start();
-
+
Trace.trace(Trace.FINEST, "synchronousRestart 2");
-
+
// call the delegate restart
try {
getBehaviourDelegate(null).restart(launchMode);
@@ -2770,10 +3062,10 @@
if (timer.timeout) {
stop(false);
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorRestartFailed, new String[] { getName(), (restartTimeout / 1000) + "" }), null);
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorRestartTimeout, new String[] { getName(), (restartTimeout / 1000) + "" }), null);
}
- if (getServerState() == IServer.STATE_STOPPED)
+ if (!monitor.isCanceled() && getServerState() == IServer.STATE_STOPPED)
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorRestartFailed, getName()), null);
Trace.trace(Trace.FINEST, "synchronousRestart 4");
@@ -2906,23 +3198,15 @@
protected void startImpl2(String mode2, IProgressMonitor monitor) throws CoreException {
Trace.trace(Trace.FINEST, "Starting server: " + Server.this.toString() + ", launchMode: " + mode2);
- SaveEditorPrompter editorHelper = (ServerPlugin.isRunningGUIMode()) ? ServerPlugin.getSaveEditorHelper() : null;
+
// make sure that the delegate is loaded and the server state is correct
loadAdapter(ServerBehaviourDelegate.class, monitor);
try {
ILaunchConfiguration launchConfig = getLaunchConfiguration(true, monitor);
-
- if (editorHelper != null){
- editorHelper.setDebugNeverSave();
- }
-
+ //if (launchConfig == null)
+ // throw new CoreException();
launch = launchConfig.launch(mode2, monitor); // , true); - causes workspace lock
-
- if (editorHelper != null){
- editorHelper.setDebugOriginalValue();
- }
-
Trace.trace(Trace.FINEST, "Launch: " + launch);
} catch (CoreException e) {
Trace.trace(Trace.SEVERE, "Error starting server " + Server.this.toString(), e);
@@ -3001,11 +3285,11 @@
//can't throw exceptions
/*if (timer.timeout)
- return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorStartTimeout, getName()), null);
+ return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorStopTimeout, getName()), null);
else
timer.alreadyDone = true;
*/
- if (getServerState() == IServer.STATE_STARTED)
+ if (!monitor.isCanceled() && getServerState() == IServer.STATE_STARTED)
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorStopFailed, getName()), null);
return Status.OK_STATUS;
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
index 7057b14..1afce00 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
@@ -18,15 +18,7 @@
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.osgi.framework.Bundle;
+import org.eclipse.wst.server.core.*;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
@@ -36,6 +28,7 @@
public class ServerPlugin extends Plugin {
public static final String PROJECT_PREF_FILE = ".serverPreference";
public static final String EXCLUDE_SERVER_ADAPTERS = "excludeServerAdapters";
+ private static final String EXTENSION_RUNTIME_MODULE_TYPE = "runtimeModuleType";
private static final String SHUTDOWN_JOB_FAMILY = "org.eclipse.wst.server.core.family";
//public static final String REGISTRY_JOB_FAMILY = "org.eclipse.wst.server.registry.family";
@@ -57,6 +50,9 @@
// cached copy of all publish tasks
private static List<IPublishTask> publishTasks;
+
+ // cached copy of all publish tasks
+ private static List<PublishController> publishControllers;
// cached copy of all publishers
private static List<Publisher> publishers;
@@ -70,18 +66,9 @@
// cached copy of all module artifact adapters
private static List<ModuleArtifactAdapter> moduleArtifactAdapters;
- // cached copy of all installable servers
- private static List<IInstallableServer> installableServers;
-
// cached copy of all installable runtimes
private static List<IInstallableRuntime> installableRuntimes;
- // cached copy of SaveEditorPrompter
- private static SaveEditorPrompter saveEditorPrompter;
-
- // cached copy of isRunningInGUICache
- public static boolean isRunningInGUICache = false;
-
// registry listener
private static IRegistryChangeListener registryListener;
@@ -95,10 +82,11 @@
class TempDir {
String path;
int age;
+ boolean recycle = true;
}
// temp directories - String key to TempDir
- protected Map<String, TempDir> tempDirHash;
+ private Map<String, TempDir> tempDirHash;
/**
* server core plugin id
@@ -124,7 +112,7 @@
/**
* Returns a temporary directory that the requestor can use
- * throughout it's lifecycle. This is primary to be used by
+ * throughout it's lifecycle. This is primarily to be used by
* server instances for working directories, instance specific
* files, etc.
*
@@ -142,15 +130,42 @@
* @return java.io.File
*/
public IPath getTempDirectory(String key) {
+ return getTempDirectory(key, true);
+ }
+
+ /**
+ * Returns a temporary directory that the requestor can use
+ * throughout it's lifecycle. This is primarily to be used by
+ * server instances for working directories, instance specific
+ * files, etc.
+ *
+ * <p>As long as the same key is used to call this method on
+ * each use of the workbench, this method directory will return
+ * the same directory. If recycling is enabled and the directory
+ * is not requested over a period of time, the directory may be
+ * deleted and a new one will be assigned on the next request.
+ * If this behavior is not desired, recycling should be disabled.</p>
+ *
+ * @param key
+ * @param recycle true if directory may be deleted if not used
+ * over a period of time
+ * @return java.io.File
+ */
+ public IPath getTempDirectory(String key, boolean recycle) {
if (key == null)
return null;
// first, look through hash of current directories
IPath statePath = ServerPlugin.getInstance().getStateLocation();
try {
- TempDir dir = tempDirHash.get(key);
+ TempDir dir = getTempDirs().get(key);
if (dir != null) {
dir.age = 0;
+ // If recycle status needs changing, update
+ if (dir.recycle != recycle) {
+ dir.recycle = recycle;
+ saveTempDirInfo();
+ }
return statePath.append(dir.path);
}
} catch (Exception e) {
@@ -173,7 +188,8 @@
TempDir d = new TempDir();
d.path = path;
- tempDirHash.put(key, d);
+ d.recycle = recycle;
+ getTempDirs().put(key, d);
saveTempDirInfo();
return statePath.append(path);
}
@@ -188,9 +204,9 @@
IPath statePath = ServerPlugin.getInstance().getStateLocation();
try {
- TempDir dir = tempDirHash.get(key);
+ TempDir dir = getTempDirs().get(key);
if (dir != null) {
- tempDirHash.remove(key);
+ getTempDirs().remove(key);
saveTempDirInfo();
deleteDirectory(statePath.append(dir.path).toFile(), null);
}
@@ -199,6 +215,12 @@
}
}
+ private Map<String, TempDir> getTempDirs() {
+ if (tempDirHash == null)
+ loadTempDirInfo();
+ return tempDirHash;
+ }
+
/**
* Load the temporary directory information.
*/
@@ -219,7 +241,14 @@
TempDir d = new TempDir();
d.path = children[i].getString("path");
d.age = children[i].getInteger("age").intValue();
- d.age++;
+ Boolean recycle = children[i].getBoolean("recycle");
+ if (recycle != null) {
+ d.recycle = recycle.booleanValue();
+ }
+ // Age only if recycling is enabled
+ if (d.recycle) {
+ d.age++;
+ }
tempDirHash.put(key, d);
}
@@ -231,7 +260,7 @@
/**
* Convenience method for logging.
*
- * @param status org.eclipse.core.runtime.IStatus
+ * @param status an error status
*/
public static void log(IStatus status) {
getInstance().getLog().log(status);
@@ -244,20 +273,22 @@
// save remaining directories
IPath statePath = ServerPlugin.getInstance().getStateLocation();
String filename = statePath.append(TEMP_DATA_FILE).toOSString();
-
+
try {
XMLMemento memento = XMLMemento.createWriteRoot("temp-directories");
- Iterator iterator = tempDirHash.keySet().iterator();
+ Iterator iterator = getTempDirs().keySet().iterator();
while (iterator.hasNext()) {
String key = (String) iterator.next();
- TempDir d = tempDirHash.get(key);
-
- if (d.age < 5) {
+ TempDir d = getTempDirs().get(key);
+
+ // If not recycling or not old enough, keep
+ if (!d.recycle || d.age < 5) {
IMemento child = memento.createChild("temp-directory");
child.putString("key", key);
child.putString("path", d.path);
child.putInteger("age", d.age);
+ child.putBoolean("recycle", d.recycle);
} else
deleteDirectory(statePath.append(d.path).toFile(), null);
}
@@ -276,11 +307,6 @@
super.start(context);
bundleContext = context;
- ServerPreferences.getInstance().setDefaults();
-
- // load temp directory information
- loadTempDirInfo();
-
bundleListener = new BundleListener() {
public void bundleChanged(BundleEvent event) {
String bundleId = event.getBundle().getSymbolicName();
@@ -290,6 +316,10 @@
}
};
context.addBundleListener(bundleListener);
+
+ // Load the PublishController during plugin startup since this will be used
+ // during the a workspace delta (changes to the workspace)
+ getPublishController();
}
protected void stopBundle(final String bundleId) {
@@ -428,6 +458,30 @@
return s;
}
+ /**
+ * Load the Loose Module Types.
+ */
+ protected static synchronized void loadRuntimeModuleTypes(IRuntimeType runtimeType) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, EXTENSION_RUNTIME_MODULE_TYPE);
+ for (IConfigurationElement ce : cf) {
+ try {
+ String [] looseModuleRuntimeIds = ServerPlugin.tokenize(ce.getAttribute("runtimeTypes"), ",");
+ if (looseModuleRuntimeIds.length < 0){
+ Trace.trace(Trace.EXTENSION_POINT, " runtimeTypes on extension point definition is empty");
+ return;
+ }
+
+ if (ServerPlugin.contains(looseModuleRuntimeIds, runtimeType.getId())){
+ ((RuntimeType)runtimeType).addModuleType(ce);
+ Trace.trace(Trace.EXTENSION_POINT, " Loaded Runtime supported ModuleType: " + ce.getAttribute("id"));
+ }
+ } catch (Throwable t) {
+ Trace.trace(Trace.SEVERE, " Could not load Runtime supported ModuleType: " + ce.getAttribute("id"), t);
+ }
+ }
+ }
+
protected static List<org.eclipse.wst.server.core.IModuleType> getModuleTypes(IConfigurationElement[] elements) {
List<IModuleType> list = new ArrayList<IModuleType>();
if (elements == null)
@@ -723,6 +777,48 @@
Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .publishers extension point -<-");
}
+
+ /**
+ * Returns an array of all known publishers.
+ * <p>
+ * A new array is returned on each call, so clients may store or modify the result.
+ * </p>
+ *
+ * @return a possibly-empty array of publisher instances {@link Publisher}
+ */
+ public static PublishController[] getPublishController() {
+ if (publishers == null)
+ loadPublishControllers();
+ PublishController[] controllers = new PublishController[publishControllers.size()];
+ publishControllers.toArray(controllers);
+ return controllers;
+ }
+
+ /**
+ * Load the publishController extension point.
+ */
+ private static synchronized void loadPublishControllers() {
+ if (publishControllers != null)
+ return;
+ Trace.trace(Trace.EXTENSION_POINT, "->- Loading .publishController extension point ->-");
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "publishController");
+
+ int size = cf.length;
+ List<PublishController> list = new ArrayList<PublishController>(size);
+ for (int i = 0; i < size; i++) {
+ try {
+ list.add(new PublishController(cf[i]));
+ Trace.trace(Trace.EXTENSION_POINT, " Loaded .publishController: " + cf[i].getAttribute("id"));
+ } catch (Throwable t) {
+ Trace.trace(Trace.SEVERE, " Could not load .publishController: " + cf[i].getAttribute("id"), t);
+ }
+ }
+ publishControllers = list;
+
+ Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .publishController extension point -<-");
+ }
+
/**
* Returns an array of all known module module factories.
@@ -1060,38 +1156,6 @@
}
/**
- * Returns an array of all known installable servers.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of installable servers {@link IInstallableServer}
- */
- public static IInstallableServer[] getInstallableServers() {
- if (installableServers == null)
- loadInstallableServers();
-
- List<IInstallableServer> availableServers = new ArrayList<IInstallableServer>();
- Iterator iterator = installableServers.iterator();
- IRuntimeType[] runtimeTypes = ServerCore.getRuntimeTypes();
- int size = runtimeTypes.length;
- while (iterator.hasNext()) {
- IInstallableServer server = (IInstallableServer) iterator.next();
- boolean found = false;
- for (int i = 0; i < size; i++) {
- if (server.getId().equals(runtimeTypes[i].getId()))
- found = true;
- }
- if (!found)
- availableServers.add(server);
- }
-
- IInstallableServer[] is = new IInstallableServer[availableServers.size()];
- availableServers.toArray(is);
- return is;
- }
-
- /**
* Returns an array of all known installable runtimes.
* <p>
* A new array is returned on each call, so clients may store or modify the result.
@@ -1138,32 +1202,6 @@
}
/**
- * Load the installable servers.
- */
- private static synchronized void loadInstallableServers() {
- if (installableServers != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .installableServers extension point ->-");
-
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "installableServers");
-
- int size = cf.length;
- List<IInstallableServer> list = new ArrayList<IInstallableServer>(size);
- for (int i = 0; i < size; i++) {
- try {
- list.add(new InstallableServer(cf[i]));
- Trace.trace(Trace.EXTENSION_POINT, " Loaded installableServer: " + cf[i].getAttribute("id"));
- } catch (Throwable t) {
- Trace.trace(Trace.SEVERE, " Could not load installableServer: " + cf[i].getAttribute("id"), t);
- }
- }
- installableServers = list;
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .installableServers extension point -<-");
- }
-
- /**
* Load the installable runtimes.
*/
private static synchronized void loadInstallableRuntimes() {
@@ -1244,52 +1282,4 @@
return Platform.getProduct().getProperty(key);
return value;
}
-
- public static boolean isRunningGUIMode(){
- // check only when the the plugin is not Bundle.ACTIVE
- if (isRunningInGUICache == true){
- return isRunningInGUICache;
- }
-
- Bundle swtEclipseUIbndl = Platform.getBundle("org.eclipse.ui"); //running in GUI mode if it is active.
- if(swtEclipseUIbndl != null){
- isRunningInGUICache= (swtEclipseUIbndl.getState() == Bundle.ACTIVE);
- return isRunningInGUICache;
- }
- return false;
- }
-
-
- /**
- * Transfer the control to the UI and prompts to save all the editors
- */
- public static SaveEditorPrompter getSaveEditorHelper() {
- loadSaveEditorExtension();
- return saveEditorPrompter;
- }
-
- private static void loadSaveEditorExtension() {
- if (saveEditorPrompter != null)
- return;
- Trace.trace(Trace.EXTENSION_POINT, "->- Loading .saveEditorPrompter extension point ->-");
-
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerPlugin.PLUGIN_ID, "saveEditorPrompter");
-
- int size = cf.length;
- try{
- saveEditorPrompter = (SaveEditorPrompter)cf[0].createExecutableExtension("class");
- Trace.trace(Trace.EXTENSION_POINT, " Loaded saveEditorPrompter: " + cf[0].getAttribute("id"));
- } catch (CoreException ce){
- Trace.trace(Trace.SEVERE, " Could not load saveEditorPrompter: " + cf[0].getAttribute("id"), ce);
- }
- if (size < 1) {
- Trace.trace(Trace.WARNING, " More than one .saveEditorPrompter found, only one loaded =>"+ cf[0].getAttribute("id"));
- }
-
- Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading .saveEditorPrompter extension point -<-");
-
- }
-
-
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferenceModifyListener.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferenceModifyListener.java
new file mode 100644
index 0000000..b263eb2
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferenceModifyListener.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.core.internal;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.core.runtime.preferences.PreferenceModifyListener;
+import org.osgi.service.prefs.Preferences;
+import org.w3c.dom.*;
+import org.xml.sax.InputSource;
+
+public class ServerPreferenceModifyListener extends PreferenceModifyListener {
+
+ private static final String LOCKED_ATTRIBUTE_NAME = "locked"; //$NON-NLS-1$
+ private static final String RUNTIMES_PREFERENCE_NAME = "runtimes"; //$NON-NLS-1$
+ private static final String RUNTIME_NODE_NAME = "runtime"; //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.PreferenceModifyListener#preApply(org.eclipse.core.runtime.preferences.IEclipsePreferences)
+ */
+ public IEclipsePreferences preApply(IEclipsePreferences node) {
+ Preferences instance = node.node(InstanceScope.SCOPE);
+ Preferences runtimes = instance.node(ServerPlugin.PLUGIN_ID);
+ if (runtimes != null)
+ removeLockedServerRuntimePreference(runtimes); //$NON-NLS-1$
+ return super.preApply(node);
+ }
+
+ private void removeLockedServerRuntimePreference(Preferences preferences) {
+ try {
+ Document doc = DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder().parse(new InputSource(new StringReader(preferences.get(RUNTIMES_PREFERENCE_NAME, "")))); //$NON-NLS-1$
+ NodeList nodeList = doc.getElementsByTagName(RUNTIME_NODE_NAME);
+ for (int s = 0; s < nodeList.getLength(); s++) {
+ Node node = nodeList.item(s);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ NamedNodeMap attributes = node.getAttributes();
+ Node locked = attributes.getNamedItem(LOCKED_ATTRIBUTE_NAME);
+ if (locked != null && Boolean.parseBoolean(locked.getNodeValue()))
+ node.getParentNode().removeChild(node);
+ }
+ }
+ StringWriter runtimes = new StringWriter();
+ TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(runtimes));
+ preferences.remove(RUNTIMES_PREFERENCE_NAME);
+ preferences.put(RUNTIMES_PREFERENCE_NAME, runtimes.toString());
+ } catch (Exception e) {
+ //there is no defined runtime environment
+ return;
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
index a0e8664..f5161d5 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPreferences.java
@@ -28,6 +28,7 @@
private ServerPreferences() {
super();
preferences = ServerPlugin.getInstance().getPluginPreferences();
+ setDefaults();
}
/**
@@ -93,7 +94,7 @@
/**
* Set the default values.
*/
- public void setDefaults() {
+ private void setDefaults() {
preferences.setDefault(PREF_AUTO_PUBLISH, isDefaultAutoPublishing());
preferences.setDefault(PREF_MODULE_START_TIMEOUT, 300001);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java
index e5eb3f5..eadd3c8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPublishInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -10,28 +10,14 @@
*******************************************************************************/
package org.eclipse.wst.server.core.internal;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
+import java.io.*;
+import java.util.*;
import org.eclipse.core.runtime.IPath;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleFolder;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.eclipse.wst.server.core.model.*;
/**
* Helper to obtain and store the publishing information (what files
* were published and when) for a single server.
@@ -384,8 +370,9 @@
int size2 = current.length;
Map<IModuleResource, IModuleResource> originalMap = new HashMap<IModuleResource, IModuleResource>(size);
- for (int i = 0; i < size; i++)
+ for (int i = 0; i < size; i++){
originalMap.put(original[i], original[i]);
+ }
// added and changed resources
for (int i = 0; i < size2; i++) {
@@ -430,7 +417,6 @@
list.add(delta);
}
}
-
return list.toArray(new IModuleResourceDelta[list.size()]);
}
@@ -505,15 +491,27 @@
* Returns true if the list of modules being published does not match the previous
* list of published modules.
*
- * This method should compare the modules. For now, comparing the size is fine.
- *
* @param modules a list of modules
* @return <code>true</code> if the structure of published modules has changed, or
* <code>false</code> otherwise
*/
- protected boolean hasStructureChanged(List modules) {
+ protected boolean hasStructureChanged(List<IModule[]> modules) {
synchronized (modulePublishInfo) {
- return modules.size() != modulePublishInfo.keySet().size();
+ // if the lists are different size, the structured changed
+ if (modules.size() != modulePublishInfo.keySet().size())
+ return true;
+
+ // if the list are the same size, compare modules id
+ final boolean[] changed = new boolean[1];
+
+ for (IModule[] module:modules){
+ String key = getKey(module);
+ if (!modulePublishInfo.containsKey(key)){
+ changed[0] = true;
+ }
+ }
+
+ return changed[0];
}
}
@@ -531,6 +529,19 @@
}
/**
+ * Clears all caches of current module resources and deltas.
+ */
+ public void clearCache() {
+ synchronized (modulePublishInfo) {
+ Iterator iterator = modulePublishInfo.values().iterator();
+ while (iterator.hasNext()) {
+ ModulePublishInfo mpi = (ModulePublishInfo) iterator.next();
+ mpi.clearCache();
+ }
+ }
+ }
+
+ /**
* Recreates the cache for the specified {@link IModule}.
*
* @param module The {@link IModule}
@@ -546,17 +557,4 @@
}
}
}
-
- /**
- * Clears all caches of current module resources and deltas.
- */
- public void clearCache() {
- synchronized (modulePublishInfo) {
- Iterator iterator = modulePublishInfo.values().iterator();
- while (iterator.hasNext()) {
- ModulePublishInfo mpi = (ModulePublishInfo) iterator.next();
- mpi.clearCache();
- }
- }
- }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java
index b1ca86e..d33ce3e 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerType.java
@@ -188,7 +188,7 @@
ServerWorkingCopy swc = new ServerWorkingCopy(id, file, runtime, this);
if (hasRuntime())
swc.setRuntime(runtime);
- ServerUtil.setServerDefaultName(swc);
+
swc.setDefaults(monitor);
if (hasServerConfiguration() && runtime != null && runtime.getLocation() != null && !runtime.getLocation().isEmpty())
@@ -241,9 +241,7 @@
else {
// create runtime
try {
- IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(id, monitor);
- ServerUtil.setRuntimeDefaultName(runtimeWC);
- runtime = runtimeWC;
+ runtime = runtimeType.createRuntime(id, monitor);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Couldn't create runtime", e);
}
@@ -253,7 +251,6 @@
ServerWorkingCopy swc = new ServerWorkingCopy(id, file, runtime, this);
if (runtime != null)
swc.setRuntime(runtime);
- ServerUtil.setServerDefaultName(swc);
swc.setDefaults(monitor);
if (swc.getServerType().hasServerConfiguration())
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
index 270c14d..4f43a27 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -175,22 +175,27 @@
}
public void setAttribute(String attributeName, int value) {
+ canModifyAttribute(attributeName);
wch.setAttribute(attributeName, value);
}
public void setAttribute(String attributeName, boolean value) {
+ canModifyAttribute(attributeName);
wch.setAttribute(attributeName, value);
}
public void setAttribute(String attributeName, String value) {
+ canModifyAttribute(attributeName);
wch.setAttribute(attributeName, value);
}
public void setAttribute(String attributeName, List<String> value) {
+ canModifyAttribute(attributeName);
wch.setAttribute(attributeName, value);
}
public void setAttribute(String attributeName, Map value) {
+ canModifyAttribute(attributeName);
wch.setAttribute(attributeName, value);
}
@@ -639,8 +644,16 @@
}
}
+ /**
+ * Sets the defaults for this server, including the name. This method should be
+ * called when creating a server, or when any major settings (e.g. runtime, host)
+ * change.
+ *
+ * @param monitor a progress monitor, or null
+ */
public void setDefaults(IProgressMonitor monitor) {
try {
+ ServerUtil.setServerDefaultName(this);
getWorkingCopyDelegate(monitor).setDefaults(monitor);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error calling delegate setDefaults() " + toString(), e);
@@ -800,6 +813,16 @@
if (getAttribute(PROP_ID_SET, false))
setAttribute(PROP_ID_SET, false);
}
+
+ /**
+ * Checks if a given attribute can be modified, throws an IllegalArgumentException if otherwise
+ * @param attributeName
+ */
+ protected void canModifyAttribute(String attributeName){
+ if (attributeName != null &&
+ PROP_TIMESTAMP.equalsIgnoreCase(attributeName))
+ throw new IllegalArgumentException("Unmodifiable attribute: "+ attributeName);
+ }
public String toString() {
return "ServerWorkingCopy " + getId();
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StartServerJob.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StartServerJob.java
index 90120d5..cb1a2fc 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StartServerJob.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StartServerJob.java
@@ -22,7 +22,7 @@
protected String launchMode;
public StartServerJob(IServer server, String launchMode) {
- super(NLS.bind(Messages.jobStartingServer, server.getName()), server);
+ super(NLS.bind(Messages.jobStarting, server.getName()), server);
this.launchMode = launchMode;
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StopServerJob.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StopServerJob.java
index 74bf75b..3b96933 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StopServerJob.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/StopServerJob.java
@@ -20,7 +20,7 @@
*/
public class StopServerJob extends ChainedJob {
public StopServerJob(IServer server) {
- super(NLS.bind(Messages.jobStoppingServer, server.getName()), server);
+ super(NLS.bind(Messages.jobStopping, server.getName()), server);
}
/* (non-Javadoc)
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/UpdateServerJob.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/UpdateServerJob.java
index 91428ea..b32b5a0 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/UpdateServerJob.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/UpdateServerJob.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -13,25 +13,33 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
/**
* Action to update a server's status.
*/
-public class UpdateServerJob extends ChainedJob {
+public class UpdateServerJob extends Job {
/**
* An action to update the status of a server.
*
* @param server a server
*/
- public UpdateServerJob(IServer server) {
- super(NLS.bind(Messages.jobUpdateServer, server.getName()), server);
+ private IServer[] servers;
+
+ public UpdateServerJob(IServer[] servers2) {
+ super(Messages.jobUpdatingServers);
+ this.servers = servers2;
}
public IStatus run(IProgressMonitor monitor) {
- getServer().loadAdapter(ServerBehaviourDelegate.class, monitor);
-
+ for (IServer server : servers){
+ if (server.getServerType() != null && server.getServerState() == IServer.STATE_UNKNOWN) {
+ monitor.subTask(NLS.bind(Messages.jobUpdateServer, server.getName()));
+ server.loadAdapter(ServerBehaviourDelegate.class, monitor);
+ }
+ }
return Status.OK_STATUS;
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java
index 000b810..bbb0b7b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeBridge.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007,2010 IBM 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
@@ -11,20 +11,10 @@
*******************************************************************************/
package org.eclipse.wst.server.core.internal.facets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeBridge;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponentVersion;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.core.runtime.*;
+import org.eclipse.wst.common.project.facet.core.runtime.*;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.ServerCore;
@@ -105,27 +95,20 @@
public IStub bridge(String name) throws CoreException {
if (name == null)
throw new IllegalArgumentException();
-
- IRuntime[] runtimes = ServerCore.getRuntimes();
- int size = runtimes.length;
- for (int i = 0; i < size; i++) {
- if (runtimes[i].getId().equals(name))
- return new Stub(runtimes[i]);
- if (runtimes[i].getName().equals(name))
- return new Stub(runtimes[i]);
- }
- return null;
+ return new Stub(name);
}
private static class Stub extends IRuntimeBridge.Stub {
- private IRuntime runtime;
+ private String id;
- public Stub(IRuntime runtime) {
- this.runtime = runtime;
+ public Stub(String id) {
+ this.id = id;
}
public List<IRuntimeComponent> getRuntimeComponents() {
List<IRuntimeComponent> components = new ArrayList<IRuntimeComponent>(2);
+ final IRuntime runtime = findRuntime( this.id );
+
if (runtime == null)
return components;
@@ -159,6 +142,7 @@
public Map<String, String> getProperties() {
final Map<String, String> props = new HashMap<String, String>();
+ final IRuntime runtime = findRuntime( this.id );
if (runtime != null) {
props.put("id", runtime.getId());
props.put("localized-name", runtime.getName());
@@ -170,7 +154,26 @@
}
public IStatus validate(final IProgressMonitor monitor) {
- return runtime.validate( monitor );
+ final IRuntime runtime = findRuntime( this.id );
+ if( runtime != null ) {
+ return runtime.validate( monitor );
+ }
+ return Status.OK_STATUS;
}
+
+ private static final IRuntime findRuntime( final String id )
+ {
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ int size = runtimes.length;
+
+ for (int i = 0; i < size; i++) {
+ if (runtimes[i].getId().equals(id))
+ return runtimes[i];
+ if (runtimes[i].getName().equals(id))
+ return runtimes[i];
+
+ }
+ return null;
+ }
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeComponentProviderWrapper.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeComponentProviderWrapper.java
index 556450d..bad8bf8 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeComponentProviderWrapper.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/facets/RuntimeComponentProviderWrapper.java
@@ -18,6 +18,7 @@
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.eclipse.wst.server.core.internal.Trace;
/**
*
@@ -104,7 +105,7 @@
try {
delegate = (RuntimeFacetComponentProviderDelegate) element.createExecutableExtension("class");
} catch (Throwable t) {
- Trace.trace(Trace.SEVERE, "Could not create delegate " + toString(), t);
+ ServerPlugin.logExtensionFailure(toString(), t);
}
}
return delegate;
@@ -119,7 +120,7 @@
try {
return getDelegate().getRuntimeComponents(runtime);
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error calling delegate " + toString(), e);
+ ServerPlugin.logExtensionFailure(toString(), e);
}
return null;
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/tar/TarInputStream.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/tar/TarInputStream.java
index 1eb16f3..afd4155 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/tar/TarInputStream.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/tar/TarInputStream.java
@@ -295,7 +295,7 @@
byte[] longNameData = new byte[(int) entry.getSize()];
int bytesread2 = 0;
while (bytesread2 < longNameData.length) {
- int cur = read(longNameData, bytesread2, longNameData.length - bytesread);
+ int cur = read(longNameData, bytesread2, longNameData.length - bytesread2);
if (cur < 0) {
throw new IOException("early end of stream"); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java
index d63f7cd..7b144be 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -103,6 +103,17 @@
public abstract IModule[] getChildModules();
/**
+ * Returns the path relative to its parent of the given module contained within this application
+ *
+ * @param m a module within this application
+ * @return the path of the given module with respect to the parent, or <code>null</code> if the path could
+ * not be found
+ */
+ public String getPath(IModule m){
+ return null;
+ }
+
+ /**
* Returns the current array of module artifacts.
*
* @return a possibly empty array containing the module resources
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java
index fc0ea8c..fe57cc5 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ModuleFactoryDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM 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
@@ -16,8 +16,11 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.internal.Module;
import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.Server;
/**
* A module factory delegate provides a mechanism for discovering
* modules. A module factory delegate is specified by the
@@ -215,4 +218,15 @@
return null;
}
+
+ /**
+ * Alerts the server tools framework that this factory's list of modules
+ * has changed, and caches may no longer be accurate
+ */
+ protected void modulesChanged() {
+ IServer[] allServers = ServerCore.getServers();
+ for( int i = 0; i < allServers.length; i++ ) {
+ ((Server)allServers[i]).clearModuleCache();
+ }
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublishControllerDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublishControllerDelegate.java
new file mode 100644
index 0000000..01f46cb
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublishControllerDelegate.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.core.model;
+
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.wst.server.core.IServer;
+/**
+ * A controller allows to inteject a different points of the publish action
+ * <p>
+ * <b>Provisional API:</b> This class/interface is part of an interim API that is still under development and expected to
+ * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
+ * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
+ * (repeatedly) as the API evolves.
+ * </p>
+ *
+ * @since 1.1
+ */
+public abstract class PublishControllerDelegate {
+
+ /**
+ * Create a new operation. The label and description must be supplied
+ * by overriding the getLabel() and getDescription() methods.
+ */
+ public PublishControllerDelegate() {
+ // do nothing
+ }
+
+ public abstract boolean isPublishRequired(IServer server, IResourceDelta delta);
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublisherDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublisherDelegate.java
index 27cc380..a8368c1 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublisherDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/PublisherDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM 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
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.wst.server.core.model;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
+import java.util.List;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.TaskModel;
/**
* An operation that will be executed during publishing.
@@ -23,7 +25,8 @@
* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
* (repeatedly) as the API evolves.
* </p>
- * @plannedfor 3.1
+ *
+ * @since 1.1
*/
public abstract class PublisherDelegate {
private TaskModel model;
@@ -90,4 +93,40 @@
* @throws CoreException if there was an error while executing the task
*/
public abstract IStatus execute(int kind, IProgressMonitor monitor, IAdaptable info) throws CoreException;
+
+ /**
+ * Returns the scheduling rule that is required for executing the publisher delegate. The default is the current
+ * rule defined on the publishing job.
+ *
+ * @return A {@link ISchedulingRule} for the job that defines how this publisher can execute in the publishing job.
+ * A <code>null</code> value may be returned if the publishing job does not have any rule defined.
+ * @since 3.2
+ */
+ public ISchedulingRule getRule() {
+
+ return Job.getJobManager().currentRule();
+ }
+
+ /**
+ * Accessor to find out if this publisher delegate modified any modules that are published on the server.
+ *
+ * @return <code>true</code> if the publisher modified the contents of any modules that are published on the server.
+ * @since 3.2
+ */
+ public boolean isModifyModules() {
+
+ return false;
+ }
+
+ /**
+ * Accessor to acquire the list of {@link IModule} entries that were modified by the publisher. By default, it will
+ * return all modules published to the server
+ *
+ * @return An array of {@link IModule} entries that were modified by the publisher
+ * @since 3.2
+ */
+ public List<IModule[]> getModifiedModules() {
+
+ return (List<IModule[]>) this.model.getObject(TaskModel.TASK_MODULES);
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
index cfdb34b..dad47aa 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java
@@ -43,6 +43,7 @@
* to extend the <code>serverTypes</code> extension point.
* </p>
*
+ * @noimplement
* @see IServer
* @see IServerWorkingCopy
* @since 1.0
@@ -414,11 +415,49 @@
*
* @param module the module
* @return <code>true</code> if the given module can be
- * restarted, and <code>false</code> otherwise
+ * restarted, and <code>false</code> otherwise
+ *
+ * @deprecated instead use canRestartModule, canPublishModule
*/
public boolean canControlModule(IModule[] module) {
return false;
}
+
+ /**
+ * Returns whether the given module can be restarted.
+ * <p>
+ * This call should complete reasonably fast and not require communication
+ * with the (potentially remote) server. If communication is required it
+ * should be done asynchronously and this method should either fail until
+ * that is complete or succeed and handle failure in the xxModule methods.
+ * </p>
+ *
+ * @param module the module
+ * @return <code>true</code> if the given module can be
+ * restarted, and <code>false</code> otherwise
+ *
+ */
+ public boolean canRestartModule(IModule[] module){
+ return canControlModule(module);
+ }
+
+ /**
+ * Returns whether the given module can be published.
+ * <p>
+ * This call should complete reasonably fast and not require communication
+ * with the (potentially remote) server. If communication is required it
+ * should be done asynchronously and this method should either fail until
+ * that is complete or succeed and handle failure in the xxModule methods.
+ * </p>
+ *
+ * @param module the module
+ * @return <code>true</code> if the given module can be
+ * published, and <code>false</code> otherwise
+ *
+ */
+ public boolean canPublishModule(IModule[] module){
+ return canControlModule(module);
+ }
/**
* Returns whether this server is in a state that it can
@@ -441,7 +480,7 @@
* {@link org.eclipse.debug.core.ILaunchManager}
* @return a status object with code <code>IStatus.OK</code> if the server can
* be started, otherwise a status object indicating why it can't
- * @since 3.0
+ * @since 1.1
*/
public IStatus canStart(String launchMode) {
return Status.OK_STATUS;
@@ -469,7 +508,7 @@
* {@link org.eclipse.debug.core.ILaunchManager}
* @return a status object with code <code>IStatus.OK</code> if the server can
* be restarted, otherwise a status object indicating why it can't
- * @since 3.0
+ * @since 1.1
*/
public IStatus canRestart(String mode) {
return Status.OK_STATUS;
@@ -495,7 +534,7 @@
*
* @return a status object with code <code>IStatus.OK</code> if the server can
* be stopped, otherwise a status object indicating why it can't
- * @since 3.0
+ * @since 1.1
*/
public IStatus canStop() {
return Status.OK_STATUS;
@@ -519,7 +558,7 @@
*
* @return a status object with code <code>IStatus.OK</code> if the server can
* be published to, otherwise a status object indicating what is wrong
- * @since 3.0
+ * @since 1.1
*/
public IStatus canPublish() {
return Status.OK_STATUS;
@@ -662,7 +701,7 @@
/**
* Returns a temporary directory that the requester can use
- * throughout it's lifecycle. This is primary to be used by
+ * throughout it's lifecycle. This is primarily to be used by
* servers for working directories, server specific
* files, etc.
* <p>
@@ -682,6 +721,27 @@
}
/**
+ * Returns a temporary directory that the requester can use
+ * throughout it's lifecycle. This is primarily to be used by
+ * servers for working directories, server specific
+ * files, etc.
+ * <p>
+ * As long as the same key is used to call this method on
+ * each use of the workbench, this method directory will return
+ * the same directory. If recycling is enabled and the directory
+ * is not requested over a period of time, the directory may be
+ * deleted and a new one will be assigned on the next request.
+ * If this behavior is not desired, recycling should be disabled.</p>
+ *
+ * @param recycle true if directory may be deleted if not used
+ * over a period of time
+ * @return a temporary directory
+ */
+ protected IPath getTempDirectory(boolean recycle) {
+ return server.getTempDirectory(recycle);
+ }
+
+ /**
* Set a global status on the server.
*
* @param status the status
@@ -803,6 +863,33 @@
multi.addAll(tempMulti);
}*/
+ private List<Integer> computeDelta(final List<IModule[]> moduleList) {
+
+ final List<Integer> deltaKindList = new ArrayList<Integer>();
+ final Iterator<IModule[]> iterator = moduleList.iterator();
+ while (iterator.hasNext()) {
+ IModule[] module = iterator.next();
+ if (hasBeenPublished(module)) {
+ IModule m = module[module.length - 1];
+ if ((m.getProject() != null && !m.getProject().isAccessible())
+ || getPublishedResourceDelta(module).length == 0) {
+ deltaKindList.add(new Integer(ServerBehaviourDelegate.NO_CHANGE));
+ }
+ else {
+ deltaKindList.add(new Integer(ServerBehaviourDelegate.CHANGED));
+ }
+ }
+ else {
+ deltaKindList.add(new Integer(ServerBehaviourDelegate.ADDED));
+ }
+ }
+ this.addRemovedModules(moduleList, null);
+ while (deltaKindList.size() < moduleList.size()) {
+ deltaKindList.add(new Integer(ServerBehaviourDelegate.REMOVED));
+ }
+ return deltaKindList;
+ }
+
/**
* Publish to the server.
*
@@ -812,31 +899,13 @@
* @return the publish status
*/
public IStatus publish(int kind, IProgressMonitor monitor) {
- Trace.trace(Trace.FINEST, "-->-- Publishing to server: " + toString() + " -->--");
+ Trace.trace(Trace.FINEST, "-->-- Publishing to server: " + getServer().toString() + " -->--");
if (getServer().getServerType().hasRuntime() && getServer().getRuntime() == null)
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorPublishNoRuntime, null);
final List<IModule[]> moduleList = getAllModules();
- final List<Integer> deltaKindList = new ArrayList<Integer>();
-
- Iterator iterator = moduleList.iterator();
- while (iterator.hasNext()) {
- IModule[] module = (IModule[]) iterator.next();
- if (hasBeenPublished(module)) {
- IModule m = module[module.length - 1];
- if ((m.getProject() != null && !m.getProject().isAccessible())
- || getPublishedResourceDelta(module).length == 0)
- deltaKindList.add(new Integer(ServerBehaviourDelegate.NO_CHANGE));
- else
- deltaKindList.add(new Integer(ServerBehaviourDelegate.CHANGED));
- } else
- deltaKindList.add(new Integer(ServerBehaviourDelegate.ADDED));
- }
-
- addRemovedModules(moduleList, null);
- while (deltaKindList.size() < moduleList.size())
- deltaKindList.add(new Integer(ServerBehaviourDelegate.REMOVED));
+ List<Integer> deltaKindList = this.computeDelta(moduleList);
PublishOperation[] tasks = getTasks(kind, moduleList, deltaKindList);
int size = 2000 + 3500 * moduleList.size() + 500 * tasks.length;
@@ -864,7 +933,7 @@
// execute publishers
taskStatus = executePublishers(kind, moduleList, deltaKindList, monitor, info2);
if (taskStatus != null && !taskStatus.isOK())
- tempMulti.addAll(taskStatus);
+ tempMulti.addAll(taskStatus);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
@@ -945,10 +1014,11 @@
* @return the status
*/
protected IStatus publishModule(int kind, IModule[] module, int deltaKind, IProgressMonitor monitor) {
- Trace.trace(Trace.FINEST, "Publishing module: " + module);
+ Trace.trace(Trace.FINEST, "-->-- Publishing module");
int size = module.length;
IModule m = module[size - 1];
+ Trace.trace(Trace.FINEST, "Module: "+m);
monitor.beginTask(NLS.bind(Messages.publishingModule, m.getName()), 1000);
try {
@@ -960,7 +1030,7 @@
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorPublishing, e);
} finally {
monitor.done();
- Trace.trace(Trace.FINEST, "Done publishing: " + module);
+ Trace.trace(Trace.FINEST, "--<-- Done publishing module");
}
}
@@ -1065,6 +1135,7 @@
* Execute publishers.
*
* @param kind the publish kind
+ * @param modules the list of modules
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting and cancellation are not desired
* @param info the IAdaptable (or <code>null</code>) provided by the
@@ -1073,25 +1144,31 @@
* it should minimally contain an adapter for the
* org.eclipse.swt.widgets.Shell.class
* @throws CoreException
- * @Deprecated use ServerBehaviourDelegate.executePublishers(int kind, List<IModule[]> modules, List<Integer> deltaKinds, IProgressMonitor monitor, IAdaptable info)
+ * @since 1.1
+ * @deprecated Replaced by
+ * {@link #executePublishers(int, List, List, IProgressMonitor, IAdaptable)}
*/
protected MultiStatus executePublishers(int kind, List<IModule[]> modules, IProgressMonitor monitor, IAdaptable info) throws CoreException {
return executePublishers(kind, modules, null, monitor, info);
}
/**
- * Execute publishers.
+ * Execute publishers. If a publisher modified the contents of the module (which is determined by the
+ * {@link PublisherDelegate}) then the delta list is rebuild.
*
- * @param kind the publish kind
- * @param modules the list of modules
- * @param deltaKinds the list of delta kind that maps to the list of modules
- * @param monitor a progress monitor, or <code>null</code> if progress
- * reporting and cancellation are not desired
- * @param info the IAdaptable (or <code>null</code>) provided by the
- * caller in order to supply UI information for prompting the
- * user if necessary. When this parameter is not <code>null</code>,
- * it should minimally contain an adapter for the
- * org.eclipse.swt.widgets.Shell.class
+ * @param kind
+ * the publish kind
+ * @param modules
+ * the list of modules. The contents of this {@link List} may change if the publisher modifies code.
+ * @param deltaKinds
+ * the list of delta kind that maps to the list of modules. The contents of this {@link List} may change
+ * if the publisher modifies code.
+ * @param monitor
+ * a progress monitor, or <code>null</code> if progress reporting and cancellation are not desired
+ * @param info
+ * the IAdaptable (or <code>null</code>) provided by the caller in order to supply UI information for
+ * prompting the user if necessary. When this parameter is not <code>null</code>, it should minimally
+ * contain an adapter for the org.eclipse.swt.widgets.Shell.class
* @throws CoreException
* @since 1.1
*/
@@ -1112,12 +1189,17 @@
taskModel.putObject(TaskModel.TASK_DELTA_KINDS, deltaKinds);
}
+ boolean publisherModifiedCode = false;
for (int i = 0; i < size; i++) {
Publisher pub = publishers[i];
monitor.subTask(NLS.bind(Messages.taskPerforming, pub.getName()));
try {
pub.setTaskModel(taskModel);
IStatus pubStatus = pub.execute(kind, ProgressUtil.getSubMonitorFor(monitor, 500), info);
+ if(!publisherModifiedCode) {
+ // If a publisher has modified modules then there is no reason to keep checking other publishers.
+ publisherModifiedCode = pub.isModifyModules();
+ }
multi.add(pubStatus);
} catch (CoreException ce) {
Trace.trace(Trace.SEVERE, "Publisher failed", ce);
@@ -1128,6 +1210,10 @@
if (monitor.isCanceled())
return multi;
}
+ if (publisherModifiedCode) {
+ // re-create the delta list as at least one publisher has changed the contents of the published modules.
+ deltaKinds = this.computeDelta(modules);
+ }
return multi;
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
index c011f21..d34d417 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -78,6 +78,15 @@
serverWC = (ServerWorkingCopy) newServer;
initialize();
}
+
+ /**
+ * Specify the locking rule to be used during a publish.
+ * @return true if only affected projects are locked during a publish. false if the entire workspace
+ * needs to be locked during a publish.
+ */
+ public boolean isUseProjectSpecificSchedulingRuleOnPublish() {
+ return false;
+ }
/**
* Initializes this server delegate. This method gives delegates a chance
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java
index e229fc8..25cb2df 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java
@@ -19,7 +19,7 @@
* An implementation of {@link IModuleFile} for physical files on disk or in the
* workspace.
*
- * @since 3.0
+ * @since 1.1
*/
public class ModuleFile implements IModuleFile {
private IFile file;
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java
index 6d9147f..9874138 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java
@@ -19,7 +19,7 @@
* An implementation of {@link IModuleFolder} for physical folders on disk or in the
* workspace.
*
- * @since 3.0
+ * @since 1.1
*/
public class ModuleFolder implements IModuleFolder {
private static final IModuleResource[] EMPTY_RESOURCE_ARRAY = new IModuleResource[0];
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java
index f1e1ba6..d338f0a 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModuleFactoryDelegate.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.internal.ModuleFactory;
import org.eclipse.wst.server.core.internal.ServerPlugin;
@@ -261,27 +262,30 @@
*/
public IModule findModule(String id) {
try {
- // first assume that the id is a project name
- IProject project = getWorkspaceRoot().getProject(id);
- if (project != null) {
- IModule[] m = cacheModules(project);
- if (m != null) {
- int size = m.length;
- for (int i = 0; i < size; i++) {
- String id2 = m[i].getId();
- int index = id2.indexOf(":");
- if (index >= 0)
- id2 = id2.substring(index+1);
-
- if (id.equals(id2))
- return m[i];
+ IPath pathToProject = new Path(null, id);
+ if (pathToProject.segmentCount() == 1) {
+ // only look for projects which means there should only be 1 segment in the path
+ IProject project = getWorkspaceRoot().getProject(id);
+ if (project != null) {
+ IModule[] m = cacheModules(project);
+ if (m != null) {
+ int size = m.length;
+ for (int i = 0; i < size; i++) {
+ String id2 = m[i].getId();
+ int index = id2.indexOf(":");
+ if (index >= 0)
+ id2 = id2.substring(index + 1);
+
+ if (id.equals(id2))
+ return m[i];
+ }
}
}
}
} catch (Exception e) {
- Trace.trace(Trace.FINER, "Could not find " + id + ". Reverting to default behaviour");
+ Trace.trace(Trace.FINER, "Could not find " + id + ". Reverting to default behaviour", e);
}
-
+
// otherwise default to searching all modules
return super.findModule(id);
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishHelper.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishHelper.java
index 3b8d979..7bf137f 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishHelper.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM 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
@@ -32,9 +32,9 @@
/**
* Utility class with an assortment of useful publishing file methods.
*
- * @since 3.0
+ * @since 1.1
*/
-public final class PublishHelper {
+public class PublishHelper {
// size of the buffer
private static final int BUFFER = 65536;
@@ -478,6 +478,10 @@
private void copyFile(IModuleFile mf, IPath path) throws CoreException {
Trace.trace(Trace.PUBLISHING, "Copying: " + mf.getName() + " to " + path.toString());
+ if(!isCopyFile(mf, path)){
+ return;
+ }
+
IFile file = (IFile) mf.getAdapter(IFile.class);
if (file != null)
copyFile(file.getContents(), path, file.getLocalTimeStamp(), mf);
@@ -492,6 +496,16 @@
copyFile(in, path, file2.lastModified(), mf);
}
}
+
+ /**
+ * Returns <code>true<code/> if the module file should be copied to the destination, <code>false</codre> otherwise.
+ * @param moduleFile the module file
+ * @param toPath destination.
+ * @return <code>true<code/>, if the module file should be copied
+ */
+ protected boolean isCopyFile(IModuleFile moduleFile, IPath toPath){
+ return true;
+ }
/**
* Publish the given module resources to the given path.
@@ -659,6 +673,43 @@
}
/**
+ * Accepts an IModuleResource array which is expected to contain a single
+ * IModuleFile resource and copies it to the specified path, which should
+ * include the name of the file to write. If the array contains more than
+ * a single resource or the resource is not an IModuleFile resource, the
+ * file is not created. Currently no error is returned, but error handling
+ * is recommended since that is expected to change in the future.
+ *
+ * @param resources an array containing a single IModuleFile resource
+ * @param path the path, including file name, where the file should be created
+ * @param monitor a progress monitor, or <code>null</code> if progress
+ * reporting and cancellation are not desired
+ * @return a possibly-empty array of error and warning status
+ */
+ public IStatus[] publishToPath(IModuleResource[] resources, IPath path, IProgressMonitor monitor) {
+ if (resources == null || resources.length == 0) {
+ // should also check if resources consists of all empty directories
+ File file = path.toFile();
+ if (file.exists())
+ file.delete();
+ return EMPTY_STATUS;
+ }
+
+ monitor = ProgressUtil.getMonitorFor(monitor);
+
+ if (resources.length == 1 && resources[0] instanceof IModuleFile) {
+ try {
+ copyFile((IModuleFile) resources[0], path);
+ }
+ catch (CoreException e) {
+ return new IStatus[] { e.getStatus() };
+ }
+ }
+
+ return EMPTY_STATUS;
+ }
+
+ /**
* Utility method to move a temp file into position by deleting the original and
* swapping in a new copy.
*
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishUtil.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishUtil.java
index 66e0247..483adfa 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishUtil.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/PublishUtil.java
@@ -67,6 +67,7 @@
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting and cancellation are not desired
* @return a possibly-empty array of error and warning status
+ * @since 1.1
*/
public static IStatus[] publishSmart(IModuleResource[] resources, IPath path, IPath[] ignore, IProgressMonitor monitor) {
return publishHelper.publishSmart(resources, path, ignore, monitor);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java
index 1c680db..9fa5996 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/SocketUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -37,7 +37,7 @@
protected static final Object lock = new Object();
- private static Set<String> localHostCache;
+ private static Set<String> localHostCache = new HashSet<String>();
private static Set<String> notLocalHostCache = new HashSet<String>();
private static Map<String, CacheThread> threadMap = new HashMap<String, CacheThread>();
@@ -64,8 +64,8 @@
Iterator iter2 = currentAddresses.iterator();
while (iter2.hasNext()) {
InetAddress addr = (InetAddress) iter2.next();
- String hostname = addr.getHostName();
- String hostname2 = addr.getCanonicalHostName();
+ String hostname = addr.getHostName().toLowerCase();
+ String hostname2 = addr.getCanonicalHostName().toLowerCase();
synchronized (lock) {
if (hostname != null && !addressList.contains(hostname))
addressList.add(hostname);
@@ -80,8 +80,8 @@
int length = addrs.length;
for (int j = 0; j < length; j++) {
InetAddress addr = addrs[0];
- String hostname = addr.getHostName();
- String hostname2 = addr.getCanonicalHostName();
+ String hostname = addr.getHostName().toLowerCase();
+ String hostname2 = addr.getCanonicalHostName().toLowerCase();
synchronized (lock) {
if (addr.isLoopbackAddress()) {
if (hostname != null && !addressList.contains(hostname))
@@ -116,26 +116,39 @@
}
/**
- * Finds an unused port between the given from and to values.
+ * Finds an unused local port between the given from and to values.
*
* @param low lowest possible port number
* @param high highest possible port number
* @return an unused port number, or <code>-1</code> if no used ports could be found
*/
public static int findUnusedPort(int low, int high) {
+ return findUnusedPort(null, low, high);
+ }
+
+ /**
+ * Finds an unused local port between the given from and to values.
+ *
+ * @param address a local InetAddress
+ * @param low lowest possible port number
+ * @param high highest possible port number
+ * @return an unused port number, or <code>-1</code> if no used ports could be found
+ * @since 1.1
+ */
+ public static int findUnusedPort(InetAddress address, int low, int high) {
if (high < low)
return -1;
for (int i = 0; i < 10; i++) {
int port = getRandomPort(low, high);
- if (!isPortInUse(port))
+ if (!isPortInUse(address, port))
return port;
}
return -1;
}
/**
- * Return a random port number in the given range.
+ * Return a random local port number in the given range.
*
* @param low lowest possible port number
* @param high highest possible port number
@@ -146,7 +159,7 @@
}
/**
- * Checks to see if the given port number is being used.
+ * Checks to see if the given local port number is being used.
* Returns <code>true</code> if the given port is in use, and <code>false</code>
* otherwise. Retries every 500ms for "count" tries.
*
@@ -156,14 +169,30 @@
* <code>false</code> otherwise
*/
public static boolean isPortInUse(int port, int count) {
- boolean inUse = isPortInUse(port);
+ return isPortInUse(null, port, count);
+ }
+
+ /**
+ * Checks to see if the given local port number is being used.
+ * Returns <code>true</code> if the given port is in use, and <code>false</code>
+ * otherwise. Retries every 500ms for "count" tries.
+ *
+ * @param address a local InetAddress
+ * @param port the port number to check
+ * @param count the number of times to retry
+ * @return boolean <code>true</code> if the port is in use, and
+ * <code>false</code> otherwise
+ * @since 1.1
+ */
+ public static boolean isPortInUse(InetAddress address, int port, int count) {
+ boolean inUse = isPortInUse(address, port);
while (inUse && count > 0) {
try {
Thread.sleep(500);
} catch (Exception e) {
// ignore
}
- inUse = isPortInUse(port);
+ inUse = isPortInUse(address, port);
count --;
}
@@ -171,7 +200,7 @@
}
/**
- * Checks to see if the given port number is being used.
+ * Checks to see if the given local port number is being used.
* Returns <code>true</code> if the given port is in use, and <code>false</code>
* otherwise.
*
@@ -180,9 +209,24 @@
* <code>false</code> otherwise
*/
public static boolean isPortInUse(int port) {
+ return isPortInUse(null, port);
+ }
+
+ /**
+ * Checks to see if the given local port number is being used.
+ * Returns <code>true</code> if the given port is in use, and <code>false</code>
+ * otherwise.
+ *
+ * @param address a local InetAddress
+ * @param port the port number to check
+ * @return boolean <code>true</code> if the port is in use, and
+ * <code>false</code> otherwise
+ * @since 1.1
+ */
+ public static boolean isPortInUse(InetAddress address, int port) {
ServerSocket s = null;
try {
- s = new ServerSocket(port);
+ s = new ServerSocket(port, 0, address);
} catch (SocketException e) {
return true;
} catch (IOException e) {
@@ -213,33 +257,49 @@
* quickly and the results of this call will be returned immediately.
* </p><p>
* On machines where the network configuration of the machine is bad or the
- * network has problems, this first method call will take at most 250ms, but
- * the results may be incorrect (incomplete).
+ * network has problems, the first call to this method will always return after
+ * 250ms, even if the caching is not complete. At that point it may return
+ * "false negative" results. (i.e. the method will return <code>false</code>
+ * even though it may later determine that the host address is a local host)
* </p><p>
* All subsequent calls (until the network configuration changes) will
* return very quickly. If the background process is still running it will
* continue to fill the cache and each subsequent call to this method may be
- * more correct.
+ * more correct/complete.
* </p>
*
* @param host a hostname or IP address
* @return <code>true</code> if the given host is localhost, and
* <code>false</code> otherwise
*/
- public static boolean isLocalhost(final String host) {
+ public static boolean isLocalhost(String host) {
if (host == null || host.equals(""))
return false;
- if ("localhost".equals(host) || "127.0.0.1".equals(host))
+ host = host.toLowerCase();
+ if ("localhost".equals(host) || "127.0.0.1".equals(host) || "::1".equals(host))
return true;
+ // check existing caches to see if the host is there
+ synchronized (lock) {
+ if (localHostCache.contains(host))
+ return true;
+ if (notLocalHostCache.contains(host))
+ return false;
+ }
+ InetAddress localHostaddr = null;
+
// check simple cases
try {
- InetAddress localHostaddr = InetAddress.getLocalHost();
- if (localHostaddr.getHostName().equals(host)
- || host.equals(localHostaddr.getCanonicalHostName())
- || localHostaddr.getHostAddress().equals(host))
+ localHostaddr = InetAddress.getLocalHost();
+ if (host.equals(localHostaddr.getHostName().toLowerCase())
+ || host.equals(localHostaddr.getCanonicalHostName().toLowerCase())
+ || host.equals(localHostaddr.getHostAddress().toLowerCase())){
+ synchronized (lock) {
+ localHostCache.add(host);
+ }
return true;
+ }
} catch (Exception e) {
Trace.trace(Trace.WARNING, "Localhost caching failure", e);
}
@@ -264,7 +324,10 @@
try {
// get network interfaces
final Set<InetAddress> currentAddresses = new HashSet<InetAddress>();
- currentAddresses.add(InetAddress.getLocalHost());
+
+ if(localHostaddr != null)
+ currentAddresses.add(localHostaddr);
+
Enumeration nis = NetworkInterface.getNetworkInterfaces();
while (nis.hasMoreElements()) {
NetworkInterface inter = (NetworkInterface) nis.nextElement();
@@ -286,7 +349,7 @@
Iterator iter = currentAddresses.iterator();
while (iter.hasNext()) {
InetAddress addr = (InetAddress) iter.next();
- String a = addr.getHostAddress();
+ String a = addr.getHostAddress().toLowerCase();
if (a != null && !localHostCache.contains(a))
localHostCache.add(a);
}
@@ -331,7 +394,11 @@
Trace.trace(Trace.WARNING, "Could not find localhost", e);
}
}
-
+ synchronized (lock) {
+ if(!notLocalHostCache.contains(host)){
+ notLocalHostCache.add(host);
+ }
+ }
return false;
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.wst.server.ui/.settings/org.eclipse.jdt.ui.prefs
index efd16be..f677818 100644
--- a/plugins/org.eclipse.wst.server.ui/.settings/org.eclipse.jdt.ui.prefs
+++ b/plugins/org.eclipse.wst.server.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -1,3 +1,6 @@
-#Fri Feb 23 21:15:26 EST 2007
+#Wed Apr 14 16:36:20 EDT 2010
eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.ondemandthreshold=4
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.staticondemandthreshold=4
diff --git a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
index 88b2dcf..68cbdf7 100644
--- a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.server.ui; singleton:=true
-Bundle-Version: 1.1.7.qualifier
+Bundle-Version: 1.1.205.qualifier
Bundle-Activator: org.eclipse.wst.server.ui.internal.ServerUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -14,9 +14,9 @@
org.eclipse.wst.server.ui.internal.audio;x-internal:=true,
org.eclipse.wst.server.ui.internal.command;x-internal:=true,
org.eclipse.wst.server.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.server.ui.internal.extension;x-internal:=true,
org.eclipse.wst.server.ui.internal.provisional;x-internal:=true,
org.eclipse.wst.server.ui.internal.view.servers;x-internal:=true,
+ org.eclipse.wst.server.ui.internal.cnf;x-internal:=true,
org.eclipse.wst.server.ui.internal.viewers;x-internal:=true,
org.eclipse.wst.server.ui.internal.webbrowser;x-internal:=true,
org.eclipse.wst.server.ui.internal.wizard;x-internal:=true,
@@ -26,6 +26,7 @@
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.core.expressions;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.wst.server.discovery;bundle-version="[1.0.0,2.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
@@ -36,8 +37,8 @@
org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.wst.server.core;bundle-version="[1.0.103,2.0.0)",
org.eclipse.wst.internet.monitor.core;bundle-version="[1.0.103,2.0.0)",
- org.eclipse.update.core;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.1.0,2.0.0)";resolution:=optional
+ org.eclipse.wst.common.project.facet.ui;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
+ org.eclipse.ui.navigator;bundle-version="3.3.100"
Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.server.ui.internal.webbrowser"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.wst.server.ui/build.properties b/plugins/org.eclipse.wst.server.ui/build.properties
index 5ee04b1..581da82 100644
--- a/plugins/org.eclipse.wst.server.ui/build.properties
+++ b/plugins/org.eclipse.wst.server.ui/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2004, 2007 IBM Corporation and others.
+# Copyright (c) 2004, 2009 IBM 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
@@ -14,8 +14,7 @@
icons/,\
.options,\
META-INF/,\
- about.html,\
- serverAdapterSites.xml
+ about.html
bin.excludes = bin/**,\
@dot/**,\
temp.folder/**
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_debug_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_debug_ovr.gif
new file mode 100644
index 0000000..835846c
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_debug_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_ovr.gif
new file mode 100644
index 0000000..6e1b6d8
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_profile_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_profile_ovr.gif
new file mode 100644
index 0000000..4df815e
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_started_profile_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting1_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting1_ovr.gif
new file mode 100644
index 0000000..b56b71f
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting1_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting2_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting2_ovr.gif
new file mode 100644
index 0000000..d064bfa
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting2_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting3_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting3_ovr.gif
new file mode 100644
index 0000000..8521cce
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_starting3_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopped_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopped_ovr.gif
new file mode 100644
index 0000000..836042e
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopped_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping1_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping1_ovr.gif
new file mode 100644
index 0000000..49cc1a4
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping1_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping2_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping2_ovr.gif
new file mode 100644
index 0000000..540a436
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping2_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping3_ovr.gif b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping3_ovr.gif
new file mode 100644
index 0000000..ee563f3
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/icons/ovr16/server_stopping3_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.properties b/plugins/org.eclipse.wst.server.ui/plugin.properties
index 49c1777..c876eda 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.properties
+++ b/plugins/org.eclipse.wst.server.ui/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2004, 2007 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM 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
@@ -17,7 +17,10 @@
extensionPointServerImages=Server Images
extensionPointWizardFragments=Wizard Fragments
extensionPointInitialSelectionProvider=Initial Selection Provider
+extensionPointServerLabelProvider=Server Label Provider
extensionPointAudio=Audio
+extensionPointServerCreationWizardPageExtension=Server Creation Wizard Page Extension
+extensionPointServerEditorOverviewPageExtension=Server Editor Overview Page Modifier
# --------------- Wizards and Views ---------------
@@ -27,6 +30,8 @@
newServerDescription=Define a new server
viewServers=Servers
+viewServers_old=Servers (deprecated)
+defaultProvider=Server and Module Provider
# --------------- Action Sets (toolbar icon groups) ---------------
@@ -93,6 +98,7 @@
moduleProjectDecoratorLabel=Module Project
moduleProjectDecoratorDescription=Decorates server modules with information on the project that they come from
+serverStateDecoratorLabel=Server State Decorator
# --------------- Action Sets (toolbar icon groups) ---------------
diff --git a/plugins/org.eclipse.wst.server.ui/plugin.xml b/plugins/org.eclipse.wst.server.ui/plugin.xml
index 15c6c8c..9baca0e 100644
--- a/plugins/org.eclipse.wst.server.ui/plugin.xml
+++ b/plugins/org.eclipse.wst.server.ui/plugin.xml
@@ -10,6 +10,9 @@
<extension-point id="initialSelectionProvider" name="%extensionPointInitialSelectionProvider" schema="schema/initialSelectionProvider.exsd"/>
<extension-point id="audio" name="%extensionPointAudio" schema="schema/audio.exsd"/>
<extension-point id="serverToolTip" name="%extensionPointServerToolTip" schema="schema/serverToolTip.exsd"/>
+ <extension-point id="serverCreationWizardPageExtension" name="%extensionPointServerCreationWizardPageExtension" schema="schema/serverCreationWizardPageExtension.exsd"/>
+ <extension-point id="serverEditorOverviewPageModifier" name="%extensionPointServerEditorOverviewPageExtension" schema="schema/serverEditorOverviewPageModifier.exsd"/>
+ <extension-point id="serverLabelProvider" name="%serverLabelProvider" schema="schema/serverLabelProvider.exsd"/>
<extension point="org.eclipse.ui.newWizards">
<category
@@ -31,12 +34,107 @@
id="org.eclipse.wst.server.ui"
name="%category"/>
+
<view
- id="org.eclipse.wst.server.ui.ServersView"
- name="%viewServers"
- category="org.eclipse.wst.server.ui"
- class="org.eclipse.wst.server.ui.internal.view.servers.ServersView"
- icon="icons/cview16/servers_view.gif"/>
+ allowMultiple="false"
+ category="org.eclipse.wst.server.ui"
+ class="org.eclipse.wst.server.ui.internal.cnf.ServersView2"
+ icon="icons/cview16/servers_view.gif"
+ id="org.eclipse.wst.server.ui.ServersView"
+ name="%viewServers">
+ </view>
+</extension>
+<extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ activeByDefault="true"
+ contentProvider="org.eclipse.wst.server.ui.internal.cnf.ServerContentProvider"
+ icon="icons/cview16/servers_view.gif"
+ id="org.eclipse.wst.server.ui.ServersView.content.root"
+ labelProvider="org.eclipse.wst.server.ui.internal.cnf.ServerLabelProvider"
+ name="%defaultProvider"
+ priority="highest">
+ <triggerPoints>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ </or>
+ </triggerPoints>
+ <possibleChildren>
+ <or>
+ <instanceof
+ value="java.lang.Object">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ </or>
+ </possibleChildren>
+ <actionProvider
+ class="org.eclipse.wst.server.ui.internal.cnf.ServerActionProvider"
+ id="org.eclipse.wst.server.ui.ServersView.ServerActionProvider"
+ priority="highest">
+ <enablement>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.core.resources.IWorkspaceRoot">
+ </instanceof>
+ <adapt
+ type="java.util.Collection">
+ <count
+ value="0">
+ </count>
+ </adapt>
+ </or>
+ </enablement>
+ </actionProvider>
+ <dropAssistant
+ class="org.eclipse.wst.server.ui.internal.cnf.ServersViewDropAdapterAssistant"
+ id="org.eclipse.wst.server.ui.ServersView.DropAssistant">
+ <possibleDropTargets>
+ <or>
+ <instanceof
+ value="java.lang.Object">
+ </instanceof>
+ </or>
+ </possibleDropTargets>
+ </dropAssistant>
+ </navigatorContent>
+</extension>
+
+<extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.wst.server.ui.ServersView">
+ <includes>
+ <contentExtension
+ isRoot="true"
+ pattern="org.eclipse.wst.server.ui.ServersView.content.root">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ <viewer
+ helpContext="org.eclipse.wst.server.ui.svcp0000"
+ viewerId="org.eclipse.wst.server.ui.ServersView">
+ <options>
+ <property name="org.eclipse.ui.navigator.hideLinkWithEditorAction"
+ value="true">
+ </property>
+ </options>
+ </viewer>
</extension>
<extension point="org.eclipse.ui.perspectiveExtensions">
@@ -504,11 +602,25 @@
priority="-999999"/>
</extension>
<extension
- point="org.eclipse.wst.server.core.saveEditorPrompter">
- <saveEditorPrompter
- class="org.eclipse.wst.server.ui.internal.SaveEditorPrompter"
- id="org.eclipse.wst.server.ui.saveEditorPrompter1">
- </saveEditorPrompter>
+ point="org.eclipse.ui.decorators">
+ <decorator
+ class="org.eclipse.wst.server.ui.internal.cnf.ServerDecorator"
+ icon="icons/obj16/server.gif"
+ id="org.eclipse.wst.server.ui.navigatorDecorator"
+ label="%serverStateDecoratorLabel"
+ lightweight="true"
+ location="BOTTOM_RIGHT"
+ state="true">
+ <enablement>
+ <or>
+ <objectClass
+ name="org.eclipse.wst.server.core.IServer">
+ </objectClass>
+ <objectClass
+ name="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </objectClass>
+ </or>
+ </enablement>
+ </decorator>
</extension>
-
</plugin>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd b/plugins/org.eclipse.wst.server.ui/schema/serverCreationWizardPageExtension.exsd
similarity index 62%
copy from plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
copy to plugins/org.eclipse.wst.server.ui/schema/serverCreationWizardPageExtension.exsd
index d3b83b5..52cc1ea 100644
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
+++ b/plugins/org.eclipse.wst.server.ui/schema/serverCreationWizardPageExtension.exsd
@@ -1,136 +1,138 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="internalProtocolAdapters" name="Protocol Adapters"/>
- </appInfo>
- <documentation>
- This extension point is used to provide an adapter for a new protocol (e.g. HTTP). This allows different types of protocols to be monitored in a specific way.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="protocolAdapter" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="protocolAdapter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate</samp>
-Protocol adapter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the protocol adapter
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a protocol adapter extension point to define a protocol adapter for TCP/IP:
-
-<pre>
- <extension
- point="org.eclipse.wst.internet.monitor.core.protocolAdapters">
- <protocolAdapter
- id="TCPIP"
- class="com.example.TCPIPProtocolAdapter"
- name="%TCPIP"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <code>org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate</code>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.server.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.wst.server.ui" id="serverCreationWizardPageExtension" name="Server Creation Wizard Page Extension"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a way to for adopters to modify the first page of the server creation wizard page. It provides mechanisms to add custom UI to different sections of the server creation wizard page. It also allow adopter to control the display of some existing UI on the server creation wizard page.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="serverCreationWizardPageExtension"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="serverCreationWizardPageExtension">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="name"/>
+ </appInfo>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a unique identifier for this extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.server.ui.wizard.ServerCreationWizardPageExtension</samp>. The class must have a public 0-arg constructor.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.wizard.ServerCreationWizardPageExtension:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <code>org.eclipse.wst.server.ui.editor.ServerCreationWizardPageExtension</code>.
+
+This extension point currently only supports the control on the following fields on the implementation of org.eclipse.wst.server.ui.AbstractUIControl.IUIControlListener.handleUIControlMapChanged(Map<String, UIControlEntry>):
+Server's host name
+
+This extension point currently only issue property change event on the following property change:
+Server type selection change
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ 3.2
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ The following is an example of the extension point:
+
+<pre>
+ <extension
+ point="org.eclipse.wst.server.ui.serverCreationWizardPageExtension">
+ <serverCreationWizardPageExtension
+ id="org.eclipse.wst.server.ui.test.serverCreationWizardPageExtension"
+ class="org.eclipse.wst.server.ui.test.internal.serverCreationWizardPageExtension.ServerCreationWizardPageExtensionTest"/>
+ </extension>
+</pre>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2009 IBM Corporation and others.<br>
+All rights reserved. This program and the accompanying materials are made
+available under the terms of the Eclipse Public License v1.0 which accompanies
+this distribution, and is available at
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/schema/serverEditorOverviewPageModifier.exsd b/plugins/org.eclipse.wst.server.ui/schema/serverEditorOverviewPageModifier.exsd
new file mode 100644
index 0000000..9bf999f
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/schema/serverEditorOverviewPageModifier.exsd
@@ -0,0 +1,132 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.server.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.wst.server.ui" id="serverEditorOverviewPageModifier" name="Server Editor Overview Page Modifier"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a way for adopters to modify controls on the server editor Overview page. It provides a mechanism to allow modify the display of some existing UI on the Overview page.
+
+This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="serverEditorOverviewPageModifier"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="serverEditorOverviewPageModifier">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="name"/>
+ </appInfo>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a unique identifier for this extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.server.ui.editor.ServerEditorOverviewPageModifier</samp>. The class must have a public 0-arg constructor.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.editor.ServerEditorOverviewPageModifier:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 3.2
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ The following is an example of the extension point:
+
+<pre>
+ <extension
+ point="org.eclipse.wst.server.ui.serverEditorPageExtension">
+ <serverEditorOverviewPageModifier
+ id="org.eclipse.wst.server.ui.test.serverEditorOverviewModifier"
+ class="org.eclipse.wst.server.ui.test.internal.serverEditorPageExtension.ServerEditorOverviewPageModifierTest"/>
+ </extension>
+</pre>
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2010 IBM Corporation and others.<br>
+All rights reserved. This program and the accompanying materials are made
+available under the terms of the Eclipse Public License v1.0 which accompanies
+this distribution, and is available at
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <code>org.eclipse.wst.server.ui.editor.ServerEditorPageExtension</code>.
+
+This extension point currently only supports the control on the following fields on the implementation of org.eclipse.wst.server.ui.AbstractUIControl.IUIControlListener.handleUIControlMapChanged(Map<String, UIControlEntry>):
+Server's host name
+
+This extension point currently only issue property change event on the following property change:
+Server type selection change
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd b/plugins/org.eclipse.wst.server.ui/schema/serverLabelProvider.exsd
similarity index 63%
rename from plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
rename to plugins/org.eclipse.wst.server.ui/schema/serverLabelProvider.exsd
index d3b83b5..51fe81c 100644
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
+++ b/plugins/org.eclipse.wst.server.ui/schema/serverLabelProvider.exsd
@@ -1,136 +1,133 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="internalProtocolAdapters" name="Protocol Adapters"/>
- </appInfo>
- <documentation>
- This extension point is used to provide an adapter for a new protocol (e.g. HTTP). This allows different types of protocols to be monitored in a specific way.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="protocolAdapter" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="protocolAdapter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate</samp>
-Protocol adapter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the protocol adapter
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a protocol adapter extension point to define a protocol adapter for TCP/IP:
-
-<pre>
- <extension
- point="org.eclipse.wst.internet.monitor.core.protocolAdapters">
- <protocolAdapter
- id="TCPIP"
- class="com.example.TCPIPProtocolAdapter"
- name="%TCPIP"/>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <code>org.eclipse.wst.internet.monitor.core.internal.ProtocolAdapterDelegate</code>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.server.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.wst.server.ui" id="serverLabelProvider" name="Server Label Provider"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a way to customize the text label for a particular server type
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="serverLabelProvider" 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="serverLabelProvider">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="name"/>
+ </appInfo>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a unique identifier for this extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.server.ui.internal.provisional.AbstractServerLabelProvider</samp>. The class must have a public 0-arg constructor.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.wst.server.ui.internal.provisional.AbstractServerLabelProvider:"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="serverTypes" type="string" use="required">
+ <annotation>
+ <documentation>
+ The Server Types that this Server Label Provider will respond to. A comma separate list can be provider for more than one Server Type
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 3.2.2
+ </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>
+ <b>This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.</b>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2010 IBM Corporation and others.<br>
+All rights reserved. This program and the accompanying materials are made
+available under the terms of the Eclipse Public License v1.0 which accompanies
+this distribution, and is available at
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.server.ui/serverAdapterSites.xml b/plugins/org.eclipse.wst.server.ui/serverAdapterSites.xml
deleted file mode 100644
index 54ec5e0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverAdapterSites.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<extensions>
- <site url="http://www.apache.org/dist/geronimo/eclipse/updates/"/>
- <site url="http://download.boulder.ibm.com/ibmdl/pub/software/websphere/wasce/updates/"/>
- <site url="http://www.pramati.com/downloads/eclipse/updates/"/>
- <site url="http://update.eclipse.org/updates/3.3/"/>
- <site url="http://download.oracle.com/otn_software/oepe/ganymede/wls-adapter/"/>
- <site url="https://ajax.dev.java.net/eclipse"/>
- <site url="https://www.sdn.sap.com/downloads/updates/netweaver/nwds/sapnwserver/"/>
- <site url="http://www.webtide.com/eclipse"/>
-</extensions>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/AbstractUIControl.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/AbstractUIControl.java
new file mode 100644
index 0000000..fae84ef
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/AbstractUIControl.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui;
+
+import java.beans.PropertyChangeEvent;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Abstract UI control that allows adopter to control the UI
+ */
+public abstract class AbstractUIControl {
+ // Control map describing the UI that needs to be controlled.
+ public Map<String, UIControlEntry> controlMap = new HashMap<String, UIControlEntry>();
+ // UI Control listener that listens to changes in event on GUI provided by this UI control
+ public IUIControlListener controlListener;
+
+ // The list of properties supported by the existing UI control.
+ public static final String PROP_HOSTNAME = "PROP_HOSTNAME";
+ public static final String PROP_SERVER_TYPE = "PROP_SERVERTYPE";
+
+ /**
+ * UI Control listener that listens to changes in event on GUI provided by this UI control
+ * IUIControlListener
+ */
+ public interface IUIControlListener {
+ /**
+ * Handle the UI control map change by the listener based on the given control map.
+ * @param controlMap the control map that describes the UI control.
+ */
+ public void handleUIControlMapChanged(Map<String, UIControlEntry> controlMap);
+ /**
+ * Get the value of a given control UI on the listener's page.
+ * @param controlId control ID of the UI on the listener's page.
+ * @return the String value of the given control ID field.
+ */
+ public String getControlStringValue(String controlId);
+ }
+
+ /**
+ * UI control entry class that describes the behaviour of the UI control of specific fields or widget.
+ */
+ public class UIControlEntry {
+ private boolean isEnabled;
+ private String newTextValue;
+
+ public UIControlEntry(boolean curIsEnabled, String curNewTextValue) {
+ isEnabled = curIsEnabled;
+ newTextValue = curNewTextValue;
+ }
+
+ /**
+ * Gives the new text value of the given field.
+ * @return the new text value of the given field. If the value returns <code>null</code>, then it means
+ * the field do not need to be modified.
+ */
+ public String getNewTextValue() {
+ return newTextValue;
+ }
+
+ /**
+ * Return if the UI control needs to be enabled.
+ * @return true if value needs to be enabled; otherwise, return false.
+ */
+ public boolean isEnabled() {
+ return isEnabled;
+ }
+ }
+
+ /**
+ * Fire the control change event for the changed control map to take effect.
+ */
+ protected void fireUIControlChangedEvent() {
+ if (controlListener != null) {
+ controlListener.handleUIControlMapChanged(controlMap);
+ }
+ }
+
+ /**
+ * Allow UI Control to react based on a property change and change the UI control.
+ * @param event property change event that describes the change.
+ */
+ public abstract void handlePropertyChanged(PropertyChangeEvent event);
+
+ /**
+ * Set the UI control listener that listens to the changes initialed by this UI control.
+ * @param curControlListener the UI control listener
+ */
+ public void setUIControlListener(IUIControlListener curControlListener) {
+ controlListener = curControlListener;
+ }
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java
index 79c9217..5f04206 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java
@@ -16,7 +16,7 @@
* A helper interface for modules that are deployed to a server, commonly
* used to help actions interact with modules in the Servers view.
*
- * @since 3.0
+ * @since 1.1
*/
public interface IServerModule {
/**
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java
index e13fad0..b995481 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/ServerLaunchConfigurationTab.java
@@ -133,19 +133,19 @@
}
}
}
-
+
// select first item in list
if (serverCombo.getItemCount() > 0)
serverCombo.select(0);
-
+
handleServerSelection();
-
+
serverCombo.forceFocus();
-
+
Dialog.applyDialogFont(composite);
setControl(composite);
}
-
+
private boolean isSupportedServer(String serverTypeId) {
if (serverTypeIds == null)
return true;
@@ -156,13 +156,13 @@
}
return false;
}
-
+
private static boolean matches(String a, String b) {
if (a == null || b == null || "*".equals(a) || "*".equals(b) || a.startsWith(b) || b.startsWith(a))
return true;
return false;
}
-
+
/**
* Called when a server is selected.
* This method should not be called directly.
@@ -226,10 +226,14 @@
*/
public void initializeFrom(ILaunchConfiguration configuration) {
serverCombo.setEnabled(true);
- //remove error message that other instances may have set
+ // remove error message that other instances may have set
setErrorMessage(null);
try {
+ // bug 137822 - set the ILaunchConfigurationWorkingCopy wc variable before calling the method handleServerSelection()
+ //if (configuration instanceof ILaunchConfigurationWorkingCopy)
+ // wc = (ILaunchConfigurationWorkingCopy)configuration;
+
String serverId = configuration.getAttribute(Server.ATTR_SERVER_ID, "");
if (serverId != null && !serverId.equals("")) {
server = ServerCore.findServer(serverId);
@@ -248,6 +252,8 @@
if (serverCombo.getItemCount() > 0)
serverCombo.select(0);
}
+ handleServerSelection();
+
// flag should only be set if launch has been attempted on the config
if (configuration.getAttribute(READ_ONLY, false))
serverCombo.setEnabled(false);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java
new file mode 100644
index 0000000..fe9488a
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.editor;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.ui.AbstractUIControl;
+
+/**
+ * A modifier class that allows adopter to modify the behaviour of a UI control on the
+ * server editor page(s).
+ *
+ * ServerEditorOverviewPageModifier
+ */
+public abstract class ServerEditorOverviewPageModifier extends AbstractUIControl {
+ protected IServerWorkingCopy serverWc = null;
+
+
+ /**
+ * The list of editor sections on the server editors that allow inserting custom GUI.
+ * UI_POSITION
+ */
+ public enum UI_LOCATION { OVERVIEW, OTHER }
+
+
+ /**
+ * Create the customer UI on the specified server editor part, either general or other.
+ * @param position the position on the server creation wizard page that allows inserting custom GUI.
+ * @param parent parent composite.
+ * @param location
+ */
+ public abstract void createControl(UI_LOCATION location, Composite parent);
+
+
+ /**
+ * Set the server working copy to the control to allow extension to store the extension values.
+ * @param curServerWc
+ */
+ public void setServerWorkingCopy(IServerWorkingCopy curServerWc) {
+ serverWc = curServerWc;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
index 6aad065..bb8fa61 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorPart.java
@@ -96,7 +96,7 @@
* Set the managed form that this part is using.
*
* @param managedForm a managed form
- * @since 3.0
+ * @since 1.1
*/
protected void setManagedForm(IManagedForm managedForm) {
this.managedForm = managedForm;
@@ -108,7 +108,7 @@
*
* @return managedForm the managed form that this part is using, or <code>null</code>
* if no managed form has been set
- * @since 3.0
+ * @since 1.1
*/
protected IManagedForm getManagedForm() {
return managedForm;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
index bd5dae5..88824d8 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorSection.java
@@ -161,7 +161,7 @@
*
* @return the managed form that the editor is using, or <code>null</code> if no
* managed form has been set
- * @since 3.0
+ * @since 1.1
*/
protected IManagedForm getManagedForm() {
return editor.getManagedForm();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java
index 5ccd95d..7d9f729 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ContextIds.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -63,10 +63,13 @@
public static final String EDITOR_HOSTNAME = ServerUIPlugin.PLUGIN_ID + ".seop0006";
public static final String EDITOR_RUNTIME = ServerUIPlugin.PLUGIN_ID + ".seop0008";
public static final String EDITOR_AUTOPUBLISH_ENABLE = ServerUIPlugin.PLUGIN_ID + ".seop0012";
+ public static final String EDITOR_AUTOPUBLISH_BUILD = ServerUIPlugin.PLUGIN_ID + ".seop0014";
public static final String EDITOR_AUTOPUBLISH_DISABLE = ServerUIPlugin.PLUGIN_ID + ".seop0016";
- public static final String EDITOR_PUBLISHTASKS_CONFIGURATION = ServerUIPlugin.PLUGIN_ID + ".seop0018";
- public static final String EDITOR_TIMEOUT_START = ServerUIPlugin.PLUGIN_ID + "spge0026";
- public static final String EDITOR_TIMEOUT_STOP = ServerUIPlugin.PLUGIN_ID + "spge0027";
+ public static final String EDITOR_AUTOPUBLISH_INTERVAL= ServerUIPlugin.PLUGIN_ID + ".seop0018";
+ public static final String EDITOR_PUBLISHTASKS_CONFIGURATION = ServerUIPlugin.PLUGIN_ID + ".seop0020";
+
+ public static final String EDITOR_TIMEOUT_START = ServerUIPlugin.PLUGIN_ID + ".spge0026";
+ public static final String EDITOR_TIMEOUT_STOP = ServerUIPlugin.PLUGIN_ID + ".spge0027";
public static final String AUDIO_PREFERENCES = ServerUIPlugin.PLUGIN_ID + ".aupr0000";
public static final String AUDIO_PREFERENCES_ENABLE = ServerUIPlugin.PLUGIN_ID + ".aupr0002";
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultMonitorDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultMonitorDelegate.java
index e8fca29..279ddbb 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultMonitorDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultMonitorDelegate.java
@@ -76,7 +76,7 @@
try {
IMonitor monitor = monitors.get(port);
int mport = -1;
- if (monitor == null || monitor.getLocalPort() != monitorPort) {
+ if (monitor == null) {
mport = monitorPort;
if (mport == -1)
mport = SocketUtil.findUnusedPort(5000, 15000);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java
index 3c25b6a..b0868ad 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerImageDescriptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -17,6 +17,7 @@
/**
* A OverlayImageDescriptor consists of a main icon and one or more overlays.
* The overlays are computed according to flags set on creation of the descriptor.
+ * @deprecated since 3.2.2
*/
public class DefaultServerImageDescriptor extends CompositeImageDescriptor {
private Image fBaseImage;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java
index 7b3eab3..c9671eb 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/DefaultServerLabelDecorator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -22,6 +22,7 @@
import org.eclipse.wst.server.core.internal.Server;
/**
*
+ * @deprecated since 3.2.2
*/
public class DefaultServerLabelDecorator implements ILabelDecorator {
protected Map<Object, Image> map = new HashMap<Object, Image>();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/GeneralToolTip.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/GeneralToolTip.java
index e73c37b..9f87b40 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/GeneralToolTip.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/GeneralToolTip.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007,2010 IBM 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
@@ -25,6 +25,7 @@
public void createContent(Composite parent, IServer server) {
Text text = new Text(parent,SWT.NONE);
text.setBackground(parent.getBackground());
+ text.setEditable(false);
String s = "";
if (server.getRuntime() != null)
s += server.getRuntime().getName() + " - ";
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ImageResource.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ImageResource.java
index cc365e3..ba037d9 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ImageResource.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ImageResource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -109,7 +109,21 @@
public static final String IMG_SERVER_STATE_STOPPING_1 = "stateStopping1";
public static final String IMG_SERVER_STATE_STOPPING_2 = "stateStopping2";
public static final String IMG_SERVER_STATE_STOPPING_3 = "stateStopping3";
+
+ public static final String IMG_SERVER_STATE_STARTED_OVERLAY = "stateStartedOverlay";
+ public static final String IMG_SERVER_STATE_STARTED_DEBUG_OVERLAY = "stateStartedDebugOverlay";
+ public static final String IMG_SERVER_STATE_STARTED_PROFILE_OVERLAY = "stateStartedProfileOverlay";
+ public static final String IMG_SERVER_STATE_STOPPED_OVERLAY = "stateStoppedOverlay";
+
+ public static final String IMG_SERVER_STATE_STARTING_1_OVERLAY = "stateStartingOverlay1";
+ public static final String IMG_SERVER_STATE_STARTING_2_OVERLAY = "stateStartingOverlay2";
+ public static final String IMG_SERVER_STATE_STARTING_3_OVERLAY = "stateStartingOverlay3";
+
+ public static final String IMG_SERVER_STATE_STOPPING_1_OVERLAY = "stateStoppingOverlay1";
+ public static final String IMG_SERVER_STATE_STOPPING_2_OVERLAY = "stateStoppingOverlay2";
+ public static final String IMG_SERVER_STATE_STOPPING_3_OVERLAY = "stateStoppingOverlay3";
+
// Server Client Images
public static final String IMG_CTOOL_RUN_ON_SERVER = "IMG_CTOOL_CLIENT";
public static final String IMG_CTOOL_DEBUG_ON_SERVER = "IMG_CTOOL_CLIENT2";
@@ -229,7 +243,7 @@
registerImage(IMG_DTOOL_MODIFY_MODULES, URL_DTOOL + "wiz_modify_modules.gif");
registerImage(IMG_DTOOL_RESET_DEFAULT, URL_DTOOL + "clear.gif");
- // load server state images
+ // load server state images no overlay, still used in the Run On Server
registerImage(IMG_SERVER_STATE_STARTED, URL_OBJ + "server_started.gif");
registerImage(IMG_SERVER_STATE_STARTED_DEBUG, URL_OBJ + "server_started_debug.gif");
registerImage(IMG_SERVER_STATE_STARTED_PROFILE, URL_OBJ + "server_started_profile.gif");
@@ -246,6 +260,20 @@
registerImage(IMG_SERVER_STATE_STOPPING_2, URL_OBJ + "server_stopping2.gif");
registerImage(IMG_SERVER_STATE_STOPPING_3, URL_OBJ + "server_stopping3.gif");
+ // load server state images overlay
+ registerImage(IMG_SERVER_STATE_STARTED_OVERLAY, URL_OVR + "server_started_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STARTED_DEBUG_OVERLAY, URL_OVR + "server_started_debug_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STARTED_PROFILE_OVERLAY, URL_OVR + "server_started_profile_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STOPPED_OVERLAY, URL_OVR + "server_stopped_ovr.gif");
+
+ registerImage(IMG_SERVER_STATE_STARTING_1_OVERLAY, URL_OVR + "server_starting1_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STARTING_2_OVERLAY, URL_OVR + "server_starting2_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STARTING_3_OVERLAY, URL_OVR + "server_starting3_ovr.gif");
+
+ registerImage(IMG_SERVER_STATE_STOPPING_1_OVERLAY, URL_OVR + "server_stopping1_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STOPPING_2_OVERLAY, URL_OVR + "server_stopping2_ovr.gif");
+ registerImage(IMG_SERVER_STATE_STOPPING_3_OVERLAY, URL_OVR + "server_stopping3_ovr.gif");
+
// load action images
registerImage(IMG_ELCL_PUBLISH, URL_ELCL + "launch_publish.gif");
registerImage(IMG_ELCL_START, URL_ELCL + "launch_run.gif");
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
index 79f2f7a..f4dbcec 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -194,6 +194,7 @@
public static String wizNewServerRunOnServerDescription;
public static String wizNewServerSelect;
public static String wizNewServerManual;
+ public static String wizCheckRemoteSupport;
public static String wizSelectServerPreferred;
public static String wizNewServerExisting;
public static String wizNewServerRuntime;
@@ -285,7 +286,8 @@
public static String serverEditorOverviewPublishSection;
public static String serverEditorOverviewPublishDescription;
public static String serverEditorOverviewAutoPublishDisable;
- public static String serverEditorOverviewAutoPublishEnabled;
+ public static String serverEditorOverviewAutoPublishEnabledResource;
+ public static String serverEditorOverviewAutoPublishEnabledBuild;
public static String serverEditorOverviewAutoPublishEnabledInterval;
public static String serverEditorOverviewPublishCommand;
public static String serverEditorOverviewTimeoutSection;
@@ -299,13 +301,16 @@
public static String serverEditorOverviewRuntimeCommand;
public static String serverEditorOverviewOpenLaunchConfiguration;
public static String errorMissingConfiguration;
+ public static String errorConfigurationNotAccessible;
public static String viewStatusStarting4;
public static String viewStatusStarted2;
public static String viewStatusStopping4;
public static String viewStatusStopped2;
+ public static String viewStatusStarting;
public static String viewStatusStarting1;
public static String viewStatusStarting2;
public static String viewStatusStarting3;
+ public static String viewStatusStopping;
public static String viewStatusStopping1;
public static String viewStatusStopping2;
public static String viewStatusStopping3;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
index 08b92ba..0614651 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2004, 2008 IBM Corporation and others.
+# Copyright (c) 2004, 2010 IBM 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
@@ -21,6 +21,7 @@
wizNewServerRunOnServerDescription=Select which server to use
wizNewServerRuntime=Server &runtime environment:
wizNewServerRuntimeCreate=Create a new runtime environment
+wizCheckRemoteSupport=The currently selected server type does not support remote hosts
wizNewServerSelect=How do you want to select the server?
wizNewServerExisting=Choose an e&xisting server
@@ -73,12 +74,12 @@
wizLicenseNone=Feature does not contain a license.
# Add/Remove Modules
-wizModuleWizardTitle=Add and Remove Projects
-wizModuleTitle=Add and Remove Projects
-wizModuleDescription=Modify the projects that are configured on the server
-wizModuleMessage=Move projects to the right to configure them on the server
-wizModuleAvailableList=&Available projects:
-wizModuleDeployedList=&Configured projects:
+wizModuleWizardTitle=Add and Remove...
+wizModuleTitle=Add and Remove
+wizModuleDescription=Modify the resources that are configured on the server
+wizModuleMessage=Move resources to the right to configure them on the server
+wizModuleAvailableList=&Available:
+wizModuleDeployedList=&Configured:
wizModuleAdd=A&dd >
wizModuleAddAll=Add A&ll >>
wizModuleRemove=< &Remove
@@ -139,9 +140,9 @@
actionPublish=Publish
actionPublishToolTip=Publish to the server
actionPublishClean=&Clean...
-actionPublishCleanToolTip=Clean projects on the server
-actionModifyModules=Add and Remove &Projects...
-actionModifyModulesToolTip=Add and remove projects
+actionPublishCleanToolTip=Clean resources on the server
+actionModifyModules=&Add and Remove...
+actionModifyModulesToolTip=Add and Remove resources to the server
actionRestartModule=&Restart
actionStartModule=&Start
actionStopModule=S&top
@@ -156,10 +157,12 @@
viewStatusStartedProfile=Profiling
viewStatusStopped=Stopped
+viewStatusStarting=Starting
viewStatusStarting1=Starting.
viewStatusStarting2=Starting..
viewStatusStarting3=Starting...
+viewStatusStopping=Stopping
viewStatusStopping1=Stopping.
viewStatusStopping2=Stopping..
viewStatusStopping3=Stopping...
@@ -328,7 +331,7 @@
dialogMonitorContentTypeWebServices=WebServices
dialogMonitorNone=<none>
-dialogPublishClean=Clean will discard all publish state and republish from scratch. Are you sure you want to clean all published projects?
+dialogPublishClean=Clean will discard all publish state and republish from scratch. Are you sure you want to clean all published resources?
start=Start
stop=Stop
@@ -346,9 +349,9 @@
dialogRuntimeSearchProgress=Searching for server runtime environments...
# Can't add remove
-dialogAddRemoveModulesNone=There are no projects that can be added or removed from the server.
+dialogAddRemoveModulesNone=There are no resources that can be added or removed from the server.
-dialogRemoveModuleConfirm=Are you sure you want to remove the project from the server?
+dialogRemoveModuleConfirm=Are you sure you want to remove the resource from the server?
# --------------- Misc UI ---------------
@@ -393,6 +396,7 @@
errorEditor=Could not open editor because {0} is not a valid server. Use Open With to open this file with a different editor.
errorVersionLevel=The server does not support version {1} of the {0} specification.
errorMissingConfiguration=The server configuration is missing or invalid
+errorConfigurationNotAccessible=The server configuration is not accessible. The {0} project is closed.
errorRootModule=Could not find a valid parent module to add to the server.
errorDuplicateName=The name is already in use. Specify a different name.
@@ -443,10 +447,11 @@
serverEditorOverviewPublishSection=Publishing
serverEditorOverviewPublishDescription=Modify settings for publishing.
serverEditorOverviewAutoPublishDisable=Never publish automatically
-serverEditorOverviewAutoPublishEnabled=Automatically publish when resources change
+serverEditorOverviewAutoPublishEnabledResource=Automatically publish when resources change
+serverEditorOverviewAutoPublishEnabledBuild=Automatically publish after a build event
serverEditorOverviewAutoPublishEnabledInterval=Publishing interval (in seconds):
serverEditorOverviewPublishCommand=modify publish settings
-serverEditorOverviewPublishers=Select enabled publishers:
+serverEditorOverviewPublishers=Select publishing actions:
serverEditorOverviewTimeoutSection=Timeouts
serverEditorOverviewTimeoutDescription=Specify the time limit to complete server operations.
serverEditorOverviewStartTimeout=Start (in seconds):
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/SaveEditorPrompter.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/SaveEditorPrompter.java
deleted file mode 100644
index ccd204a..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/SaveEditorPrompter.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal;
-
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-
-public class SaveEditorPrompter extends
- org.eclipse.wst.server.core.internal.SaveEditorPrompter {
-
- private String cachedSaveBeforeLaunch;
-
- @Override
- public void saveAllEditors() {
- IWorkbench w = PlatformUI.getWorkbench();
- String saveBeforeLaunch = DebugUITools.getPreferenceStore().getString(org.eclipse.debug.internal.ui.IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
- if (saveBeforeLaunch.equalsIgnoreCase(org.eclipse.jface.dialogs.MessageDialogWithToggle.ALWAYS)){
- Display d =PlatformUI.getWorkbench().getDisplay();
- d.asyncExec(new SaveAllEditorsRunnable(w,false));
- }
- else if (saveBeforeLaunch.equalsIgnoreCase(org.eclipse.jface.dialogs.MessageDialogWithToggle.PROMPT)){
- Display d =PlatformUI.getWorkbench().getDisplay();
- d.asyncExec(new SaveAllEditorsRunnable(w,true));
- }
- }
-
- private class SaveAllEditorsRunnable implements Runnable{
- IWorkbench w;
- boolean confirm;
- public SaveAllEditorsRunnable(IWorkbench w, boolean confirm){
- this.w = w;
- this.confirm = confirm;
- }
-
- public void run() {
- w.saveAllEditors(confirm);
- }
- }
-
- /**
- * Sets <code>org.eclipse.debug.internal.ui.IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</code> to
- * the given value. The given value should be one of the following:
- * <ul>
- * <li><code>org.eclipse.jface.dialogs.MessageDialogWithToggle.ALWAYS</code></li>
- * <li><code>org.eclipse.jface.dialogs.MessageDialogWithToggle.NEVER</code></li>
- * <li><code>org.eclipse.jface.dialogs.MessageDialogWithToggle.PROMPT</code></li>
- * </ul>
- * @see org.eclipse.jface.dialogs.MessageDialogWithToggle
- */
- public String setDebugSaveBeforeLaunching(String newValue){
- IPreferenceStore debugPrefs = DebugUITools.getPreferenceStore();
- String oldValue = debugPrefs.getString(org.eclipse.debug.internal.ui.IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
- debugPrefs.setValue(org.eclipse.debug.internal.ui.IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH, newValue);
- return oldValue;
- }
-
- public void setDebugNeverSave(){
- cachedSaveBeforeLaunch = setDebugSaveBeforeLaunching(org.eclipse.jface.dialogs.MessageDialogWithToggle.NEVER);
- }
-
- public void setDebugOriginalValue(){
- if (cachedSaveBeforeLaunch == null){
- cachedSaveBeforeLaunch = org.eclipse.jface.dialogs.MessageDialogWithToggle.PROMPT;
- }
- setDebugSaveBeforeLaunching(cachedSaveBeforeLaunch);
- }
-}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java
index 1cd741d..f78e219 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -28,7 +28,7 @@
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.IClient;
-import org.eclipse.wst.server.core.internal.Trace;
+import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
/**
* A label provider for all server related objects.
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerToolTip.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerToolTip.java
index ea16e5d..b1237ff 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerToolTip.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerToolTip.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM 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
@@ -30,7 +30,6 @@
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Trace;
import org.eclipse.wst.server.ui.IServerModule;
import org.eclipse.wst.server.ui.internal.provisional.IServerToolTip;
@@ -154,11 +153,12 @@
FillLayout layout = (FillLayout)parent.getLayout();
layout.type = SWT.VERTICAL;
parent.setLayout(layout);
+ parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
// set the default text for the tooltip
StyledText sText = new StyledText(parent, SWT.NONE);
sText.setEditable(false);
- sText.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ sText.setBackground(parent.getBackground());
if (module != null) {
IModule[] modules = module.getModule();
@@ -168,7 +168,7 @@
StyledText sText2 = new StyledText(parent, SWT.NONE);
sText2.setEditable(false);
- sText2.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ sText2.setBackground(parent.getBackground());
sText2.setText(m.getModuleType().getName());
}
@@ -179,13 +179,9 @@
if (server.getServerType() != null) {
ArrayList<IServerToolTip> listOfProviders = toolTipProviders.get(server.getServerType().getId());
- final Composite adoptersComposite = new Composite(parent,SWT.NONE);
- adoptersComposite.setLayout(new FillLayout());
- adoptersComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
if (listOfProviders != null) {
for (IServerToolTip tipProvider : listOfProviders) {
- tipProvider.createContent(adoptersComposite,server);
+ tipProvider.createContent(parent,server);
}
}
}
@@ -248,27 +244,28 @@
for (int i=0; i < extensions.length; i++){
IConfigurationElement exElement = extensions[i];
- // Sort the extensions based on serverType
- String exServerType = exElement.getAttribute("serverTypes");
-
- for (IServerType serverType : serverTypes) {
- if (exServerType.compareTo("*") == 0 ||
- exServerType.startsWith(serverType.getId()) == true) {
- try {
+ try {
+ // sort the extensions based on serverType
+ String exServerType = exElement.getAttribute("serverTypes");
+
+ for (IServerType serverType : serverTypes) {
+ if ("*".equals(exServerType) || serverType.getId().matches(exServerType)) {
IServerToolTip exTooltip = (IServerToolTip) exElement.createExecutableExtension("class");
ArrayList<IServerToolTip> listOfProviders = new ArrayList<IServerToolTip>();
- if (toolTipProviders.containsKey(serverType)) {
- listOfProviders = toolTipProviders.get(serverType);
- }
+ if (toolTipProviders.containsKey(serverType.getId()))
+ listOfProviders = toolTipProviders.get(serverType.getId());
+
listOfProviders.add(exTooltip);
toolTipProviders.put(serverType.getId(), listOfProviders);
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Tooltip failed to load" + extensions[i].toString(), e);
+ Trace.trace(Trace.EXTENSION_POINT, " Loaded serverToolTip: " + exElement.getAttribute("id")
+ + " for server type: " + serverType.getId());
}
- Trace.trace(Trace.EXTENSION_POINT, " Loaded serverToolTip: " + extensions[i].getAttribute("id"));
}
+ } catch (CoreException e) {
+ Trace.trace(Trace.SEVERE, "Tooltip failed to load" + exElement.toString(), e);
}
}
+ Trace.trace(Trace.EXTENSION_POINT, "-<- Done loading serverToolTip extension point -<-");
}
// read the createFocusedTooltip method for information on why this is commented out
@@ -276,7 +273,7 @@
// protected class StickyTipMouseListener implements MouseListener{
//
// public void mouseDoubleClick(MouseEvent e) {
-// // TODO Auto-generated method stub
+// // Auto-generated method stub
//
// }
//
@@ -291,9 +288,7 @@
// }
//
// public void mouseUp(MouseEvent e) {
-// // TODO Auto-generated method stub
-//
+// // Auto-generated method stub
// }
-//
// }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
index 5d09bdc..40b12c1 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -10,12 +10,7 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
+import java.util.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -25,35 +20,29 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.*;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.*;
-import org.eclipse.wst.server.core.internal.Trace;
import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
import org.eclipse.wst.server.core.util.PublishAdapter;
+import org.eclipse.wst.server.ui.editor.ServerEditorOverviewPageModifier;
import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
import org.eclipse.wst.server.ui.internal.editor.IServerEditorInput;
import org.eclipse.wst.server.ui.internal.editor.ServerEditorCore;
import org.eclipse.wst.server.ui.internal.editor.ServerEditorInput;
+import org.eclipse.wst.server.ui.internal.provisional.AbstractServerLabelProvider;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
import org.eclipse.wst.server.ui.internal.viewers.InitialSelectionProvider;
import org.eclipse.wst.server.ui.internal.wizard.TaskWizard;
import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.ModifyModulesWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewRuntimeWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.NewServerWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.TasksWizardFragment;
+import org.eclipse.wst.server.ui.internal.wizard.fragment.*;
+import org.eclipse.wst.server.ui.wizard.ServerCreationWizardPageExtension;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import org.osgi.framework.BundleContext;
/**
* The server UI plugin class.
@@ -87,7 +76,18 @@
// cached copy of all runtime wizards
private static Map<String, WizardFragmentData> wizardFragments;
-
+
+ // Cached copy of all server wizard UI modifier
+ private static List<ServerCreationWizardPageExtension> serverCreationWizardPageExtensions;
+
+ // Cached copy of all server editor UI modifiers
+ private static List<ServerEditorOverviewPageModifier> serverEditorOverviewPageModifier;
+
+ // Cached copy of server state label provider
+ private static HashMap<String,AbstractServerLabelProvider> serverLabelProviders;
+ // Create a default server state label provider
+ private static AbstractServerLabelProvider defaultServerLabelProvider = new AbstractServerLabelProvider();
+
// cached initial selection provider
private static InitialSelectionProvider selectionProvider;
@@ -208,7 +208,7 @@
* @return ServerUIPreferences
*/
public static ServerUIPreferences getPreferences() {
- return new ServerUIPreferences();
+ return ServerUIPreferences.getInstance();
}
/**
@@ -218,10 +218,10 @@
Trace.trace(Trace.CONFIG, "----->----- Server UI plugin start ----->-----");
super.start(context);
- ServerUIPreferences prefs = getPreferences();
- prefs.setDefaults();
-
ServerCore.addServerLifecycleListener(serverLifecycleListener);
+
+ // preload the server state label providers for faster UI response
+ loadServerLabelProvider();
InitializeJob job = new InitializeJob();
job.schedule();
@@ -718,6 +718,142 @@
return selectionProvider;
}
+ /**
+ * Returns the server label provider. There is always a server label provider for a server type
+ *
+ * @return the server label provider, if one is provider by the adopter otherwise it returns a default one
+ */
+ public static AbstractServerLabelProvider getServerLabelProvider(String serverTypeId) {
+ if (serverLabelProviders == null)
+ loadServerLabelProvider();
+
+ AbstractServerLabelProvider serverLabelProvider = serverLabelProviders.get(serverTypeId);
+
+ // If there isn't one defined by an adopter, then bound the defaultServerLabelProvider to the list
+ if (serverLabelProvider == null){
+ serverLabelProvider = defaultServerLabelProvider;
+ serverLabelProviders.put(serverTypeId, serverLabelProvider);
+ }
+
+ return serverLabelProvider;
+ }
+
+ /**
+ * Returns the list of server creation wizard modifier.
+ *
+ * @return the list of server creation wizard modifier, or an empty list if none could be found
+ */
+ public static List<ServerCreationWizardPageExtension> getServerCreationWizardPageExtensions() {
+ if (serverCreationWizardPageExtensions == null)
+ loadServerCreationWizardPageExtensions();
+
+ return serverCreationWizardPageExtensions;
+ }
+
+ /**
+ * Returns the list of server editor modifiers.
+ *
+ * @return the list of server editor modifiers, or an empty list if none could be found
+ */
+ public static List<ServerEditorOverviewPageModifier> getServerEditorOverviewPageModifiers() {
+ if (serverEditorOverviewPageModifier == null)
+ loadServerEditorOverviewPageModifiers();
+ return serverEditorOverviewPageModifier;
+ }
+
+ /**
+ * Load the Server creation wizard page modifiers.
+ */
+ private static synchronized void loadServerCreationWizardPageExtensions() {
+ if (serverCreationWizardPageExtensions != null)
+ return;
+
+ Trace.trace(Trace.CONFIG, "->- Loading .serverCreationWizardPageExtension extension point ->-");
+ serverCreationWizardPageExtensions = new ArrayList<ServerCreationWizardPageExtension>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "serverCreationWizardPageExtension");
+
+ for (IConfigurationElement curConfigElement: cf) {
+ try {
+ // Create the class here already since the usage of the server wizard page will need to use all the extensions
+ // in all the calls. Therefore, there is no need for lazy loading here.
+ ServerCreationWizardPageExtension curExtension = (ServerCreationWizardPageExtension)curConfigElement.createExecutableExtension("class");
+ Trace.trace(Trace.CONFIG, " Loaded .serverCreationWizardPageExtension: " + cf[0].getAttribute("id") + ", loaded class=" + curExtension);
+ if (curExtension != null)
+ serverCreationWizardPageExtensions.add(curExtension);
+
+ } catch (Throwable t) {
+ Trace.trace(Trace.SEVERE, " Could not load .serverCreationWizardPageExtension: " + cf[0].getAttribute("id"), t);
+ }
+ }
+
+ Trace.trace(Trace.CONFIG, "-<- Done loading .serverCreationWizardPageExtension extension point -<-");
+ }
+
+ /**
+ * Load the Server editor page modifiers.
+ */
+ private static synchronized void loadServerEditorOverviewPageModifiers() {
+ if (serverEditorOverviewPageModifier != null)
+ return;
+
+ Trace.trace(Trace.CONFIG, "->- Loading .serverEditorOverviewPageModifier extension point ->-");
+ serverEditorOverviewPageModifier = new ArrayList<ServerEditorOverviewPageModifier>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "serverEditorOverviewPageModifier");
+
+ for (IConfigurationElement curConfigElement: cf) {
+ try {
+ ServerEditorOverviewPageModifier curExtension = (ServerEditorOverviewPageModifier)curConfigElement.createExecutableExtension("class");
+ Trace.trace(Trace.CONFIG, " Loaded .serverEditorOverviewPageModifier: " + cf[0].getAttribute("id") + ", loaded class=" + curExtension);
+ if (curExtension != null)
+ serverEditorOverviewPageModifier.add(curExtension);
+
+ } catch (Throwable t) {
+ Trace.trace(Trace.SEVERE, " Could not load .serverEditorOverviewPageModifier: " + cf[0].getAttribute("id"), t);
+ }
+ }
+
+ Trace.trace(Trace.CONFIG, "-<- Done loading .serverEditorOverviewPageModifier extension point -<-");
+ }
+
+ /**
+ * Load the Server Label Providers. If there is two implemented for a ServerType the adopters ServerLabelProviders
+ * will be ignored an a default will be returned
+ */
+ private static synchronized void loadServerLabelProvider() {
+ if (serverLabelProviders != null)
+ return;
+
+ Trace.trace(Trace.CONFIG, "->- Loading .serverLabelProvider extension point ->-");
+ serverLabelProviders = new HashMap<String,AbstractServerLabelProvider>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(ServerUIPlugin.PLUGIN_ID, "serverLabelProvider");
+
+ for (IConfigurationElement curConfigElement: cf) {
+ // load the extension in a safe enviroment. If there are NPEs or missconfigurations they will be caught by try/catch
+ String[] exServerTypes = ServerPlugin.tokenize(curConfigElement.getAttribute("serverTypes"), ",");
+ for (String exServerType : exServerTypes) {
+ try {
+ if (serverLabelProviders.containsKey(exServerType)){
+ // if a key is already bound for the same serverType, it means that more than one adopters is providing
+ // a ServerLabelProvider, since we don't know which one to use. We will default back to the WTP behaviour
+ Trace.trace(Trace.WARNING, "More that one .serverLabelProvider found - ignoring");
+ serverLabelProviders.put(exServerType, defaultServerLabelProvider);
+ }
+ else{
+ AbstractServerLabelProvider exClass = (AbstractServerLabelProvider)curConfigElement.createExecutableExtension("class");
+ Trace.trace(Trace.CONFIG, " Loaded .serverLabelProvider: " + curConfigElement.getAttribute("id") + ", loaded class=" + exClass);
+ serverLabelProviders.put(exServerType, exClass);
+ }
+ } catch (Throwable t) {
+ Trace.trace(Trace.SEVERE, " Could not load .serverLabelProvider: " + curConfigElement.getAttribute("id"), t);
+ }
+ }
+ }
+ Trace.trace(Trace.CONFIG, "-<- Done loading .serverLabelProvider extension point -<-");
+ }
+
/**
* Load the initial selection provider.
*/
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
index e9c6e3a..485bc49 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/ServerUIPreferences.java
@@ -56,15 +56,24 @@
private Preferences preferences;
+ private static ServerUIPreferences instance;
+
/**
* ServerUIPreference constructor comment.
*/
- public ServerUIPreferences() {
+ private ServerUIPreferences() {
super();
preferences = ServerUIPlugin.getInstance().getPluginPreferences();
+ setDefaults();
}
- public void setDefaults() {
+ public static ServerUIPreferences getInstance() {
+ if (instance == null)
+ instance = new ServerUIPreferences();
+ return instance;
+ }
+
+ private void setDefaults() {
preferences.setDefault(PREF_LAUNCH_MODE, getDefaultLaunchMode());
preferences.setDefault(PREF_LAUNCH_MODE2, getDefaultLaunchMode2());
preferences.setDefault(PREF_ENABLE_BREAKPOINTS, getDefaultEnableBreakpoints());
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
index 6df0cf2..5beb83c 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerActionDelegate.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -32,7 +32,7 @@
import org.eclipse.wst.server.core.internal.IClient;
import org.eclipse.wst.server.core.internal.ILaunchableAdapter;
import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.internal.Trace;
+import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
import org.eclipse.wst.server.ui.internal.*;
import org.eclipse.wst.server.ui.internal.viewers.ModuleArtifactComposite;
@@ -537,7 +537,7 @@
return wc.doSave();
}
- protected static final char[] INVALID_CHARS = new char[] {'\\', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
+ protected static final char[] INVALID_CHARS = new char[] {'/','\\', ':', '*', '?', '"', '<', '>', '|', '\0', '@', '&'};
protected String getValidLaunchConfigurationName(String s) {
if (s == null || s.length() == 0)
return "1";
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerLaunchConfigurationDelegate.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerLaunchConfigurationDelegate.java
index 4a4303a..9423704 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerLaunchConfigurationDelegate.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/actions/RunOnServerLaunchConfigurationDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM 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
@@ -29,6 +29,7 @@
import org.eclipse.wst.server.core.internal.IClient;
import org.eclipse.wst.server.core.internal.ILaunchableAdapter;
import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.internal.ServerType;
import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;
import org.eclipse.wst.server.ui.internal.EclipseUtil;
import org.eclipse.wst.server.ui.internal.LaunchClientJob;
@@ -217,19 +218,30 @@
final LaunchClientJob clientJob = new LaunchClientJob(server, modules, launchMode, moduleArtifact, launchableAdapter, client);
if (restart) {
+ final String launchMode2 = launchMode;
final IServer server2 = server;
- server.restart(launchMode, new IServer.IOperationListener() {
- public void done(IStatus result) {
- // Only publish if the server requires publish before launching the client.
- if (server2.shouldPublish()) {
- server2.publish(IServer.PUBLISH_INCREMENTAL, null, info, new IServer.IOperationListener() {
- public void done(IStatus result2) {
- if (result2.isOK())
- clientJob.schedule();
- }
- });
- } else {
- clientJob.schedule();
+ // If the server requires publish before starting and before launching the client, publish
+ // before the restart (see bug# 288008)
+ final boolean startBeforePublish = ((ServerType)server2.getServerType()).startBeforePublish();
+ if (server2.shouldPublish() && !startBeforePublish ) {
+ server2.publish(IServer.PUBLISH_INCREMENTAL, null, info,null);
+ }
+
+ server2.restart(launchMode2, new IServer.IOperationListener() {
+ public void done(IStatus result2) {
+ if (result2.isOK()) {
+ // If the server requires publish but the serverDefinition says to publish after start,
+ // publish after the restart
+ if (server2.shouldPublish() && startBeforePublish) {
+ server2.publish(IServer.PUBLISH_INCREMENTAL, null, info, new IServer.IOperationListener() {
+ public void done(IStatus result3) {
+ if (result3.isOK()) {
+ clientJob.schedule();
+ }
+ }
+ });
+ } else
+ clientJob.schedule();
}
}
});
@@ -249,18 +261,6 @@
} else if (state != IServer.STATE_STOPPING) {
final LaunchClientJob clientJob = new LaunchClientJob(server, modules, launchMode, moduleArtifact, launchableAdapter, client);
- /*ChainedJob myJob = new ChainedJob("test", server) {
- protected IStatus run(IProgressMonitor monitor2) {
- try {
- LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- lcm.setRecentLaunch(launch2);
- } catch (Throwable t) {
- Trace.trace(Trace.WARNING, "Could not tweak debug launch history");
- }
- return Status.OK_STATUS;
- }
- };*/
-
server.start(launchMode, new IServer.IOperationListener() {
public void done(IStatus result) {
if (result.isOK())
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/CNFManagedUIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/CNFManagedUIDecorator.java
new file mode 100644
index 0000000..73ce2ff
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/CNFManagedUIDecorator.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2008,2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.provisional.UIDecorator;
+
+public class CNFManagedUIDecorator extends UIDecorator {
+ private static final String[] serverStateUnmanaged = new String[] {
+ "",
+ Messages.viewStatusStarting4,
+ Messages.viewStatusStarted2,
+ Messages.viewStatusStopping4,
+ Messages.viewStatusStopped2};
+
+ private static Image[] startingImages;
+ private static ImageDescriptor[] startingImagesDescriptor;
+ private static Image[] stoppingImages;
+ private static ImageDescriptor[] stoppingImagesDescriptor;
+
+ private static Image[] startingImagesOverlay;
+ private static Image[] stoppingImagesOverlay;
+
+
+ /**
+ * Initialize the variables for this class
+ */
+ public void init(){
+ loadImages();
+ }
+
+ /**
+ * Load the Server starting images.
+ * NOTE: This is done so that we don't initialize the images when a label is being requested
+ */
+ public void loadImages(){
+ if (startingImages == null){
+ startingImages = new Image[] {
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
+ };
+
+ startingImagesDescriptor = new ImageDescriptor[] {
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTING_1),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTING_2),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTING_3)
+ };
+
+ stoppingImages = new Image[] {
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
+ };
+
+ stoppingImagesDescriptor = new ImageDescriptor[] {
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPING_1),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPING_2),
+ ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPING_3)
+ };
+
+ // overlay icons
+ startingImagesOverlay = new Image[] {
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1_OVERLAY),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2_OVERLAY),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3_OVERLAY)
+ };
+
+ stoppingImagesOverlay = new Image[] {
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1_OVERLAY),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2_OVERLAY),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2_OVERLAY)
+ };
+ }
+ }
+
+ /**
+ * @see UIDecorator#getStateLabel(int, String, int)
+ */
+ public String getStateLabel(int state, String mode, int count) {
+ if (state == IServer.STATE_UNKNOWN)
+ return "";
+ else if (state == IServer.STATE_STARTING)
+ return Messages.viewStatusStarting;
+ else if (state == IServer.STATE_STOPPING)
+ return Messages.viewStatusStopping;
+ else if (state == IServer.STATE_STARTED) {
+ if (ILaunchManager.DEBUG_MODE.equals(mode))
+ return Messages.viewStatusStartedDebug;
+ else if (ILaunchManager.PROFILE_MODE.equals(mode))
+ return Messages.viewStatusStartedProfile;
+ else
+ return Messages.viewStatusStarted;
+ } else if (state == IServer.STATE_STOPPED)
+ return Messages.viewStatusStopped;
+
+ return serverStateUnmanaged[state];
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.ui.internal.provisional.UIDecorator#getStateImage(int, java.lang.String, int)
+ */
+ public Image getStateImage(int state, String mode, int count) {
+ // Only initialize the images when an image is required
+ init();
+
+ if (state == IServer.STATE_UNKNOWN)
+ return null;
+ else if (state == IServer.STATE_STARTING)
+ return startingImages[count];
+ else if (state == IServer.STATE_STOPPING)
+ return stoppingImages[count];
+ else if (state == IServer.STATE_STOPPED)
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED);
+ else { //if (state == IServer.STATE_STARTED) {
+ //String mode = server.getMode();
+ if (ILaunchManager.DEBUG_MODE.equals(mode))
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
+ else if (ILaunchManager.PROFILE_MODE.equals(mode))
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
+ else
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.ui.internal.provisional.UIDecorator#getStateImage(int, java.lang.String, int)
+ */
+ public Image getStateImageOverlay(int state, String mode, int count) {
+ // Only initialize the images when an image is required
+ init();
+
+ if (state == IServer.STATE_UNKNOWN)
+ return null;
+ else if (state == IServer.STATE_STARTING)
+ return startingImagesOverlay[count];
+ else if (state == IServer.STATE_STOPPING)
+ return stoppingImagesOverlay[count];
+ else if (state == IServer.STATE_STOPPED)
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED_OVERLAY);
+ else { //if (state == IServer.STATE_STARTED) {
+ //String mode = server.getMode();
+ if (ILaunchManager.DEBUG_MODE.equals(mode))
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG_OVERLAY);
+ else if (ILaunchManager.PROFILE_MODE.equals(mode))
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE_OVERLAY);
+ else
+ return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_OVERLAY);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.server.ui.internal.provisional.UIDecorator#getStateImageDescriptor(int, java.lang.String, int)
+ */
+ public ImageDescriptor getStateImageDescriptor(int state, String mode, int count) {
+ // Only initialize the images when an image is required
+ if (state == IServer.STATE_UNKNOWN)
+ return null;
+ else if (state == IServer.STATE_STARTING)
+ return startingImagesDescriptor[count];
+ else if (state == IServer.STATE_STOPPING)
+ return stoppingImagesDescriptor[count];
+ else if (state == IServer.STATE_STOPPED)
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STOPPED);
+ else { //if (state == IServer.STATE_STARTED) {
+ //String mode = server.getMode();
+ if (ILaunchManager.DEBUG_MODE.equals(mode))
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
+ else if (ILaunchManager.PROFILE_MODE.equals(mode))
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
+ else
+ return ImageResource.getImageDescriptor(ImageResource.IMG_SERVER_STATE_STARTED);
+ }
+ }
+
+ public String getModuleName() {
+ return "module";
+ }
+
+ public boolean canRestart() {
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/CompositeServerImageDescriptor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/CompositeServerImageDescriptor.java
new file mode 100644
index 0000000..ca25589
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/CompositeServerImageDescriptor.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Trace;
+
+/**
+ * A CompositeServerImageDescriptor consists of a main icon and one overlay. The overlay will be
+ * created at the bottom right of the base image
+ *
+ */
+
+public class CompositeServerImageDescriptor extends CompositeImageDescriptor {
+ private Image fBaseImage;
+ private Point fSize;
+ private Image overlay;
+
+ /**
+ * Create a new CompositeServerImageDescriptor with the base icon being the ServerType image
+ * provided by the adopter
+ *
+ * @param baseImage
+ * @param overlay
+ */
+ public CompositeServerImageDescriptor(final IServer server, Image overlay) {
+ setBaseImage(ImageResource.getImage(server.getServerType().getId()));
+ if (overlay == null){
+ Trace.trace(Trace.FINEST, "Invalid overlay icon");
+ }
+ this.overlay = overlay;
+ }
+
+ /**
+ * Create a new CompositeServerImageDescriptor with the base icon being the ServerType image
+ * provided by the adopter
+ *
+ * @param baseImage
+ * @param overlay
+ */
+ public CompositeServerImageDescriptor(final Image baseImage, Image overlay) {
+ setBaseImage(baseImage);
+ if (overlay == null){
+ Trace.trace(Trace.FINEST, "Invalid overlay icon");
+ }
+ this.overlay = overlay;
+ }
+
+
+ /**
+ * @see CompositeImageDescriptor#getSize()
+ */
+ protected Point getSize() {
+ if (fSize == null) {
+ ImageData data = getBaseImage().getImageData();
+ setSize(new Point(data.width, data.height));
+ }
+ return fSize;
+ }
+
+ /**
+ * @see Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object object) {
+ if (!(object instanceof CompositeServerImageDescriptor))
+ return false;
+
+ CompositeServerImageDescriptor other = (CompositeServerImageDescriptor) object;
+ return (getBaseImage().equals(other.getBaseImage()));
+ }
+
+ /**
+ * @see Object#hashCode()
+ */
+ public int hashCode() {
+ return getBaseImage().hashCode();
+ }
+
+ /**
+ * @see CompositeImageDescriptor#drawCompositeImage(int, int)
+ */
+ protected void drawCompositeImage(int width, int height) {
+ ImageData bg = getBaseImage().getImageData();
+ if (bg == null)
+ bg = DEFAULT_IMAGE_DATA;
+
+ drawImage(bg, 0, 0);
+ drawOverlays();
+ }
+
+ protected void drawOverlays() {
+ if (overlay == null){
+ return;
+ }
+
+ ImageData data = overlay.getImageData();
+ int x = getSize().x - data.width;
+ int y = getSize().y - data.height;
+ drawImage(data, x, y);
+ }
+
+ protected Image getBaseImage() {
+ return fBaseImage;
+ }
+
+ protected void setBaseImage(Image baseImage) {
+ fBaseImage = baseImage;
+ }
+
+ protected void setSize(Point size) {
+ fSize = size;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerActionProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerActionProvider.java
new file mode 100644
index 0000000..6709f6a
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerActionProvider.java
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM 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 - Base Code
+ * Red Hat - Refactor for CNF
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import java.util.Iterator;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.*;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.keys.IBindingService;
+import org.eclipse.ui.navigator.*;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.Trace;
+import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
+import org.eclipse.wst.server.ui.internal.view.servers.*;
+
+public class ServerActionProvider extends CommonActionProvider {
+ public static final String NEW_MENU_ID = "org.eclipse.wst.server.ui.internal.cnf.newMenuId";
+ public static final String SHOW_IN_MENU_ID = "org.eclipse.ui.navigate.showInQuickMenu";
+ public static final String TOP_SECTION_START_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.topSectionStart";
+ public static final String TOP_SECTION_END_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.topSectionEnd";
+ public static final String EDIT_SECTION_START_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnfeditSectionStart";
+ public static final String EDIT_SECTION_END_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.editSectionEnd";
+ public static final String CONTROL_SERVER_SECTION_START_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.controlServerSectionStart";
+ public static final String CONTROL_SERVER_SECTION_END_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.controlServerSectionEnd";
+ public static final String SERVER_ETC_SECTION_START_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.serverEtcSectionStart";
+ public static final String SERVER_ETC_SECTION_END_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.serverEtcSectionEnd";
+ public static final String CONTROL_MODULE_SECTION_START_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.controlModuleSectionStart";
+ public static final String CONTROL_MODULE_SECTION_END_SEPARATOR = "org.eclipse.wst.server.ui.internal.cnf.controlModuleSectionEnd";
+
+ private ICommonActionExtensionSite actionSite;
+ private Clipboard clipboard;
+ public ServerActionProvider() {
+ super();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ addListeners(cv);
+ makeServerActions(cv, wsSite.getSelectionProvider());
+ }
+ }
+ }
+
+
+ // actions on a server
+ protected Action[] actions;
+ protected Action actionModifyModules;
+ protected Action openAction, showInConsoleAction, showInDebugAction, propertiesAction, monitorPropertiesAction;
+ protected Action copyAction, pasteAction, globalDeleteAction, renameAction;
+ protected Action noneAction = new Action(Messages.dialogMonitorNone) {
+ // dummy action
+ };
+
+ private void addListeners(CommonViewer tableViewer) {
+ tableViewer.addOpenListener(new IOpenListener() {
+ public void open(OpenEvent event) {
+ try {
+ IStructuredSelection sel = (IStructuredSelection) event.getSelection();
+ Object data = sel.getFirstElement();
+ if (!(data instanceof IServer))
+ return;
+ IServer server = (IServer) data;
+ ServerUIPlugin.editServer(server);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Could not open server", e);
+ }
+ }
+ });
+ }
+
+ private void makeServerActions(CommonViewer tableViewer, ISelectionProvider provider) {
+ clipboard = new Clipboard(tableViewer.getTree().getDisplay());
+ Shell shell = tableViewer.getTree().getShell();
+
+ actions = new Action[6];
+ // create the start actions
+ actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
+ actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
+ actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
+
+ // create the stop action
+ actions[3] = new StopAction(shell, provider);
+
+ // create the publish actions
+ actions[4] = new PublishAction(shell, provider);
+ actions[5] = new PublishCleanAction(shell, provider);
+
+ // create the open action
+ openAction = new OpenAction(provider);
+
+ // create copy, paste, and delete actions
+ pasteAction = new PasteAction(shell, provider, clipboard);
+ copyAction = new CopyAction(provider, clipboard, pasteAction);
+ globalDeleteAction = new GlobalDeleteAction(shell, provider);
+ renameAction = new RenameAction(shell, tableViewer, provider);
+
+ // create the other actions
+ actionModifyModules = new ModuleSloshAction(shell, provider);
+ showInConsoleAction = new ShowInConsoleAction(provider);
+ showInDebugAction = new ShowInDebugAction(provider);
+
+ // create the properties action
+ propertiesAction = new PropertiesAction(shell, provider);
+ monitorPropertiesAction = new PropertiesAction(shell, "org.eclipse.wst.server.ui.properties.monitor", provider);
+ }
+
+ public void fillActionBars(IActionBars actionBars) {
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.debug", actions[0]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.run", actions[1]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.stop", actions[3]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.publish", actions[4]);
+ actionBars.setGlobalActionHandler("org.eclipse.ui.navigator.Open", openAction);
+ actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
+ actionBars.updateActionBars();
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), globalDeleteAction);
+ actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
+
+ IContributionManager cm = actionBars.getToolBarManager();
+ cm.removeAll();
+
+ for (int i = 0; i < actions.length - 1; i++)
+ cm.add(actions[i]);
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ // This is a temp workaround to clean up the default group that are provided by CNF
+ menu.removeAll();
+
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ Shell shell = actionSite.getViewSite().getShell();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ }
+
+ IServer server = null;
+ IModule[] module = null;
+ if (selection != null && !selection.isEmpty()) {
+ Iterator iterator = selection.iterator();
+ Object obj = iterator.next();
+ if (obj instanceof IServer)
+ server = (IServer) obj;
+ if (obj instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) obj;
+ server = ms.server;
+ module = ms.module;
+ }
+ if (iterator.hasNext()) {
+ server = null;
+ module = null;
+ }
+ }
+
+ menu.add(invisibleSeparator(TOP_SECTION_START_SEPARATOR));
+ addTopSection(menu, server, module);
+ menu.add(invisibleSeparator(TOP_SECTION_END_SEPARATOR));
+ menu.add(new Separator());
+
+ if (server != null && module == null) {
+ menu.add(invisibleSeparator(EDIT_SECTION_START_SEPARATOR));
+ menu.add(copyAction);
+ menu.add(pasteAction);
+ menu.add(globalDeleteAction);
+ menu.add(renameAction);
+ menu.add(invisibleSeparator(EDIT_SECTION_END_SEPARATOR));
+
+ menu.add(new Separator());
+
+ menu.add(invisibleSeparator(CONTROL_SERVER_SECTION_START_SEPARATOR));
+ for (int i = 0; i < actions.length; i++)
+ menu.add(actions[i]);
+ menu.add(invisibleSeparator(CONTROL_SERVER_SECTION_END_SEPARATOR));
+
+ menu.add(new Separator());
+
+ menu.add(invisibleSeparator(SERVER_ETC_SECTION_START_SEPARATOR));
+ menu.add(actionModifyModules);
+ addMonitor(server, menu, shell);
+ menu.add(invisibleSeparator(SERVER_ETC_SECTION_END_SEPARATOR));
+ menu.add(new Separator());
+
+ } else if (server != null && module != null) {
+
+ menu.add(invisibleSeparator(CONTROL_MODULE_SECTION_START_SEPARATOR));
+ menu.add(new StartModuleAction(server, module));
+ menu.add(new StopModuleAction(server, module));
+ menu.add(new RestartModuleAction(server, module));
+ if(module.length == 1) {
+ menu.add(new RemoveModuleAction(shell, server, module[0]));
+ }
+ menu.add(invisibleSeparator(CONTROL_MODULE_SECTION_END_SEPARATOR));
+ }
+
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
+ menu.add(propertiesAction);
+ }
+
+ protected void addTopSection(IMenuManager menu, IServer server, IModule[] module) {
+ MenuManager newMenu = new MenuManager(Messages.actionNew, NEW_MENU_ID);
+ IAction newServerAction = new NewServerWizardAction();
+ newServerAction.setText(Messages.actionNewServer);
+ newMenu.add(newServerAction);
+ menu.add(newMenu);
+
+ // open action
+ if (server != null && module == null) {
+ menu.add(openAction);
+
+ String text = Messages.actionShowIn;
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ final IBindingService bindingService = (IBindingService) workbench
+ .getAdapter(IBindingService.class);
+ final TriggerSequence[] activeBindings = bindingService
+ .getActiveBindingsFor(SHOW_IN_MENU_ID);
+ if (activeBindings.length > 0) {
+ text += "\t" + activeBindings[0].format();
+ }
+
+ MenuManager showInMenu = new MenuManager(text, SHOW_IN_MENU_ID);
+ showInMenu.add(showInConsoleAction);
+ showInMenu.add(showInDebugAction);
+ menu.add(showInMenu);
+ }
+ }
+
+ protected void addMonitor(IServer server, IMenuManager menu, Shell shell) {
+
+ if (server.getServerType() != null) {
+ final MenuManager menuManager = new MenuManager(Messages.actionMonitor);
+
+ final IServer server2 = server;
+ final Shell shell2 = shell;
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ menuManager.removeAll();
+ if (server2.getAdapter(ServerDelegate.class) != null) {
+ ServerPort[] ports = server2.getServerPorts(null);
+ if (ports != null) {
+ int size = ports.length;
+ for (int i = 0; i < size; i++) {
+ if (!ports[i].isAdvanced())
+ menuManager.add(new MonitorServerPortAction(shell2, server2, ports[i]));
+ }
+ }
+ }
+
+ if (menuManager.isEmpty())
+ menuManager.add(noneAction);
+
+ menuManager.add(new Separator());
+ menuManager.add(monitorPropertiesAction);
+ }
+ });
+
+ // add an initial menu item so that the menu appears correctly
+ noneAction.setEnabled(false);
+ menuManager.add(noneAction);
+ menu.add(menuManager);
+ }
+ }
+
+
+ private Separator invisibleSeparator(String s) {
+ Separator sep = new Separator(s);
+ sep.setVisible(false);
+ return sep;
+ }
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerContentProvider.java
new file mode 100644
index 0000000..5f463e8
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerContentProvider.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2008,2009 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import java.util.*;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.eclipse.wst.server.ui.internal.viewers.BaseContentProvider;
+
+public class ServerContentProvider extends BaseContentProvider implements ITreeContentProvider{
+ // TODO Angel Says: Need to review if this is needed
+ public static Object INITIALIZING = new Object();
+
+ // TODO Angel Says: Need to review how to port this function into CNF
+ // servers that are currently publishing and starting
+ protected static Set<String> publishing = new HashSet<String>(4);
+
+ public Object[] getElements(Object element) {
+ List<IServer> list = new ArrayList<IServer>();
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ if (!((Server)servers[i]).isPrivate())
+ list.add(servers[i]);
+ }
+ }
+ return list.toArray();
+ }
+
+ public Object[] getChildren(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ try {
+ IModule[] children = ms.server.getChildModules(ms.module, null);
+ int size = children.length;
+ ModuleServer[] ms2 = new ModuleServer[size];
+ for (int i = 0; i < size; i++) {
+ int size2 = ms.module.length;
+ IModule[] module = new IModule[size2 + 1];
+ System.arraycopy(ms.module, 0, module, 0, size2);
+ module[size2] = children[i];
+ ms2[i] = new ModuleServer(ms.server, module);
+ }
+ return ms2;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ IServer server = (IServer) element;
+ IModule[] modules = server.getModules();
+ int size = modules.length;
+ ModuleServer[] ms = new ModuleServer[size];
+ for (int i = 0; i < size; i++) {
+ ms[i] = new ModuleServer(server, new IModule[] { modules[i] });
+ }
+ return ms;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ return ms.server;
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof ModuleServer) {
+ // Check if the module server has child modules.
+ ModuleServer curModuleServer = (ModuleServer)element;
+ IServer curServer = curModuleServer.server;
+ IModule[] curModule = curModuleServer.module;
+ if (curServer != null && curModule != null) {
+ IModule[] curChildModule = curServer.getChildModules(curModule, null);
+ if (curChildModule != null && curChildModule.length > 0)
+ return true;
+ return false;
+ }
+ return false;
+ }
+ if( element instanceof IServer ) {
+ return ((IServer) element).getModules().length > 0;
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerDecorator.java
new file mode 100644
index 0000000..7a6c9cb
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerDecorator.java
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2008,2010 IBM 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
+ *******************************************************************************/
+ package org.eclipse.wst.server.ui.internal.cnf;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.internal.*;
+import org.eclipse.wst.server.ui.internal.provisional.AbstractServerLabelProvider;
+import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+
+public class ServerDecorator extends LabelProvider implements ILightweightLabelDecorator {
+
+ public static final String[] syncState = new String[] {
+ Messages.viewSyncOkay,
+ Messages.viewSyncRestart,
+ Messages.viewSyncPublish,
+ Messages.viewSyncRestartPublish,
+ Messages.viewSyncPublishing};
+
+ public static final String[] syncStateUnmanaged = new String[] {
+ Messages.viewSyncOkay2,
+ Messages.viewSyncRestart2,
+ Messages.viewSyncPublish2,
+ Messages.viewSyncRestartPublish2,
+ Messages.viewSyncPublishing2};
+
+ public static final String[] modulePublishState = new String[] {
+ "",
+ Messages.viewSyncOkay,
+ Messages.viewSyncPublish,
+ Messages.viewSyncPublish};
+
+ private static ServerDecorator instance;
+
+ public static ServerDecorator getDefault() {
+ return instance;
+ }
+
+ private static int count = 0;
+
+ public static void animate() {
+ count = (count + 1)%3;
+ }
+
+ public static int getCount() {
+ return count;
+ }
+
+ public ServerDecorator() {
+ instance = this;
+ }
+
+ public void decorate(Object element, IDecoration decoration) {
+ if( element instanceof IServer ) {
+ IServer server = (IServer)element;
+ String state = getServerStateLabel(server );
+ String status = getServerStatusLabel(server );
+
+ decoration.addSuffix(combine(state, status));
+ } else if( element instanceof ModuleServer ) {
+ ModuleServer module = (ModuleServer)element;
+ String state = getModuleStateText(module);
+ String status = getModuleStatusText(module);
+
+ decoration.addSuffix(combine(state, status));
+ }
+ }
+
+ public void redecorate(IServer server) {
+ fireLabelProviderChanged(new LabelProviderChangedEvent(this));
+ }
+
+ /*
+ * Utility methods
+ */
+ public static Image getServerImage(IServer server) {
+ return server == null ? null :
+ server.getServerType() == null ? null :
+ ImageResource.getImage(server.getServerType().getId());
+ }
+
+ /**
+ * Find the ServerLabelProvider for this server type and provide a label. If none are found
+ * a default server label provider will be provided
+ *
+ * @param server
+ * @return
+ */
+ public static String getServerStateLabel(IServer server) {
+ if (server == null || server.getServerType() == null)
+ return null;
+
+ String stateLabel;
+
+ AbstractServerLabelProvider labelProvider= ServerUIPlugin.getServerLabelProvider(server.getServerType().getId());
+ stateLabel = labelProvider.getServerStateLabel(server);
+
+ return stateLabel;
+ }
+
+ public static String getStateLabel(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getCNFUIDecorator().getStateLabel(state, mode, count);
+ }
+
+ public static String getServerStatusLabel(IServer server) {
+ IStatus status = ((Server) server).getServerStatus();
+ if (status != null)
+ return status.getMessage();
+
+ if (server.getServerType() == null)
+ return "";
+
+ if (server.getServerState() == IServer.STATE_UNKNOWN)
+ return "";
+
+ String serverId = server.getId();
+ if (ServerContentProvider.publishing.contains(serverId))
+ return ServerDecorator.syncState[4];
+
+ // republish
+ int i = 0;
+ if (server.shouldPublish()) {
+ if (((Server)server).isPublishUnknown())
+ return "";
+ i += 2;
+ }
+
+ if (server.shouldRestart())
+ i = 1;
+
+ return syncState[i];
+ }
+
+ public static Image getServerStateImage(IServer server) {
+ return server == null ? null :
+ getStateImage(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+ public static Image getStateImage(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getCNFUIDecorator().getStateImage(state, mode, getCount());
+ }
+
+ public static Image getServerStateImageOverlay(IServer server) {
+ return server == null ? null :
+ getStateImageOverlay(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+ public static Image getStateImageOverlay(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getCNFUIDecorator().getStateImageOverlay(state, mode, getCount());
+ }
+
+
+ public static String getModuleText(ModuleServer ms ) {
+ if (ms == null || ms.module == null)
+ return "";
+ int size = ms.module.length;
+ return ms.module[size - 1].getName();
+ }
+
+ public static Image getModuleImage(ModuleServer ms) {
+ if( ms != null ) {
+ ILabelProvider labelProvider = ServerUICore.getLabelProvider();
+ Image image = labelProvider.getImage(ms.module[ms.module.length - 1]);
+ labelProvider.dispose();
+ return image;
+ }
+ return null;
+ }
+
+ public static String getModuleStateText(ModuleServer ms) {
+ if (ms == null || ms.module == null)
+ return null;
+
+ Server curServer = (Server) ms.getServer();
+ if (curServer == null || curServer.getServerType() == null)
+ return null;
+
+ // For module state, we always use run mode since the state of the module will only be showing
+ // Started state even for debug and profile mode.
+ return getStateLabel(curServer.getServerType(), curServer.getModuleState(ms.module), ILaunchManager.RUN_MODE);
+ }
+
+ public static String getModuleStatusText(ModuleServer ms) {
+ if( ms != null && ms.server != null && ms.module != null ) {
+ IStatus status = ((Server) ms.server).getModuleStatus(ms.module);
+ if (status != null)
+ return status.getMessage();
+
+ return modulePublishState[ms.server.getModulePublishState(ms.module)];
+ }
+ return "";
+ }
+
+ public static Image getModuleStatusImage(ModuleServer ms) {
+ IStatus status = ((Server) ms.server).getModuleStatus(ms.module);
+ if (status != null) {
+ ISharedImages sharedImages = ServerUIPlugin.getInstance().getWorkbench().getSharedImages();
+ if (status.getSeverity() == IStatus.ERROR)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ else if (status.getSeverity() == IStatus.WARNING)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ else if (status.getSeverity() == IStatus.INFO)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ }
+ return null;
+ }
+
+ protected String combine(String state, String status) {
+ if(isEmpty(state) && isEmpty(status))
+ return "";
+ if( isEmpty(state))
+ return " [" + status + "]";
+ if( isEmpty(status))
+ return " [" + state + "]";
+ return " [" + state + ", " + status + "]";
+ }
+
+ protected boolean isEmpty(String s) {
+ return (s == null || "".equals(s));
+ }
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerLabelProvider.java
new file mode 100644
index 0000000..5a355c8
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServerLabelProvider.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2008,2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.eclipse.wst.server.ui.internal.viewers.BaseCellLabelProvider;
+/**
+ * Server table label provider.
+ */
+public class ServerLabelProvider extends BaseCellLabelProvider{
+
+ /**
+ * ServerTableLabelProvider constructor comment.
+ */
+ public ServerLabelProvider() {
+ super();
+ this.providerImageCache = new HashMap<String, Image>();
+ //TODO: Angel says: Look at bug# 258184
+ }
+
+ public String getText(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ if (ms.module == null)
+ return "";
+ int size = ms.module.length;
+ String name = ms.module[size - 1].getName();
+ return name;
+ }
+
+ if( element instanceof IServer ) {
+ IServer server = (IServer) element;
+ return notNull(server.getName());
+ }
+
+ if( element == ServerContentProvider.INITIALIZING)
+ return Messages.viewInitializing;
+
+ if (element instanceof IWorkspaceRoot){
+ return Platform.getResourceString(ServerUIPlugin.getInstance().getBundle(), "%viewServers");
+ }
+
+ return "";
+ }
+
+ @Override
+ public void dispose() {
+
+ super.dispose();
+ if (this.providerImageCache != null) {
+ final Iterator<Image> providerImageCacheIterator = this.providerImageCache.values().iterator();
+ while (providerImageCacheIterator.hasNext()) {
+ providerImageCacheIterator.next().dispose();
+ }
+ this.providerImageCache.clear();
+ }
+ }
+
+ public Image getImage(Object element) {
+
+ Image image = null;
+
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ ILabelProvider labelProvider = ServerUICore.getLabelProvider();
+ image = labelProvider.getImage(ms.module[ms.module.length - 1]);
+ labelProvider.dispose();
+ } else if( element instanceof IServer ) {
+ IServer server = (IServer) element;
+ if (server.getServerType() != null) {
+ // Ideally we won't be doing the overlay of the state here, but rather in a decorator so that
+ // users can turn it off and on. This works for now until we have more time to work and reorganize
+ // the code
+ Image serverTypeImg = ImageResource.getImage(server.getServerType().getId());
+ Image serverStatusImg = ServerDecorator.getServerStateImageOverlay(server);
+
+ // Images returned via the CompositeServerImageDescriptor#createImage() need to be cached since this API
+ // will always create a new Image and it is impossible to know when to dispose them except when the
+ // label provider is disposed.
+ final String key = this.getCacheKey(server, serverTypeImg, serverStatusImg);
+ image = this.providerImageCache.get(key);
+ if(image == null) {
+ CompositeServerImageDescriptor dsid = new CompositeServerImageDescriptor(serverTypeImg,serverStatusImg);
+ image = dsid.createImage();
+ this.providerImageCache.put(key, image);
+ }
+ }
+ }
+ return image;
+ }
+
+ private final String getCacheKey(final IServer server, final Image serverTypeImg, final Image serverStatusImg) {
+
+ StringBuffer key = new StringBuffer();
+ if(server != null) {
+ key.append(server.getName());
+ }
+ if(serverTypeImg != null) {
+ key.append(serverTypeImg.toString());
+ }
+ if(serverStatusImg != null) {
+ key.append(serverStatusImg.toString());
+ }
+ return key.toString();
+ }
+
+ protected String notNull(String s) {
+ if (s == null)
+ return "";
+ return s;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ if (element instanceof IServer){
+ if (property.equalsIgnoreCase("ICON")){
+ return true;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public Image getColumnImage(Object element, int index) {
+ // TODO Left blank since the CNF doesn't support this
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, int index) {
+ // TODO Left blank since the CNF doesn't support this
+ return null;
+ }
+
+ private final Map<String, Image> providerImageCache;
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServersView2.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServersView2.java
new file mode 100644
index 0000000..977311b
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServersView2.java
@@ -0,0 +1,351 @@
+/*******************************************************************************
+ * Copyright (c) 2008,2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.contexts.IContextService;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.wst.server.core.*;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.UpdateServerJob;
+import org.eclipse.wst.server.core.util.PublishAdapter;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerToolTip;
+import org.eclipse.wst.server.ui.internal.Trace;
+/**
+ * A view of servers, their modules, and status.
+ */
+public class ServersView2 extends CommonNavigator {
+ private static final String SERVERS_VIEW_CONTEXT = "org.eclipse.ui.serverViewScope";
+
+ protected CommonViewer tableViewer;
+
+ protected IServerLifecycleListener serverResourceListener;
+ protected IPublishListener publishListener;
+ protected IServerListener serverListener;
+
+ // servers that are currently publishing and starting
+ protected static Set<String> publishing = new HashSet<String>(4);
+ protected static Set<String> starting = new HashSet<String>(4);
+ protected boolean animationActive = false;
+ protected boolean stopAnimation = false;
+
+ /**
+ * ServersView constructor comment.
+ */
+ public ServersView2() {
+ super();
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+
+ IContextService contextSupport = (IContextService)getSite().getService(IContextService.class);
+ contextSupport.activateContext(SERVERS_VIEW_CONTEXT);
+
+ deferInitialization();
+ }
+
+ private void deferInitialization() {
+ // TODO Angel Says: Need to do a final check on this line below. I don't think there is anything else
+ // that we need from to port from the old Servers View
+ //initializeActions(getCommonViewer());
+
+ Job job = new Job(Messages.jobInitializingServersView) {
+ public IStatus run(IProgressMonitor monitor) {
+ IServer[] servers = ServerCore.getServers();
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ ((Server)servers[i]).getAllModules().iterator();
+ }
+ deferredInitialize();
+ return Status.OK_STATUS;
+ }
+ };
+
+ job.setSystem(true);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
+
+ protected void deferredInitialize() {
+ addListener();
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ tableViewer = getCommonViewer();
+ getSite().setSelectionProvider(tableViewer);
+
+ // init the tooltip
+ ServerToolTip toolTip = new ServerToolTip(tableViewer.getTree());
+ toolTip.setShift(new Point(10, 3));
+ toolTip.setPopupDelay(400); // in ms
+ toolTip.setHideOnMouseDown(true);
+ toolTip.activate();
+
+ } catch (Exception e) {
+ // ignore - view has already been closed
+ }
+ }
+ });
+
+ UpdateServerJob job = new UpdateServerJob(ServerCore.getServers());
+ job.addJobChangeListener(new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if (tableViewer.getTree().getItemCount() > 0) {
+ Object obj = tableViewer.getTree().getItem(0).getData();
+ tableViewer.setSelection(new StructuredSelection(obj));
+ }
+ }
+ });
+ }
+ });
+ job.schedule();
+ }
+
+ protected void handlePublishChange(IServer server, boolean isPublishing) {
+ String serverId = server.getId();
+ if (isPublishing)
+ publishing.add(serverId);
+ else
+ publishing.remove(serverId);
+
+ refreshServerState(server);
+ }
+
+ /**
+ * @deprecated
+ * @param server
+ */
+ protected void refreshServer(final IServer server){
+ Trace.trace(Trace.FINEST, "Refreshing UI for server="+server);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ IDecoratorManager dm = PlatformUI.getWorkbench().getDecoratorManager();
+ dm.update("org.eclipse.wst.server.ui.navigatorDecorator");
+ tableViewer.setSelection(tableViewer.getSelection());
+ }
+ });
+ }
+
+ protected void refreshServerContent(final IServer server){
+ Trace.trace(Trace.FINEST, "Refreshing Content for server="+server);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if(!tableViewer.getTree().isDisposed())
+ tableViewer.refresh(server, true);
+ }
+ });
+ }
+
+ protected void refreshServerState(final IServer server){
+ Trace.trace(Trace.FINEST, "Refreshing UI for server="+server);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ IDecoratorManager dm = PlatformUI.getWorkbench().getDecoratorManager();
+ dm.update("org.eclipse.wst.server.ui.navigatorDecorator");
+ tableViewer.setSelection(tableViewer.getSelection());
+ }
+ });
+ }
+
+ protected void addListener(){
+ // To enable the UI updating of servers and its childrens
+ serverResourceListener = new IServerLifecycleListener() {
+ public void serverAdded(IServer server) {
+ addServer(server);
+ server.addServerListener(serverListener);
+ ((Server) server).addPublishListener(publishListener);
+ }
+ public void serverChanged(IServer server) {
+ refreshServerContent(server);
+ }
+ public void serverRemoved(IServer server) {
+ removeServer(server);
+ server.removeServerListener(serverListener);
+ ((Server) server).removePublishListener(publishListener);
+ }
+ };
+ ServerCore.addServerLifecycleListener(serverResourceListener);
+
+ // To enable the refresh of the State decorator
+ publishListener = new PublishAdapter() {
+ public void publishStarted(IServer server) {
+ handlePublishChange(server, true);
+ }
+
+ public void publishFinished(IServer server, IStatus status) {
+ handlePublishChange(server, false);
+ }
+ };
+
+ serverListener = new IServerListener() {
+ public void serverChanged(ServerEvent event) {
+ if (event == null)
+ return;
+
+ int eventKind = event.getKind();
+ IServer server = event.getServer();
+ if ((eventKind & ServerEvent.SERVER_CHANGE) != 0) {
+ // server change event
+ if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
+ int state = event.getState();
+ String id = server.getId();
+ if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
+ boolean startThread = false;
+ synchronized (starting) {
+ if (!starting.contains(id)) {
+ if (starting.isEmpty())
+ startThread = true;
+ starting.add(id);
+ }
+ }
+ if (startThread)
+ startThread();
+ } else {
+ boolean stopThread = false;
+ synchronized (starting) {
+ if (starting.contains(id)) {
+ starting.remove(id);
+ if (starting.isEmpty())
+ stopThread = true;
+ }
+ }
+ if (stopThread)
+ stopThread();
+ }
+ refreshServerState(server);
+ refreshServerContent(server);
+ }
+ } else if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
+ // module change event
+ if ((eventKind & ServerEvent.STATE_CHANGE) != 0 || (eventKind & ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
+ refreshServerContent(server);
+ }
+ }
+ // TODO Angel Says: I don't think we need this
+ //refreshServer(server);
+ }
+ };
+
+ // add listeners to servers
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ servers[i].addServerListener(serverListener);
+ ((Server) servers[i]).addPublishListener(publishListener);
+ }
+ }
+ }
+
+ protected void addServer(final IServer server) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ tableViewer.add(tableViewer.getInput(), server);
+ }
+ });
+ }
+
+ protected void removeServer(final IServer server) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ tableViewer.remove(server);
+ }
+ });
+ }
+
+ @Override
+ public void dispose() {
+ ServerCore.removeServerLifecycleListener(serverResourceListener);
+
+ // remove listeners from servers
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ servers[i].removeServerListener(serverListener);
+ ((Server) servers[i]).removePublishListener(publishListener);
+ }
+ }
+ super.dispose();
+ }
+
+ /**
+ * Start the animation thread
+ */
+ protected void startThread() {
+ if (animationActive)
+ return;
+
+ stopAnimation = false;
+
+ final Display display = tableViewer == null ? Display.getDefault() : tableViewer.getControl().getDisplay();
+ final int SLEEP = 200;
+ final Runnable[] animator = new Runnable[1];
+ animator[0] = new Runnable() {
+ public void run() {
+ if (!stopAnimation) {
+ try {
+ int size = 0;
+ String[] servers;
+ synchronized (starting) {
+ size = starting.size();
+ servers = new String[size];
+ starting.toArray(servers);
+
+ }
+
+ for (int i = 0; i < size; i++) {
+ IServer server = ServerCore.findServer(servers[i]);
+ if (server != null ) {
+ ServerDecorator.animate();
+ tableViewer.update(server, new String[]{"ICON"});
+ }
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.FINEST, "Error in Servers view animation", e);
+ }
+ display.timerExec(SLEEP, animator[0]);
+ }
+ }
+ };
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ display.timerExec(SLEEP, animator[0]);
+ }
+ });
+ }
+
+ protected void stopThread() {
+ stopAnimation = true;
+ }
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServersViewDropAdapterAssistant.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServersViewDropAdapterAssistant.java
new file mode 100644
index 0000000..80c905a
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/cnf/ServersViewDropAdapterAssistant.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2009 IBM 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 - Base Code
+ * Red Hat - Refactor for CNF
+ */
+
+package org.eclipse.wst.server.ui.internal.cnf;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.navigator.CommonDropAdapter;
+import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
+import org.eclipse.wst.server.core.*;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.ui.internal.EclipseUtil;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
+
+public class ServersViewDropAdapterAssistant extends CommonDropAdapterAssistant {
+
+ private List dndElementList;
+
+ public IStatus validatePluginTransferDrop(
+ IStructuredSelection aDragSelection, Object aDropTarget) {
+ initializeSelection(aDragSelection);
+ return internalValidate(aDropTarget, dndElementList);
+ }
+
+ public IStatus validateDrop(Object target, int operation,
+ TransferData transferType) {
+ if (LocalSelectionTransfer.getTransfer().isSupportedType(transferType)) {
+ ISelection s = LocalSelectionTransfer.getTransfer().getSelection();
+ initializeSelection(s);
+ return internalValidate(target, dndElementList);
+ }
+ return Status.CANCEL_STATUS;
+ }
+
+ protected void initializeSelection(ISelection s) {
+ if (dndElementList != null)
+ return;
+ if (!(s instanceof IStructuredSelection)) {
+ dndElementList = Collections.EMPTY_LIST;
+ return;
+ }
+ dndElementList = ((IStructuredSelection) s).toList();
+ }
+
+ protected IStatus internalValidate(Object target, List elements) {
+ if (target instanceof IServer) {
+ IServer server = (IServer) target;
+ Object next;
+ if (elements != null) {
+ Iterator i = elements.iterator();
+ while (i.hasNext()) {
+ next = i.next();
+ IModuleArtifact[] moduleArtifacts = ServerPlugin
+ .getModuleArtifacts(next);
+ if (moduleArtifacts != null && moduleArtifacts.length > 0) {
+ for (int j = 0; j < moduleArtifacts.length; j++) {
+ if (moduleArtifacts[j] != null
+ && moduleArtifacts[j].getModule() != null) {
+ IModuleType[] moduleTypes = server
+ .getServerType().getRuntimeType()
+ .getModuleTypes();
+ if (ServerUtil.isSupportedModule(moduleTypes,
+ moduleArtifacts[j].getModule()
+ .getModuleType())) {
+ return Status.OK_STATUS;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ clear();
+ return Status.CANCEL_STATUS;
+ }
+
+ public IStatus handleDrop(CommonDropAdapter dropAdapter, DropTargetEvent dropTargetEvent, Object target) {
+ IStatus status = internalHandleDrop(target, dndElementList);
+ if (status.isOK())
+ dropTargetEvent.detail = DND.DROP_NONE;
+ return status;
+ }
+
+ public IStatus handlePluginTransferDrop(IStructuredSelection aDragSelection, Object aDropTarget) {
+ return internalHandleDrop(aDropTarget, dndElementList);
+ }
+
+ protected IStatus internalHandleDrop(Object target, List elements) {
+ boolean b = false;
+ if (target instanceof IServer) {
+ b = true;
+ if (dndElementList != null) {
+ Iterator iterator = elements.iterator();
+ while (iterator.hasNext()) {
+ Object data2 = iterator.next();
+ if (!doRunOnServerAction((IServer) target, data2))
+ b = false;
+ }
+ }
+ }
+ clear();
+ return b ? Status.OK_STATUS : Status.CANCEL_STATUS;
+ }
+
+ private void clear() {
+ dndElementList = null;
+ }
+
+ protected boolean doRunOnServerAction(IServer server, Object data) {
+ // check if the selection is a project (module) that we can add to the server
+ IProject project = (IProject) Platform.getAdapterManager().getAdapter(
+ data, IProject.class);
+ if (project != null) {
+ IModule[] modules = ServerUtil.getModules(project);
+ if (modules != null && modules.length == 1) {
+ try {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ IModule[] parents = wc.getRootModules(modules[0], null);
+ if (parents == null || parents.length == 0)
+ return false;
+
+ if (ServerUtil.containsModule(server, parents[0], null))
+ return false;
+
+ IModule[] add = new IModule[] { parents[0] };
+ if (wc.canModifyModules(add, null, null).getSeverity() != IStatus.ERROR) {
+ wc.modifyModules(modules, null, null);
+ wc.save(false, null);
+ return true;
+ }
+ } catch (final CoreException ce) {
+ final Shell shell = getShell();
+ shell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ EclipseUtil.openError(shell, ce
+ .getLocalizedMessage());
+ }
+ });
+ return true;
+ }
+ }
+ }
+
+ // otherwise, try Run on Server
+ final IServer finalServer = server;
+ RunOnServerActionDelegate ros = new RunOnServerActionDelegate() {
+ public IServer getServer(IModule module,
+ IModuleArtifact moduleArtifact, IProgressMonitor monitor)
+ throws CoreException {
+ if (!ServerUIPlugin.isCompatibleWithLaunchMode(finalServer,
+ launchMode))
+ return null;
+
+ if (!ServerUtil.containsModule(finalServer, module, monitor)) {
+ IServerWorkingCopy wc = finalServer.createWorkingCopy();
+ try {
+ ServerUtil.modifyModules(wc, new IModule[] { module },
+ new IModule[0], monitor);
+ wc.save(false, monitor);
+ } catch (CoreException ce) {
+ throw ce;
+ }
+ }
+
+ return finalServer;
+ }
+ };
+ Action action = new Action() {
+ // dummy action
+ };
+ ros.selectionChanged(action, new StructuredSelection(data));
+
+ ros.run(action);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java
index 7b33baa..f238256 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/GlobalCommandManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -705,6 +705,8 @@
if (info == null)
return false;
IFile[] files = getServerResourceFiles(id);
+ if (files == null)
+ return false;
int size = files.length;
int count = 0;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
index 1e6dc84..2a59fa3 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -15,8 +15,10 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -38,6 +40,7 @@
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Image;
@@ -68,6 +71,9 @@
import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.eclipse.wst.server.core.internal.ServerType;
import org.eclipse.wst.server.core.util.SocketUtil;
+import org.eclipse.wst.server.ui.AbstractUIControl;
+import org.eclipse.wst.server.ui.AbstractUIControl.UIControlEntry;
+import org.eclipse.wst.server.ui.AbstractUIControl.IUIControlListener;
import org.eclipse.wst.server.ui.editor.*;
import org.eclipse.wst.server.ui.internal.ContextIds;
import org.eclipse.wst.server.ui.internal.ImageResource;
@@ -84,14 +90,17 @@
/**
* Server general editor page.
*/
-public class OverviewEditorPart extends ServerEditorPart {
+public class OverviewEditorPart extends ServerEditorPart implements IUIControlListener {
protected Text serverName;
protected Text serverConfiguration;
protected Text hostname;
+ protected Label hostnameLabel;
+ protected ControlDecoration hostnameDecoration;
protected Combo runtimeCombo;
protected Button browse;
protected Button autoPublishDisable;
- protected Button autoPublishEnable;
+ protected Button autoPublishEnableResource;
+ protected Button autoPublishEnableBuild;
protected Spinner autoPublishTime;
protected Table publishersTable;
protected CheckboxTableViewer publishersViewer;
@@ -107,6 +116,8 @@
protected IRuntimeLifecycleListener runtimeListener;
+ private IServerType oldServerType;
+
class PublisherContentProvider extends BaseContentProvider {
protected Publisher[] pubs;
public PublisherContentProvider(Publisher[] pubs) {
@@ -203,9 +214,10 @@
} else if (event.getPropertyName().equals(Server.PROP_AUTO_PUBLISH_SETTING)) {
Integer autoPublishSetting = (Integer)event.getNewValue();
int setting = autoPublishSetting.intValue();
- autoPublishEnable.setSelection(setting == Server.AUTO_PUBLISH_ENABLE);
+ autoPublishEnableResource.setSelection(setting == Server.AUTO_PUBLISH_RESOURCE);
+ autoPublishEnableBuild.setSelection(setting == Server.AUTO_PUBLISH_BUILD);
autoPublishDisable.setSelection(setting == Server.AUTO_PUBLISH_DISABLE);
- autoPublishTime.setEnabled(setting == Server.AUTO_PUBLISH_ENABLE);
+ autoPublishTime.setEnabled(setting != Server.AUTO_PUBLISH_DISABLE);
validate();
} else if (event.getPropertyName().equals(Server.PROP_START_TIMEOUT)) {
Integer time = (Integer)event.getNewValue();
@@ -348,10 +360,10 @@
whs.setHelp(serverName, ContextIds.EDITOR_SERVER);
// hostname
- createLabel(toolkit, composite, Messages.serverEditorOverviewServerHostname);
+ hostnameLabel = createLabel(toolkit, composite, Messages.serverEditorOverviewServerHostname);
hostname = toolkit.createText(composite, server.getHost());
- final ControlDecoration hostnameDecoration = new ControlDecoration(hostname, SWT.TOP | SWT.LEAD);
+ hostnameDecoration = new ControlDecoration(hostname, SWT.TOP | SWT.LEAD);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
data.horizontalIndent = decorationWidth;
@@ -392,16 +404,18 @@
// runtime
if (server != null && server.getServerType() != null && server.getServerType().hasRuntime()) {
- final IRuntime runtime = server.getRuntime();
- if (runtime != null && ServerUIPlugin.hasWizardFragment(runtime.getRuntimeType().getId())) {
- Hyperlink link = toolkit.createHyperlink(composite, Messages.serverEditorOverviewRuntime, SWT.NONE);
- link.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
+ final Hyperlink link = toolkit.createHyperlink(composite, Messages.serverEditorOverviewRuntime, SWT.NONE);
+ link.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ IRuntime runtime = server.getRuntime();
+ if (runtime != null && ServerUIPlugin.hasWizardFragment(runtime.getRuntimeType().getId()))
editRuntime(runtime);
- }
- });
- } else
- createLabel(toolkit, composite, Messages.serverEditorOverviewRuntime);
+ }
+ });
+
+ final IRuntime runtime = server.getRuntime();
+ if (runtime == null || !ServerUIPlugin.hasWizardFragment(runtime.getRuntimeType().getId()))
+ link.setEnabled(false);
IRuntimeType runtimeType = server.getServerType().getRuntimeType();
runtimes = ServerUIPlugin.getRuntimes(runtimeType);
@@ -427,6 +441,7 @@
updating = true;
IRuntime newRuntime = runtimes[runtimeCombo.getSelectionIndex()];
execute(new SetServerRuntimeCommand(getServer(), newRuntime));
+ link.setEnabled(newRuntime != null && !ServerUIPlugin.hasWizardFragment(newRuntime.getRuntimeType().getId()));
updating = false;
} catch (Exception ex) {
// ignore
@@ -579,6 +594,16 @@
}
}
}
+
+ // Insertion of extension widgets. If the page modifier createControl is not implemented still
+ // add the modifier to the listeners list.
+ List<ServerEditorOverviewPageModifier> pageModifiersLst = ServerUIPlugin.getServerEditorOverviewPageModifiers();
+ for (ServerEditorOverviewPageModifier curPageModifier : pageModifiersLst) {
+ if(server != null && server.getServerType() != null){
+ curPageModifier.createControl(ServerEditorOverviewPageModifier.UI_LOCATION.OVERVIEW, composite);
+ curPageModifier.setUIControlListener(this);
+ }
+ }
}
protected void createPublishSection(Composite rightColumnComp, FormToolkit toolkit) {
@@ -614,18 +639,25 @@
autoPublishDisable.setSelection(publishSetting == Server.AUTO_PUBLISH_DISABLE);
whs.setHelp(autoPublishDisable, ContextIds.EDITOR_AUTOPUBLISH_DISABLE);
- autoPublishEnable = toolkit.createButton(composite, Messages.serverEditorOverviewAutoPublishEnabled, SWT.RADIO);
- autoPublishEnable.setSelection(publishSetting == Server.AUTO_PUBLISH_ENABLE);
+ autoPublishEnableResource = toolkit.createButton(composite, Messages.serverEditorOverviewAutoPublishEnabledResource, SWT.RADIO);
+ autoPublishEnableResource.setSelection(publishSetting == Server.AUTO_PUBLISH_RESOURCE);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
- autoPublishEnable.setLayoutData(data);
- whs.setHelp(autoPublishEnable, ContextIds.EDITOR_AUTOPUBLISH_ENABLE);
+ autoPublishEnableResource.setLayoutData(data);
+ whs.setHelp(autoPublishEnableResource, ContextIds.EDITOR_AUTOPUBLISH_ENABLE);
+
+ autoPublishEnableBuild = toolkit.createButton(composite, Messages.serverEditorOverviewAutoPublishEnabledBuild, SWT.RADIO);
+ autoPublishEnableBuild.setSelection(publishSetting == Server.AUTO_PUBLISH_BUILD);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ autoPublishEnableBuild.setLayoutData(data);
+ whs.setHelp(autoPublishEnableBuild, ContextIds.EDITOR_AUTOPUBLISH_BUILD);
final Label autoPublishTimeLabel = createLabel(toolkit,composite, Messages.serverEditorOverviewAutoPublishEnabledInterval);
data = new GridData();
data.horizontalIndent = 20;
autoPublishTimeLabel.setLayoutData(data);
- autoPublishTimeLabel.setEnabled(autoPublishEnable.getSelection());
+ autoPublishTimeLabel.setEnabled(!autoPublishDisable.getSelection());
autoPublishTime = new Spinner(composite, SWT.BORDER);
autoPublishTime.setMinimum(0);
@@ -635,23 +667,36 @@
data = new GridData(GridData.HORIZONTAL_ALIGN_END);
data.widthHint = 30;
autoPublishTime.setLayoutData(data);
- autoPublishTime.setEnabled(autoPublishEnable.getSelection());
+ autoPublishTime.setEnabled(!autoPublishDisable.getSelection());
SWTUtil.setSpinnerTooltip(autoPublishTime);
- whs.setHelp(autoPublishTime, ContextIds.EDITOR_AUTOPUBLISH_ENABLE);
+ whs.setHelp(autoPublishTime, ContextIds.EDITOR_AUTOPUBLISH_INTERVAL);
- autoPublishEnable.addSelectionListener(new SelectionAdapter() {
+ autoPublishEnableResource.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- if (updating || !autoPublishEnable.getSelection())
+ if (updating || !autoPublishEnableResource.getSelection())
return;
updating = true;
- execute(new SetServerAutoPublishDefaultCommand(getServer(), Server.AUTO_PUBLISH_ENABLE));
+ execute(new SetServerAutoPublishDefaultCommand(getServer(), Server.AUTO_PUBLISH_RESOURCE));
updating = false;
- autoPublishTimeLabel.setEnabled(autoPublishEnable.getSelection());
- autoPublishTime.setEnabled(autoPublishEnable.getSelection());
+ autoPublishTimeLabel.setEnabled(!autoPublishDisable.getSelection());
+ autoPublishTime.setEnabled(!autoPublishDisable.getSelection());
validate();
}
});
-
+
+ autoPublishEnableBuild.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (updating || !autoPublishEnableBuild.getSelection())
+ return;
+ updating = true;
+ execute(new SetServerAutoPublishDefaultCommand(getServer(), Server.AUTO_PUBLISH_BUILD));
+ updating = false;
+ autoPublishTimeLabel.setEnabled(!autoPublishDisable.getSelection());
+ autoPublishTime.setEnabled(!autoPublishDisable.getSelection());
+ validate();
+ }
+ });
+
autoPublishDisable.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (updating || !autoPublishDisable.getSelection())
@@ -659,8 +704,8 @@
updating = true;
execute(new SetServerAutoPublishDefaultCommand(getServer(), Server.AUTO_PUBLISH_DISABLE));
updating = false;
- autoPublishTimeLabel.setEnabled(autoPublishEnable.getSelection());
- autoPublishTime.setEnabled(autoPublishEnable.getSelection());
+ autoPublishTimeLabel.setEnabled(!autoPublishDisable.getSelection());
+ autoPublishTime.setEnabled(!autoPublishDisable.getSelection());
validate();
}
});
@@ -947,17 +992,27 @@
Server svr = (Server) server;
int publishSetting = svr.getAutoPublishSetting();
autoPublishDisable.setSelection(publishSetting == Server.AUTO_PUBLISH_DISABLE);
- autoPublishEnable.setSelection(publishSetting == Server.AUTO_PUBLISH_ENABLE);
+ autoPublishEnableResource.setSelection(publishSetting == Server.AUTO_PUBLISH_RESOURCE);
+ autoPublishEnableBuild.setSelection(publishSetting == Server.AUTO_PUBLISH_BUILD);
autoPublishTime.setSelection(svr.getAutoPublishTime());
if (readOnly) {
autoPublishDisable.setEnabled(false);
- autoPublishEnable.setEnabled(false);
+ autoPublishEnableResource.setEnabled(false);
+ autoPublishEnableBuild.setEnabled(false);
autoPublishTime.setEnabled(false);
} else {
autoPublishDisable.setEnabled(true);
- autoPublishEnable.setEnabled(true);
- autoPublishTime.setEnabled(publishSetting == Server.AUTO_PUBLISH_ENABLE);
+ autoPublishEnableResource.setEnabled(true);
+ autoPublishEnableBuild.setEnabled(true);
+ autoPublishTime.setEnabled(publishSetting != Server.AUTO_PUBLISH_DISABLE);
+ }
+
+ List<ServerEditorOverviewPageModifier> pageModifiersLst = ServerUIPlugin.getServerEditorOverviewPageModifiers();
+ for (ServerEditorOverviewPageModifier curPageModifier : pageModifiersLst) {
+ if(server != null && server.getServerType() != null)
+ curPageModifier.setServerWorkingCopy(server);
+ curPageModifier.handlePropertyChanged(new PropertyChangeEvent(this, AbstractUIControl.PROP_SERVER_TYPE, oldServerType, server.getServerType()));
}
}
@@ -980,8 +1035,16 @@
mForm.getMessageManager().removeMessage("config", serverConfiguration);
if (server != null && server.getServerType() != null && server.getServerType().hasServerConfiguration()) {
IFolder folder = getServer().getServerConfiguration();
- if (folder == null || !folder.exists())
- mForm.getMessageManager().addMessage("config", Messages.errorMissingConfiguration, null, IMessageProvider.ERROR, serverConfiguration);
+
+ if (folder == null || !folder.exists()) {
+ IProject project = null;
+ if (folder != null)
+ project = folder.getProject();
+ if (project != null && project.exists() && !project.isOpen())
+ mForm.getMessageManager().addMessage("config", NLS.bind(Messages.errorConfigurationNotAccessible, project.getName()), null, IMessageProvider.ERROR, serverConfiguration);
+ else
+ mForm.getMessageManager().addMessage("config", Messages.errorMissingConfiguration, null, IMessageProvider.ERROR, serverConfiguration);
+ }
}
}
@@ -1021,4 +1084,37 @@
else if (serverConfiguration != null)
serverConfiguration.setFocus();
}
+
+ public String getControlStringValue(String controlId) {
+ if (controlId != null && AbstractUIControl.PROP_HOSTNAME.equals(controlId))
+ return hostname.getText();
+ return null;
+ }
+
+ public void handleUIControlMapChanged(Map<String, UIControlEntry> controlMap) {
+ if (controlMap == null)
+ return;
+
+ for (String curControlId : controlMap.keySet()) {
+ if (AbstractUIControl.PROP_HOSTNAME.equals(curControlId)) {
+ UIControlEntry curControlEntry = controlMap.get(curControlId);
+ if (hostnameLabel != null)
+ hostnameLabel.setEnabled(curControlEntry.isEnabled());
+
+ if (hostname != null){
+ if (curControlEntry.getNewTextValue() != null)
+ hostname.setText(curControlEntry.getNewTextValue());
+
+ hostname.setEnabled(curControlEntry.isEnabled());
+ }
+
+ if (hostnameDecoration != null){
+ if(curControlEntry.isEnabled())
+ hostnameDecoration.show();
+ else
+ hostnameDecoration.hide();
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java
index 6d6a8cd..7038047 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/ServerEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -352,14 +352,22 @@
try {
monitor = ProgressUtil.getMonitorFor(monitor);
int ticks = 2000;
+ int pages = serverPages == null ? 0 : serverPages.size();
+ int pagesTicks = ( pages * 100);
String name = "";
if (server != null)
name = server.getName();
- monitor.beginTask(NLS.bind(Messages.savingTask, name), ticks);
+ monitor.beginTask(NLS.bind(Messages.savingTask, name), ticks + pagesTicks);
if (server != null)
ticks /= 2;
if (server != null) {
+ iterator = serverPages.iterator();
+ while(iterator.hasNext()) {
+ IEditorPart part = (IEditorPart) iterator.next();
+ part.doSave(ProgressUtil.getSubMonitorFor(monitor, 100));
+ }
+
server.save(false, ProgressUtil.getSubMonitorFor(monitor, ticks));
getCommandManager().resourceSaved(serverId);
commandManager.updateTimestamps(serverId);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/extension/ExtensionSite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/extension/ExtensionSite.java
deleted file mode 100644
index 05ce0dd..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/extension/ExtensionSite.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.extension;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.update.core.ICategory;
-import org.eclipse.update.core.IFeature;
-import org.eclipse.update.core.ISite;
-import org.eclipse.update.core.ISiteFeatureReference;
-import org.eclipse.wst.server.core.internal.IMemento;
-import org.eclipse.wst.server.core.internal.InstallableRuntime;
-import org.eclipse.wst.server.ui.internal.ProgressUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-/**
- *
- */
-public class ExtensionSite {
- private IMemento memento;
-
- public ExtensionSite(IMemento memento) {
- super();
- this.memento = memento;
- }
-
- public String getUrl() {
- return memento.getString("url");
- }
-
- private List<IFeature> featureList;
-
- protected static boolean hasCategory(ISiteFeatureReference ref, String category) {
- ICategory[] cat = ref.getCategories();
- if (cat == null)
- return false;
-
- int size = cat.length;
- for (int i = 0; i < size; i++)
- if (category.equals(cat[i].getName()))
- return true;
-
- return false;
- }
-
- protected static boolean matches(String a, String b) {
- if (a == null || "*".equals(a))
- return true;
-
- if (b == null)
- return false;
-
- StringTokenizer st = new StringTokenizer(a, ",");
- while (st.hasMoreTokens()) {
- String c = st.nextToken().trim();
- if (b.equals(c))
- return true;
- }
-
- return false;
- }
-
- public synchronized List<IFeature> getFeatures(String category, IProgressMonitor monitor) throws CoreException {
- if (featureList != null)
- return featureList;
-
- String fromSite = getUrl();
-
- List<IFeature> list = new ArrayList<IFeature>();
- if (fromSite == null)
- return list;
-
- URL fromSiteURL = null;
- try {
- fromSiteURL = new URL(fromSite);
- } catch (MalformedURLException e) {
- return list;
- }
-
- monitor.beginTask("Searching " + fromSite, 100);
- ISite site = null;
- try {
- site = InstallableRuntime.getSite(fromSiteURL, ProgressUtil.getSubMonitorFor(monitor, 5));
- } catch (IOException e) {
- String host = fromSiteURL.getHost();
- throw new CoreException(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, host, e));
- }
- // java.net.UnknownHostException
-
- ISiteFeatureReference[] featureRefs = site.getFeatureReferences();
- for (int i = 0; i < featureRefs.length; i++) {
- if (hasCategory(featureRefs[i], category)) {
- if (matches(featureRefs[i].getOS(), Platform.getOS()) &&
- matches(featureRefs[i].getOSArch(), Platform.getOSArch()) &&
- matches(featureRefs[i].getWS(), Platform.getWS())) {
- IFeature feature2 = featureRefs[i].getFeature(ProgressUtil.getSubMonitorFor(monitor, 5));
- if (feature2 != null)
- list.add(feature2);
- }
- }
- }
- monitor.done();
-
- featureList = list;
- return featureList;
- }
-
- public String toString() {
- return "ExtensionSite[" + getUrl() + "]";
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/extension/ExtensionUtility.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/extension/ExtensionUtility.java
deleted file mode 100644
index 4a2fa05..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/extension/ExtensionUtility.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.extension;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.update.configuration.IConfiguredSite;
-import org.eclipse.update.configuration.ILocalSite;
-import org.eclipse.update.core.IFeature;
-import org.eclipse.update.core.IFeatureReference;
-import org.eclipse.update.core.IURLEntry;
-import org.eclipse.update.core.IVerificationListener;
-import org.eclipse.update.core.IVerificationResult;
-import org.eclipse.update.core.SiteManager;
-import org.eclipse.update.core.VersionedIdentifier;
-import org.eclipse.wst.server.core.internal.IInstallableServer;
-import org.eclipse.wst.server.core.internal.IMemento;
-import org.eclipse.wst.server.core.internal.InstallableServer;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.internal.XMLMemento;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.ProgressUtil;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.wizard.ExtensionWizard;
-import org.osgi.framework.Version;
-
-public class ExtensionUtility {
- public static boolean launchExtensionWizard(Shell shell, String title, String message) {
- ExtensionWizard wizard2 = new ExtensionWizard(title, message);
- WizardDialog dialog = new WizardDialog(shell, wizard2);
- if (dialog.open() != Window.CANCEL)
- return true;
- return false;
- }
-
- public static ExtensionSite[] getExtensionItems(URL url) throws CoreException {
- InputStream in = null;
- try {
- in = url.openStream();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not load URL " + url);
- }
-
- if (in == null)
- throw new CoreException(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, "Could not load extensions", null));
-
- try {
- IMemento memento = XMLMemento.loadMemento(in);
- IMemento children[] = memento.getChildren("site");
- int size = children.length;
- List<ExtensionSite> list = new ArrayList<ExtensionSite>(size);
- for (int i = 0; i < size; i++) {
- ExtensionSite item = new ExtensionSite(children[i]);
- list.add(item);
- }
-
- ExtensionSite[] items = new ExtensionSite[list.size()];
- list.toArray(items);
- return items;
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, 0, e.getMessage(), e));
- }
- }
-
- /**
- * Returns an array of all known extension items.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return the array of extensions items {@link ExtensionSite}
- */
- public static ExtensionSite[] getExtensionItems() {
- URL url = ServerUIPlugin.getInstance().getBundle().getEntry("serverAdapterSites.xml");
-
- try {
- return getExtensionItems(url);
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Could not get extension items");
- return null;
- }
- }
-
- /**
- * Return true if the new feature is already installed, or a newer one is.
- *
- * @param existing
- * @param newFeature
- * @return true if the new feature is already installed, or a newer one is.
- */
- protected static boolean alreadyExists(List existing, IFeature newFeature) {
- if (existing.contains(newFeature))
- return true;
-
- VersionedIdentifier newVi = newFeature.getVersionedIdentifier();
- String ver = newVi.toString();
- int ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- Version newV = new Version(ver);
-
- Iterator iterator = existing.iterator();
- while (iterator.hasNext()) {
- IFeature feature = (IFeature) iterator.next();
- VersionedIdentifier vi = feature.getVersionedIdentifier();
- if (vi.getIdentifier().equals(newVi.getIdentifier())) {
- ver = vi.toString();
- ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- Version nextCand = new Version(ver);
- if (nextCand.compareTo(newV) >= 0)
- return true;
- }
- }
-
- return false;
- }
-
- public static void addFeature(List<IFeature> list, List<IFeature> existing, IFeature newFeature, FeatureListener listener) {
- if (alreadyExists(existing, newFeature))
- return;
-
- VersionedIdentifier newVi = newFeature.getVersionedIdentifier();
- String ver = newVi.toString();
- int ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- Version newV = new Version(ver);
- IFeature remove = null;
-
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- IFeature feature = (IFeature) iterator.next();
- VersionedIdentifier vi = feature.getVersionedIdentifier();
- if (vi.getIdentifier().equals(newVi.getIdentifier())) {
- ver = vi.toString();
- ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- Version nextCand = new Version(ver);
- if (nextCand.compareTo(newV) < 0) {
- remove = feature;
- } else // new feature is older
- return;
- }
- }
- if (remove != null) {
- list.remove(remove);
- listener.featureRemoved(remove);
- }
-
- list.add(newFeature);
- listener.featureFound(newFeature);
- }
-
- public static void addFeatures(List<IFeature> list, List<IFeature> existing, List newFeatures, FeatureListener listener) {
- Iterator iterator = newFeatures.iterator();
- while (iterator.hasNext()) {
- addFeature(list, existing, (IFeature) iterator.next(), listener);
- }
- }
-
- public interface FeatureListener {
- public void featureFound(IFeature feature);
- public void featureRemoved(IFeature feature);
- public void siteFailure(String host);
- }
-
- protected static List<IFeature> getExistingFeatures(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(Messages.installableServerLocal, 100);
- ILocalSite site = SiteManager.getLocalSite();
- IConfiguredSite[] sites = site.getCurrentConfiguration().getConfiguredSites();
- int size = sites.length;
- List<IFeature> list = new ArrayList<IFeature>(200);
- for (int i = 0; i < size; i++) {
- IFeatureReference[] refs = sites[i].getFeatureReferences();
- int size2 = refs.length;
- for (int j = 0; j < size2; j++) {
- IFeature f = refs[j].getFeature(ProgressUtil.getSubMonitorFor(monitor, 5));
- if (!list.contains(f))
- list.add(f);
- }
- }
- monitor.done();
-
- return list;
- }
-
- public static IFeature[] getAllFeatures(final String id, final FeatureListener listener, IProgressMonitor monitor) throws CoreException {
- monitor = ProgressUtil.getMonitorFor(monitor);
- monitor.beginTask("", 1100);
-
- monitor.subTask(Messages.installableServerLocal);
- final List<IFeature> existing = getExistingFeatures(ProgressUtil.getSubMonitorFor(monitor, 100));
-
- final ExtensionSite[] items = ExtensionUtility.getExtensionItems();
- IInstallableServer[] servers = ServerPlugin.getInstallableServers();
- final int x = 1000 / (items.length + servers.length);
-
- monitor.worked(50);
- final List<IFeature> list = new ArrayList<IFeature>();
- int size = items.length;
-
- Thread[] threads = new Thread[size];
- for (int i = 0; i < size; i++) {
- try {
- if (monitor.isCanceled())
- return null;
-
- monitor.subTask(NLS.bind(Messages.installableServerSearching, items[i].getUrl()));
- final int ii = i;
- final IProgressMonitor monitor2 = monitor;
- threads[i] = new Thread("Extension Checker") {
- public void run() {
- try {
- List<IFeature> list2 = items[ii].getFeatures(id, ProgressUtil.getSubMonitorFor(monitor2, x));
- addFeatures(list, existing, list2, listener);
- } catch (CoreException ce) {
- listener.siteFailure(ce.getLocalizedMessage());
- Trace.trace(Trace.WARNING, "Error downloading server adapter info", ce);
- }
- }
- };
- threads[i].setDaemon(true);
- threads[i].start();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error downloading server adapter info 2", e);
- }
- }
-
- for (int i = 0; i < size; i++) {
- try {
- if (monitor.isCanceled())
- return null;
-
- if (threads[i].isAlive())
- threads[i].join();
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error downloading server adapter info 3", e);
- }
- }
-
- // add installable servers
- size = servers.length;
- for (int i = 0; i < size; i++) {
- if (monitor.isCanceled())
- return null;
-
- InstallableServer is = (InstallableServer) servers[i];
- monitor.subTask(NLS.bind(Messages.installableServerSearching, is.getFromSite()));
- IFeature feature = is.getFeature(ProgressUtil.getSubMonitorFor(monitor, x));
- if (feature != null)
- addFeature(list, existing, feature, listener);
- }
-
- IFeature[] ef = new IFeature[list.size()];
- list.toArray(ef);
- monitor.done();
- return ef;
- }
-
- public static String getLicense(IFeature feature) {
- IURLEntry license = feature.getLicense();
- if (license != null)
- return license.getAnnotation();
-
- return null;
- }
-
- public static String getDescription(IFeature feature) {
- IURLEntry license = feature.getDescription();
- if (license != null)
- return license.getAnnotation();
-
- return null;
- }
-
- /*
- * @see IInstallableServer#install(IProgressMonitor)
- */
- public static void install(IFeature feature, IProgressMonitor monitor) throws CoreException {
- try {
- IVerificationListener verificationListener = new IVerificationListener() {
- public int prompt(IVerificationResult result) {
- return CHOICE_INSTALL_TRUST_ONCE;
- }
- };
- SiteManager.getLocalSite().getCurrentConfiguration().getConfiguredSites()[0].install(feature, verificationListener, monitor);
- } catch (CoreException ce) {
- Trace.trace(Trace.WARNING, "Error installing server adapter", ce);
- throw ce;
- }
-
- try {
- Thread.sleep(1000);
- } catch (Exception e) {
- // ignore
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/AbstractServerLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/AbstractServerLabelProvider.java
new file mode 100644
index 0000000..76f7084
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/AbstractServerLabelProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.provisional;
+
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.cnf.ServerDecorator;
+
+/**
+ * A default or parent class that provides the default labels: Start, Stop, Starting, etc..
+ *
+ * @author arvera
+ *
+ */
+public class AbstractServerLabelProvider{
+
+ /**
+ * Based on a server return the server state label to display in the UI
+ * @param server
+ * @return String
+ */
+ public String getServerStateLabel(IServer server) {
+ if (server == null || server.getServerType() == null)
+ return null;
+
+ return ServerDecorator.getStateLabel(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ConnectedUIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ConnectedUIDecorator.java
deleted file mode 100644
index 3a7d252..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ConnectedUIDecorator.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.provisional;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-
-public class ConnectedUIDecorator extends UIDecorator {
- private static final String[] serverStateUnmanaged = new String[] {
- "",
- Messages.viewStatusStarting4,
- Messages.viewStatusStarted2,
- Messages.viewStatusStopping4,
- Messages.viewStatusStopped2};
-
- private static final String[] startingText = new String[] {
- Messages.viewStatusStarting1,
- Messages.viewStatusStarting2,
- Messages.viewStatusStarting3};
-
- private static final String[] stoppingText = new String[] {
- Messages.viewStatusStopping1,
- Messages.viewStatusStopping2,
- Messages.viewStatusStopping3};
-
- private static final Image[] startingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
- };
-
- private static final Image[] stoppingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
- };
-
- /**
- * @see UIDecorator#getStateLabel(int, String, int)
- */
- public String getStateLabel(int state, String mode, int count) {
- if (state == IServer.STATE_UNKNOWN)
- return "";
- else if (state == IServer.STATE_STARTING)
- return startingText[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingText[count];
- else if (state == IServer.STATE_STARTED) {
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return Messages.viewStatusStartedDebug;
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return Messages.viewStatusStartedProfile;
- else
- return Messages.viewStatusStarted;
- } else if (state == IServer.STATE_STOPPED)
- return Messages.viewStatusStopped;
-
- return serverStateUnmanaged[state];
- }
-
- /**
- * @see UIDecorator#getStateImage(int, String, int)
- */
- public Image getStateImage(int state, String mode, int count) {
- if (state == IServer.STATE_UNKNOWN)
- return null;
- else if (state == IServer.STATE_STARTING)
- return startingImages[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingImages[count];
- else if (state == IServer.STATE_STOPPED)
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED);
- else { //if (state == IServer.STATE_STARTED) {
- //String mode = server.getMode();
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
- else
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED);
- }
- }
-
- public boolean canRestart() {
- return false;
- }
-
- public void setupAction(Action action, int action2) {
- action.setToolTipText(Messages.actionStopToolTip2);
- action.setText(Messages.actionStop2);
- action.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_DISCONNECT));
- action.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_DISCONNECT));
- action.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_DISCONNECT));
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ManagedUIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ManagedUIDecorator.java
index 29206c5..52c775c 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ManagedUIDecorator.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/ManagedUIDecorator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -34,18 +34,35 @@
Messages.viewStatusStopping2,
Messages.viewStatusStopping3};
- private static final Image[] startingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
- };
+ private static Image[] startingImages;
+ private static Image[] stoppingImages;
- private static final Image[] stoppingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
- };
-
+ /**
+ * Initialize the variables for this class
+ */
+ public void init(){
+ loadImages();
+ }
+
+ /**
+ * Load the Server starting images.
+ * NOTE: This is done so that we don't initialize the images when a label is being requested
+ */
+ public void loadImages(){
+ if (startingImages == null){
+ startingImages = new Image[] {
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
+ };
+ stoppingImages = new Image[] {
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
+ ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
+ };
+ }
+ }
+
/**
* @see UIDecorator#getStateLabel(int, String, int)
*/
@@ -72,7 +89,10 @@
/**
* @see UIDecorator#getStateImage(int, String, int)
*/
- public Image getStateImage(int state, String mode, int count) {
+ public Image getStateImage(int state, String mode, int count) {
+ // Only initialize the images when an image is required
+ init();
+
if (state == IServer.STATE_UNKNOWN)
return null;
else if (state == IServer.STATE_STARTING)
@@ -99,4 +119,10 @@
public boolean canRestart() {
return true;
}
+
+ @Override
+ public Image getStateImageOverlay(int state, String mode, int count) {
+ // TODO Intentionally left blank
+ return null;
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/PublishedUIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/PublishedUIDecorator.java
deleted file mode 100644
index b4f63b0..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/PublishedUIDecorator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.provisional;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-
-public class PublishedUIDecorator extends UIDecorator {
- private static final String[] serverStateUnmanaged = new String[] {
- "",
- Messages.viewStatusStarting4,
- Messages.viewStatusStarted2,
- Messages.viewStatusStopping4,
- Messages.viewStatusStopped2};
-
- private static final String[] startingText = new String[] {
- Messages.viewStatusStarting1,
- Messages.viewStatusStarting2,
- Messages.viewStatusStarting3};
-
- private static final String[] stoppingText = new String[] {
- Messages.viewStatusStopping1,
- Messages.viewStatusStopping2,
- Messages.viewStatusStopping3};
-
- private static final Image[] startingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTING_3)
- };
-
- private static final Image[] stoppingImages = new Image[] {
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_1),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2),
- ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPING_2)
- };
-
- /**
- * @see UIDecorator#getStateLabel(int, String, int)
- */
- public String getStateLabel(int state, String mode, int count) {
- if (state == IServer.STATE_UNKNOWN)
- return "";
- else if (state == IServer.STATE_STARTING)
- return startingText[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingText[count];
- else if (state == IServer.STATE_STARTED) {
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return Messages.viewStatusStartedDebug;
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return Messages.viewStatusStartedProfile;
- else
- return Messages.viewStatusStarted;
- } else if (state == IServer.STATE_STOPPED)
- return Messages.viewStatusStopped;
-
- return serverStateUnmanaged[state];
- }
-
- /**
- * @see UIDecorator#getStateImage(int, String, int)
- */
- public Image getStateImage(int state, String mode, int count) {
- if (state == IServer.STATE_UNKNOWN)
- return null;
- else if (state == IServer.STATE_STARTING)
- return startingImages[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingImages[count];
- else if (state == IServer.STATE_STOPPED)
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED);
- else { //if (state == IServer.STATE_STARTED) {
- //String mode = server.getMode();
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
- else
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED);
- }
- }
-
- public String getModuleName() {
- return "module";
- }
-
- public boolean canRestart() {
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java
index de9952d..f4dc21d 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecorator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005,2008 IBM 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
@@ -11,6 +11,7 @@
package org.eclipse.wst.server.ui.internal.provisional;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
@@ -37,6 +38,12 @@
* @return org.eclipse.jface.parts.IImage
*/
public abstract Image getStateImage(int state, String mode, int count);
+
+ public abstract Image getStateImageOverlay(int state, String mode, int count);
+
+ public ImageDescriptor getStateImageDescriptor(int state, String mode, int count){
+ return null;
+ }
public String getModuleName() {
return "module";
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java
index e55fdcf..eb92b38 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/provisional/UIDecoratorManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005,2010 IBM 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
@@ -11,11 +11,26 @@
package org.eclipse.wst.server.ui.internal.provisional;
import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.ui.internal.cnf.CNFManagedUIDecorator;
public class UIDecoratorManager {
protected static UIDecorator decorator = new ManagedUIDecorator();
+ protected static UIDecorator decorator2 = new CNFManagedUIDecorator();
+ @Deprecated
public static UIDecorator getUIDecorator(IServerType serverType) {
return decorator;
}
+ @Deprecated
+ public static UIDecorator getCNFUIDecorator(IServerType serverType) {
+ return decorator2;
+ }
+
+ public static UIDecorator getUIDecorator(){
+ return decorator;
+ }
+
+ public static UIDecorator getCNFUIDecorator() {
+ return decorator2;
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java
index 43bf11e..9b6a668 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/DeleteAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -25,6 +25,7 @@
import org.eclipse.swt.widgets.Shell;
/**
* Action for deleting server resources.
+ * @deprecated Instead use {@link GlobalDeleteAction}
*/
public class DeleteAction extends AbstractServerAction {
protected IServer[] servers;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/GlobalDeleteAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/GlobalDeleteAction.java
index 4666249..518705e 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/GlobalDeleteAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/GlobalDeleteAction.java
@@ -10,111 +10,151 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal.view.servers;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionProviderAction;
+import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.ui.internal.DeleteServerDialog;
import org.eclipse.wst.server.ui.internal.Messages;
/**
* This global delete action handles both the server and module deletion.
*/
public class GlobalDeleteAction extends SelectionProviderAction {
- protected Shell shell;
- private DeleteAction serverDeleteAction = null;
- private boolean isRemoveServer = false;
+ protected IServer[] servers;
+ protected IFolder[] configs;
+ private Shell shell;
public GlobalDeleteAction(Shell shell, ISelectionProvider selectionProvider) {
super(selectionProvider, Messages.actionDelete);
this.shell = shell;
- setEnabled(false);
- serverDeleteAction = new DeleteAction(shell, selectionProvider);
+ ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+ setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
+ setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
}
-
- private boolean isRemoveModuleActionEnabled(IStructuredSelection sel) {
- if (sel == null || sel.isEmpty())
- return false;
-
- // get selection but avoid no selection or multiple selection
- IModule[] moduleArray = null;
- Iterator iterator = sel.iterator();
- Object obj = iterator.next();
- if (obj instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) obj;
- moduleArray = ms.module;
- }
-
- if (iterator.hasNext()) {
- moduleArray = null;
- }
-
- return (moduleArray == null || moduleArray.length == 1);
- }
-
- /**
- * Update the enabled state.
- *
- * @param sel a selection
- */
+
+ @Override
public void selectionChanged(IStructuredSelection sel) {
if (sel.isEmpty()) {
setEnabled(false);
return;
}
-
- // Check if the delete action is enabled or not.
- serverDeleteAction.selectionChanged(sel);
-
- if (serverDeleteAction.isEnabled()) {
- // The server deletion action is already enabled.
- isRemoveServer = true;
- setEnabled(true);
- return;
+ boolean enabled = false;
+ Iterator iterator = sel.iterator();
+ while (iterator.hasNext()) {
+ Object obj = iterator.next();
+ if (obj instanceof IServer) {
+ IServer server = (IServer) obj;
+ if (accept(server))
+ enabled = true;
+ }
+ else if (obj instanceof ModuleServer){
+ ModuleServer ms = (ModuleServer) obj;
+ if (accept(ms))
+ enabled = true;
+ }
+ else {
+ setEnabled(false);
+ return;
+ }
}
-
- // Check the remove module action.
- if (isRemoveModuleActionEnabled(sel)) {
- isRemoveServer = false;
- setEnabled(true);
- } else {
- setEnabled(false);
- }
+ setEnabled(enabled);
}
-
- public void run() {
- if (isRemoveServer) {
- // Run the server delete action;
- serverDeleteAction.run();
- return;
+
+ public boolean accept(ModuleServer ms){
+ if (ms.getServer() == null)
+ return false;
+
+ IStatus status = ms.getServer().canModifyModules(null,ms.module, null);
+ if (status.isOK())
+ return true;
+
+ return false;
+ }
+
+ public boolean accept(IServer server) {
+ servers = new IServer[] { server };
+ List<IFolder> list = new ArrayList<IFolder>();
+
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ if (servers[i].isReadOnly())
+ return false;
+
+ if (servers[i].getServerConfiguration() != null)
+ list.add(servers[i].getServerConfiguration());
}
- // get selection but avoid no selection or multiple selection
+
+ // remove configurations that are still referenced by other servers
+ IServer[] servers2 = ServerCore.getServers();
+ if (servers2 != null) {
+ int size2 = servers2.length;
+ for (int j = 0; j < size2; j++) {
+ boolean found = false;
+ for (int i = 0; i < size; i++) {
+ if (servers[i].equals(servers2[j]))
+ found = true;
+ }
+ if (!found) {
+ IFolder folder = servers2[j].getServerConfiguration();
+ if (folder != null && list.contains(folder))
+ list.remove(folder);
+ }
+ }
+ }
+
+ configs = new IFolder[list.size()];
+ list.toArray(configs);
+ return true;
+ }
+
+ @Override
+ public void run() {
IServer server = null;
IModule[] moduleArray = null;
+
IStructuredSelection sel = getStructuredSelection();
+ // filter the selection
if (!sel.isEmpty()) {
Iterator iterator = sel.iterator();
Object obj = iterator.next();
-
- // and the method calls serverDeleteAction, then returns
if (obj instanceof IServer)
server = (IServer) obj;
if (obj instanceof ModuleServer) {
ModuleServer ms = (ModuleServer) obj;
- server = ms.server; // even though ms.server is public, let's stick to the getServer call
+ server = ms.server;
moduleArray = ms.module;
}
-
+ // avoid no selection or multiple selection
if (iterator.hasNext()) {
server = null;
moduleArray = null;
}
}
- if (moduleArray != null && moduleArray.length == 1) {
+ // Perform actions
+ if (server != null && moduleArray == null)
+ deleteServer(server);
+
+ if (moduleArray != null && moduleArray.length == 1)
new RemoveModuleAction(shell, server, moduleArray[0]).run();
- }
+
+ }
+
+ protected void deleteServer(IServer server){
+ DeleteServerDialog dsd = new DeleteServerDialog(shell, servers, configs);
+ dsd.open();
}
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java
index 029d071..58a7cf0 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleSloshAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -14,8 +14,10 @@
import java.util.List;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
@@ -24,6 +26,7 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
import org.eclipse.wst.server.ui.internal.wizard.ModifyModulesWizard;
/**
*
@@ -35,6 +38,11 @@
setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_MODIFY_MODULES));
setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_MODIFY_MODULES));
setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DTOOL_MODIFY_MODULES));
+ try {
+ selectionChanged((IStructuredSelection) selectionProvider.getSelection());
+ } catch (Exception e) {
+ ServerUIPlugin.getInstance().getLog().log(new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, e.getLocalizedMessage(), e));
+ }
}
/**
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java
index c890066..5f31880 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PasteAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007,2008 IBM 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
@@ -46,7 +46,6 @@
setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
this.clipboard = clipboard;
- //setEnabled(false);
}
/**
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java
index f74d13c..5ed16ee 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishAction.java
@@ -55,6 +55,8 @@
public Object getAdapter(Class adapter) {
if (Shell.class.equals(adapter))
return shell;
+ if (String.class.equals(adapter))
+ return "user";
return null;
}
};
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishCleanAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishCleanAction.java
index b08aa63..442e0e3 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishCleanAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/PublishCleanAction.java
@@ -57,6 +57,8 @@
public Object getAdapter(Class adapter) {
if (Shell.class.equals(adapter))
return shell;
+ if (String.class.equals(adapter))
+ return "user";
return null;
}
};
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java
index 756ba36..1cb5e5c 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RemoveModuleAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM 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
@@ -10,16 +10,23 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal.view.servers;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.swt.widgets.Shell;
/**
* Action for removing a module from a server.
*/
@@ -27,6 +34,7 @@
protected IServer server;
protected IModule module;
protected Shell shell;
+ CoreException saveServerException = null;
/**
* RemoveModuleAction constructor.
@@ -38,7 +46,10 @@
public RemoveModuleAction(Shell shell, IServer server, IModule module) {
super(Messages.actionRemove);
this.shell = shell;
-
+ ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+ setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
+ setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
this.server = server;
this.module = module;
}
@@ -49,9 +60,34 @@
public void run() {
if (MessageDialog.openConfirm(shell, Messages.defaultDialogTitle, Messages.dialogRemoveModuleConfirm)) {
try {
- IServerWorkingCopy wc = server.createWorkingCopy();
- wc.modifyModules(null, new IModule[] { module }, null);
- server = wc.save(true, null);
+ final ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
+ dialog.setBlockOnOpen(false);
+ dialog.setCancelable(true);
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ try {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ if (monitor.isCanceled()) {
+ return;
+ }
+ wc.modifyModules(null, new IModule[] { module }, monitor);
+ if (monitor.isCanceled()) {
+ return;
+ }
+ server = wc.save(true, monitor);
+ Trace.trace(Trace.INFO, "Done save server configuration in RemoveModuleAction.");
+ } catch (CoreException e) {
+ Trace.trace(Trace.WARNING, "Failed to save server configuration. Could not remove module", e);
+ saveServerException = e;
+ }
+ }
+ };
+ dialog.run(true, true, runnable);
+
+ // Error when saving server so do not proceed on the remove action.
+ if (saveServerException != null) {
+ return;
+ }
if (server.getServerState() != IServer.STATE_STOPPED &&
ServerUIPlugin.getPreferences().getPublishOnAddRemoveModule()) {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java
index 183cd53..524abf0 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/RestartModuleAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -10,12 +10,7 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal.view.servers;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.Messages;
@@ -35,20 +30,13 @@
setEnabled(server.getServerState() == IServer.STATE_STARTED
&& server.getModuleState(module) != IServer.STATE_UNKNOWN
- && server.canControlModule(module, null).isOK());
+ && server.canRestartModule(module, null).isOK());
}
/**
* Implementation of method defined on <code>IAction</code>.
*/
public void run() {
- int size = module.length;
- Job restartJob = new Job(NLS.bind(Messages.jobRestarting, module[size-1].getName())) {
- protected IStatus run(IProgressMonitor monitor) {
- server.restartModule(module, null);
- return Status.OK_STATUS;
- }
- };
- restartJob.schedule();
+ server.restartModule(module, null);
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java
index 34f7733..a80369f 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IServer;
@@ -21,10 +22,10 @@
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.cnf.ServerDecorator;
import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
import org.eclipse.wst.server.ui.internal.viewers.BaseCellLabelProvider;
import org.eclipse.wst.server.ui.internal.viewers.ServerTreeContentProvider;
-import org.eclipse.swt.graphics.Image;
/**
* Server table label provider.
*/
@@ -254,23 +255,6 @@
*/
protected Image getStateImage(IServerType serverType, int state, String mode) {
return UIDecoratorManager.getUIDecorator(serverType).getStateImage(state, mode, count);
- /*if (state == IServer.STATE_UNKNOWN)
- return null;
- else if (state == IServer.STATE_STARTING)
- return startingImages[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingImages[count];
- else if (state == IServer.STATE_STOPPED)
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STOPPED);
- else { //if (state == IServer.STATE_STARTED) {
- //String mode = server.getMode();
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_DEBUG);
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED_PROFILE);
- else
- return ImageResource.getImage(ImageResource.IMG_SERVER_STATE_STARTED);
- }*/
}
/**
@@ -280,38 +264,17 @@
* @param server org.eclipse.wst.server.core.IServer
*/
protected String getServerStateLabel(IServer server) {
- return getStateLabel(server.getServerType(), server.getServerState(), server.getMode());
+ return ServerDecorator.getServerStateLabel(server);
}
/**
* Returns a string representing the given state.
*
* @return java.lang.String
+ * @deprecated
*/
protected String getStateLabel(IServerType serverType, int state, String mode) {
return UIDecoratorManager.getUIDecorator(serverType).getStateLabel(state, mode, count);
- /*if (stateSet == IServerType.SERVER_STATE_SET_PUBLISHED)
- return "";
-
- if (stateSet == IServerType.SERVER_STATE_SET_MANAGED) {
- if (state == IServer.STATE_UNKNOWN)
- return "";
- else if (state == IServer.STATE_STARTING)
- return startingText[count];
- else if (state == IServer.STATE_STOPPING)
- return stoppingText[count];
- else if (state == IServer.STATE_STARTED) {
- if (ILaunchManager.DEBUG_MODE.equals(mode))
- return Messages.viewStatusStartedDebug");
- else if (ILaunchManager.PROFILE_MODE.equals(mode))
- return Messages.viewStatusStartedProfile");
- else
- return Messages.viewStatusStarted");
- } else if (state == IServer.STATE_STOPPED)
- return Messages.viewStatusStopped");
- }
-
- return serverStateUnmanaged[state];*/
}
protected void animate() {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
index cc49345..b38eb94 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServerTableViewer.java
@@ -58,7 +58,6 @@
protected static Set<String> starting = new HashSet<String>(4);
protected ServerTableLabelProvider labelProvider;
- protected ILabelProviderListener labelProviderListener;
//protected ISelectionListener dsListener;
protected ServersView view;
@@ -453,15 +452,12 @@
((Server) servers[i]).addPublishListener(publishListener);
}
}
-
- labelProviderListener = new ILabelProviderListener() {
- public void labelProviderChanged(LabelProviderChangedEvent event) {
- handleLabelProviderChanged(event);
- }
- };
- labelProvider.addListener(labelProviderListener);
}
+ /**
+ * @param server
+ * @deprecated With the introduction of the CNF this method shouldn't be called
+ */
protected void refreshServer(final IServer server) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
@@ -495,11 +491,6 @@
}
}
- // Remove the label provider listeners.
- if (labelProvider != null && labelProviderListener != null) {
- labelProvider.removeListener(labelProviderListener);
- }
-
clipboard.dispose();
super.handleDispose(event);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
index 21a1fa9..fa61166 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ServersView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -20,12 +20,6 @@
import org.eclipse.jface.action.*;
import org.eclipse.jface.bindings.TriggerSequence;
import org.eclipse.jface.viewers.*;
-import org.eclipse.wst.server.core.*;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.internal.UpdateServerJob;
-import org.eclipse.wst.server.core.model.ServerDelegate;
-import org.eclipse.wst.server.ui.internal.*;
-import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.FileTransfer;
@@ -35,13 +29,7 @@
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.contexts.IContextService;
@@ -49,6 +37,11 @@
import org.eclipse.ui.part.ResourceTransfer;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
+import org.eclipse.wst.server.core.*;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.eclipse.wst.server.ui.internal.*;
+import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
/**
* A view of servers, their modules, and status.
*/
@@ -222,8 +215,8 @@
for (int i = 0; i < size; i++) {
IServer server = servers[i];
if (server.getServerType() != null && server.getServerState() == IServer.STATE_UNKNOWN) {
- UpdateServerJob job = new UpdateServerJob(server);
- job.schedule();
+// UpdateServerJob job = new UpdateServerJob(server);
+// job.schedule();
}
}
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInConsoleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInConsoleAction.java
index 5b0bf53..9e05af5 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInConsoleAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInConsoleAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM 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
@@ -13,16 +13,8 @@
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.*;
+import org.eclipse.ui.console.*;
import org.eclipse.ui.views.IViewDescriptor;
import org.eclipse.ui.views.IViewRegistry;
import org.eclipse.wst.server.core.IServer;
@@ -46,7 +38,11 @@
}
public boolean accept(IServer server) {
- return (server.getServerType() != null && server.getServerState() != IServer.STATE_STOPPED);
+ return (server.getServerType() != null
+ && server.getServerState() != IServer.STATE_STOPPED
+ && server.getLaunch() != null
+ && server.getLaunch().getProcesses() != null
+ && server.getLaunch().getProcesses().length >= 1);
}
public void perform(IServer server) {
@@ -59,6 +55,9 @@
}
protected void selectProcess(IProcess process) {
+ // see bug 250999 - debug UI must be loaded before looking for debug consoles
+ org.eclipse.debug.ui.console.IConsole.class.toString();
+
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] consoles = consoleManager.getConsoles();
int size = consoles.length;
@@ -87,6 +86,7 @@
}
}
if (part != null) {
+ page.activate(part);
IConsoleView view = (IConsoleView) part.getAdapter(IConsoleView.class);
if (view != null) {
view.setFocus();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInMenuAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInMenuAction.java
index 8a6667c..d133f83 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInMenuAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ShowInMenuAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM 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
@@ -38,18 +38,15 @@
}
public Menu getMenu(Control parent) {
- System.out.println("creating menu1");
return getMenuManager().createContextMenu(parent);
}
public Menu getMenu(Menu parent) {
- System.out.println("creating menu2");
//return getMenuManager().createContextMenu(parent.getShell());
return null;
}
private MenuManager getMenuManager() {
- System.out.println("creating menu");
if (menuManager != null)
return menuManager;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartModuleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartModuleAction.java
index c60c276..254649f 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartModuleAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StartModuleAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM 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
@@ -10,18 +10,13 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal.view.servers;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
/**
- * Restart a module on a server.
+ * Start a module on a server.
*/
public class StartModuleAction extends Action {
protected IServer server;
@@ -39,20 +34,13 @@
setEnabled(server.getServerState() == IServer.STATE_STARTED
&& (server.getModuleState(module) == IServer.STATE_STOPPED
|| server.getModuleState(module) == IServer.STATE_UNKNOWN)
- && server.canControlModule(module, null).isOK());
+ && server.canRestartModule(module, null).isOK());
}
/**
* Implementation of method defined on <code>IAction</code>.
*/
public void run() {
- int size = module.length;
- Job startJob = new Job(NLS.bind(Messages.viewStatusStarting3, module[size-1].getName())) {
- protected IStatus run(IProgressMonitor monitor) {
- server.startModule(module, null);
- return Status.OK_STATUS;
- }
- };
- startJob.schedule();
+ server.startModule(module, null);
}
-}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopModuleAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopModuleAction.java
index 07c0a26..f47bb8d 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopModuleAction.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/StopModuleAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM 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
@@ -10,18 +10,13 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal.view.servers;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.ImageResource;
import org.eclipse.wst.server.ui.internal.Messages;
/**
- * Restart a module on a server.
+ * Stop a module on a server.
*/
public class StopModuleAction extends Action {
protected IServer server;
@@ -39,20 +34,13 @@
setEnabled(server.getServerState() == IServer.STATE_STARTED
&& (server.getModuleState(module) == IServer.STATE_STARTED
|| server.getModuleState(module) == IServer.STATE_UNKNOWN)
- && server.canControlModule(module, null).isOK());
+ && server.canRestartModule(module, null).isOK());
}
/**
* Implementation of method defined on <code>IAction</code>.
*/
public void run() {
- int size = module.length;
- Job stopJob = new Job(NLS.bind(Messages.viewStatusStopping3, module[size-1].getName())) {
- protected IStatus run(IProgressMonitor monitor) {
- server.stopModule(module, null);
- return Status.OK_STATUS;
- }
- };
- stopJob.schedule();
+ server.stopModule(module, null);
}
-}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseCellLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseCellLabelProvider.java
index 94ecc8c..4d89f63 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseCellLabelProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseCellLabelProvider.java
@@ -47,18 +47,7 @@
public BaseCellLabelProvider(ILabelDecorator decorator) {
super();
- if (decorator == null){
- decorator = PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
- providerListener = new ILabelProviderListener() {
- @SuppressWarnings("synthetic-access")
- public void labelProviderChanged(LabelProviderChangedEvent event) {
- fireLabelProviderChanged(event);
- }
- };
- decorator.addListener(providerListener);
- }
-
- this.decorator = decorator;
+ this.decorator = getDecorator();
}
public Point getToolTipShift(Object object) {
@@ -79,6 +68,20 @@
}
super.dispose();
}
+
+ public ILabelDecorator getDecorator(){
+ if (decorator == null){
+ decorator = PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
+ providerListener = new ILabelProviderListener() {
+ @SuppressWarnings("synthetic-access")
+ public void labelProviderChanged(LabelProviderChangedEvent event) {
+ fireLabelProviderChanged(event);
+ }
+ };
+ decorator.addListener(providerListener);
+ }
+ return decorator;
+ }
/**
* Extenders of this class would implement this method to provide an image to the column based on the element
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java
index a8cf616..8dbb6dd 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/BaseLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -19,7 +19,7 @@
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.internal.Trace;
+import org.eclipse.wst.server.ui.internal.Trace;
/**
* A basic label provider.
*/
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionComposite.java
deleted file mode 100644
index f5a622c..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionComposite.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.viewers;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-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.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.update.core.IFeature;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.extension.ExtensionUtility;
-/**
- *
- */
-public class ExtensionComposite extends Composite {
- public interface FeatureSelectionListener {
- public void featureSelected(IFeature feature);
- }
-
- protected Table table;
- protected TableViewer tableViewer;
-
- protected Font font;
-
- protected HashMap<String, Image> images;
-
- protected String progress;
- protected int totalWork;
- protected double currentWork;
- protected int count;
-
- public FeatureSelectionListener listener;
-
- public ExtensionComposite(Composite parent, int style, FeatureSelectionListener listener) {
- super(parent, style);
- this.listener = listener;
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 5;
- //layout.numColumns = 2;
- setLayout(layout);
-
- Font currentFont = getFont();
- FontData[] fd = currentFont.getFontData();
- int size2 = fd.length;
- for (int i = 0; i < size2; i++) {
- fd[i].setHeight(fd[i].getHeight() + 2);
- fd[i].setStyle(SWT.BOLD);
- }
-
- font = new Font(getDisplay(), fd);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.heightHint = 350;
- setLayoutData(data);
-
- table = new Table(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- //data.horizontalSpan = 2;
- //data.heightHint = 250;
- data.widthHint = 350;
- table.setLayoutData(data);
- //table.setLinesVisible(true);
- table.setHeaderVisible(false);
- tableViewer = new TableViewer(table);
- table.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- disposeResources();
- }
- });
-
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- /*tableLayout.addColumnData(new ColumnPixelData(90, false));
- //tableLayout.addColumnData(new ColumnWeightData(8, 80, true));
- TableColumn col2 = new TableColumn(table, SWT.NONE);
- col2.setText("null");
- */
- tableLayout.addColumnData(new ColumnWeightData(10, 250, false));
- final TableColumn col = new TableColumn(table, SWT.NONE);
- col.setText("null");
- /*col.setWidth(300);
- col.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- col.pack();
- }
- });*/
-
- //tableLayout.addColumnData(new ColumnWeightData(30, 250, false));
- //TableColumn col2 = new TableColumn(table, SWT.NONE);
- //col2.setText("null2");
-
- final int TEXT_MARGIN = 3;
- table.addListener(SWT.MeasureItem, new Listener() {
- public void handleEvent(Event event) {
- //System.out.println(event.width);
- /*TableItem item = (TableItem) event.item;
- Object obj = item.getData();
- //System.out.println("measure " + obj);
- if (obj instanceof CoreException) {
- event.gc.setFont(font);
- Point size = event.gc.textExtent("A");
- event.gc.setFont(null);
- //event.height = Math.max(event.height, TEXT_MARGIN * 2 + size.y);
- event.height = TEXT_MARGIN * 2 + size.y;
- System.out.println(event.height);
- return;
- }*/
- event.gc.setFont(font);
- Point size = event.gc.textExtent("A");
- int h = TEXT_MARGIN * 3 + size.y;
- size = event.gc.textExtent("A");
- event.gc.setFont(null);
- h += size.y;
- h = Math.max(h, 40 + TEXT_MARGIN * 2);
- //event.width = 400;
- event.height = Math.max(event.height, h);
- //System.out.println(event.height);
- //event.width = 300;
- }
- });
- table.addListener(SWT.EraseItem, new Listener() {
- public void handleEvent(Event event) {
- //if (event.index == 0)
- // return;
- event.detail &= ~SWT.FOREGROUND;
- //event.detail &= ~SWT.BACKGROUND;
- }
- });
- table.addListener(SWT.PaintItem, new Listener() {
- public void handleEvent(Event event) {
- //if (event.index == 0)
- // return;
- TableItem item = (TableItem) event.item;
- Object obj = item.getData();
-
- int width = table.getColumn(0).getWidth();
- GC gc = event.gc;
-
- if (obj instanceof String) {
- String s = (String) obj;
- if (progress != null)
- s = progress;
- int h = event.y + event.height / 2;
- Point size = event.gc.textExtent(s);
- gc.drawText(s, event.x + TEXT_MARGIN, h - size.y/2, true);
-
- int hh = event.y + event.height - 5 - TEXT_MARGIN - 1;
-
- gc.setLineWidth(2);
- Color color = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
- gc.setBackground(color);
-
- int width2 = 0;
- int step = 9;
- if (totalWork > 0)
- width2 = (int) ((width - step * 2 - 15 - TEXT_MARGIN * 2) * currentWork / totalWork);
-
- for (int i = 0; i < width2; i+= step) {
- gc.fillRectangle(event.x + TEXT_MARGIN + i, hh, step - 2, 5);
- }
-
- return;
- } else if (obj instanceof List) {
- List<String> list = (List<String>) obj;
-
- int size = list.size();
- String[] hosts = new String[size];
- list.toArray(hosts);
-
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < size; i++) {
- if (i > 0)
- sb.append(", ");
- sb.append(hosts[i]);
- }
- String s = NLS.bind(Messages.wizNewInstallableServerSiteError, sb.toString());
- gc.drawText(s, event.x + TEXT_MARGIN, event.y + TEXT_MARGIN, true);
- return;
- }
- IFeature ei = (IFeature) obj;
- if (ei == null)
- return;
-
-
- //if ((event.detail & SWT.SELECTED) == 0) {
- // //event.gc.setForeground();
- // //event.gc.fillRectangle(0, 0, width, 5);
- // event.gc.setBackground(getBackground());
- // event.gc.setForeground(getForeground());
- // event.gc.fillRectangle(event.x, event.y, width, event.height);
- //}
- //System.out.println(width + " " + event.width + " " + event.x);
-
- String name = ei.getLabel();
- String provider = "" + ei.getProvider();
- //String provider = "" + ei.getImage();
- //String provider = "" + ExtensionUtility.getDescription(ei);
- String ver = ei.getVersionedIdentifier().toString();
- int ind = ver.indexOf("_");
- if (ind >= 0)
- ver = ver.substring(ind+1);
- String version = "v" + ver;
-
- Image image = getImage(ei.getImage());
- if (image == null)
- image = ImageResource.getImage(ImageResource.IMG_WIZBAN_NEW_SERVER);
- int iw = image.getBounds().width;
- int ih = image.getBounds().height;
- gc.drawImage(image, 0, 0, iw, ih, event.x + TEXT_MARGIN, event.y + TEXT_MARGIN, 40, 40);
- iw = 40 + TEXT_MARGIN * 2;
-
- int yOffset = TEXT_MARGIN;
- gc.setFont(font);
- gc.drawText(name, event.x + iw, event.y + yOffset, true);
- Point size = event.gc.textExtent(name);
- gc.setFont(null);
-
- yOffset += size.y + TEXT_MARGIN;
- gc.drawText(provider, event.x + iw, event.y + yOffset, true);
-
- size = event.gc.textExtent(version);
- gc.drawText(version, event.x + width - TEXT_MARGIN * 3 - size.x, event.y + yOffset, true);
- }
- });
-
- tableViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- if ((e1 instanceof IFeature) && !(e2 instanceof IFeature))
- return -1;
- if (!(e1 instanceof IFeature) && (e2 instanceof IFeature))
- return 1;
- try {
- IFeature f1 = (IFeature) e1;
- IFeature f2 = (IFeature) e2;
- return (f1.getLabel().compareToIgnoreCase(f2.getLabel()));
- } catch (Exception e) {
- return 0;
- }
- }
- });
-
- /*Composite buttonComp = new Composite(this, SWT.NONE);
- buttonComp.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- buttonComp.setLayout(layout);
-
- Button install = SWTUtil.createButton(buttonComp, "Find Updates");
- install.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- //
- }
- });*/
-
- final Label description = new Label(this, SWT.WRAP);
- description.setText("Multi\nLine\nMessage");
- Dialog.applyDialogFont(this);
- Point p = description.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- description.setText("");
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.horizontalSpan = 2;
- if (p.y > 10)
- data.heightHint = p.y;
- else
- data.heightHint = 42;
- description.setLayoutData(data);
-
- /*final Label download = new Label(this, SWT.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
- data.horizontalSpan = 2;
- download.setLayoutData(data);
- download.setText("Download size: ");*/
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- StructuredSelection sel = (StructuredSelection) tableViewer.getSelection();
- Object obj = sel.getFirstElement();
- IFeature feature = null;
- if (obj instanceof IFeature)
- feature = (IFeature) obj;
-
- handleSelection(feature);
- if (feature != null)
- description.setText(ExtensionUtility.getDescription(feature));
- else
- description.setText("");
- /*long size = feature.getDownloadSize();
- String s = "<unknown>";
- if (size > 0)
- s = size + " Kb";
- download.setText("Download size: " + s);*/
- }
- });
-
- deferInitialization();
- }
-
- protected Image getImage(URL url) {
- if (url == null)
- return null;
-
- try {
- Image image = images.get(url.toString());
- if (image != null)
- return image;
- } catch (Exception e) {
- // ignore
- }
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(url);
- Image image = id.createImage();
- if (images == null)
- images = new HashMap<String, Image>();
- images.put(url.toString(), image);
- return image;
- } catch (Exception e) {
- Trace.trace(Trace.INFO, "Could not create image", e);
- }
- return null;
- }
-
- protected void disposeResources() {
- try {
- font.dispose();
-
- if (images != null) {
- Iterator iterator = images.values().iterator();
- while (iterator.hasNext()) {
- Image image = (Image) iterator.next();
- image.dispose();
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not dispose - possible resource leak", e);
- }
- }
-
- protected void handleSelection(IFeature feature) {
- listener.featureSelected(feature);
- }
-
- protected void deferInitialization() {
- final List<Object> list = Collections.synchronizedList(new ArrayList<Object>());
- list.add(Messages.viewInitializing);
-
- tableViewer.setContentProvider(new ExtensionContentProvider(list));
- tableViewer.setLabelProvider(new ExtensionTableLabelProvider());
- tableViewer.setInput(AbstractTreeContentProvider.ROOT);
-
- final Thread t = new Thread("Deferred Initialization") {
- public void run() {
- deferredInitialize(list, new IProgressMonitor() {
- public void beginTask(String name, int totalWork2) {
- totalWork = totalWork2;
- progress = name;
- }
-
- public void setTaskName(String name) {
- progress = name;
- }
-
- public void subTask(String name) {
- progress = name;
- }
-
- public void done() {
- //
- }
-
- public void internalWorked(double work) {
- currentWork += work;
- }
-
- public boolean isCanceled() {
- return false;
- }
-
- public void setCanceled(boolean value) {
- //
- }
-
- public void worked(int work) {
- currentWork += work;
- }
- });
- }
- };
- t.setDaemon(true);
- t.start();
-
- final Display display = getDisplay();
- final int SLEEP = 100;
- final Runnable[] animator = new Runnable[1];
- animator[0] = new Runnable() {
- public void run() {
- if (t.isAlive()) {
- count++;
- if (!table.isDisposed())
- tableViewer.refresh(AbstractTreeContentProvider.ROOT);
- display.timerExec(SLEEP, animator[0]);
- }
- }
- };
- display.timerExec(SLEEP, animator[0]);
- }
-
- public void deferredInitialize(final List<Object> list, IProgressMonitor monitor) {
- final List<String> failedSites = new ArrayList<String>();
- ExtensionUtility.FeatureListener listener2 = new ExtensionUtility.FeatureListener() {
- public void featureFound(IFeature feature) {
- list.add(feature);
- if (progress != null)
- list.set(0, progress);
- }
-
- public void featureRemoved(IFeature feature) {
- list.remove(feature);
- }
-
- public void siteFailure(String host) {
- synchronized (failedSites) {
- if (!list.contains(failedSites))
- list.add(failedSites);
- failedSites.add(host);
- }
- }
- };
-
- String id = "org.eclipse.wst.server.core.serverAdapter";
- try {
- ExtensionUtility.getAllFeatures(id, listener2, monitor);
- } catch (CoreException ce) {
- Trace.trace(Trace.WARNING, "Error downloading server adapter info", ce);
- }
-
- list.remove(0);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (!table.isDisposed())
- tableViewer.refresh(AbstractTreeContentProvider.ROOT);
- }
- });
- }
-
- protected Object getSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- return sel.getFirstElement();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionContentProvider.java
deleted file mode 100644
index a94cfeb..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionContentProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.viewers;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-/**
- * Extension content provider.
- */
-public class ExtensionContentProvider implements IStructuredContentProvider {
- protected List list;
-
- public ExtensionContentProvider(List list) {
- super();
- this.list = list;
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return list.toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionTableLabelProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionTableLabelProvider.java
deleted file mode 100644
index 75ce1da..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ExtensionTableLabelProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.viewers;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.update.core.IFeature;
-import org.eclipse.swt.graphics.Image;
-/**
- * Extension item table label provider.
- */
-public class ExtensionTableLabelProvider extends BaseLabelProvider implements ITableLabelProvider {
- /**
- * ExtensionTableLabelProvider constructor comment.
- */
- public ExtensionTableLabelProvider() {
- super();
- }
-
- /**
- * ExtensionTableLabelProvider constructor comment.
- *
- * @param decorator a label decorator, or null if no decorator is required
- */
- public ExtensionTableLabelProvider(ILabelDecorator decorator) {
- super(decorator);
- }
-
- /**
- * @see ITableLabelProvider#getColumnImage(Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- if (element instanceof List)
- return "Some update sites failed";
-
- if (element instanceof String)
- return ((String) element) + Math.random();
-
- IFeature item = (IFeature) element;
- return item.getLabel() + "\n" + item.getProvider();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java
index 1ec2d15..91e7525 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/LockedTableViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -19,6 +19,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Display;
/**
*
*/
@@ -41,7 +42,10 @@
}
protected void createColor(Control c) {
- color = new Color(c.getDisplay(), 255, 255, 225);
+ if (Display.getDefault().getHighContrast())
+ color = new Color(c.getDisplay(), 0, 0, 0);
+ else
+ color = new Color(c.getDisplay(), 255, 255, 225);
c.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
color.dispose();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java
index 8d7e673..1054a5c 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeContentProvider.java
@@ -13,8 +13,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.internal.Runtime;
@@ -30,7 +28,7 @@
}
/**
- * @see IStructuredContentProvider#getElements(Object)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
*/
public Object[] getElements(Object inputElement) {
List<IRuntime> list = new ArrayList<IRuntime>();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.java
index f730cb8..e341a68 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/RuntimeTypeComposite.java
@@ -15,9 +15,9 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.discovery.Discovery;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.extension.ExtensionUtility;
/**
*
*/
@@ -125,7 +125,7 @@
}
protected void detailsSelected() {
- if (ExtensionUtility.launchExtensionWizard(getShell(), Messages.wizNewInstallableServerTitle,
+ if (Discovery.launchExtensionWizard(getShell(), Messages.wizNewInstallableServerTitle,
Messages.wizNewInstallableServerDescription)) {
//refresh();
closeWizard(this);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java
index 50d453e..d6a100b 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/viewers/ServerTypeComposite.java
@@ -27,9 +27,9 @@
import org.eclipse.wst.server.core.IModuleType;
import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.discovery.Discovery;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.extension.ExtensionUtility;
/**
*
*/
@@ -75,7 +75,7 @@
});
treeViewer.setLabelProvider(labelProvider);
treeViewer.setInput(AbstractTreeContentProvider.ROOT);
-
+
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
Object obj = getSelection(event.getSelection());
@@ -178,7 +178,7 @@
}
protected void detailsSelected() {
- if (ExtensionUtility.launchExtensionWizard(getShell(), Messages.wizNewInstallableServerTitle,
+ if (Discovery.launchExtensionWizard(getShell(), Messages.wizNewInstallableServerTitle,
Messages.wizNewInstallableServerDescription)) {
//refresh();
closeWizard(this);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ExtensionWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ExtensionWizard.java
deleted file mode 100644
index c404e8d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/ExtensionWizard.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.wizard;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.update.core.IFeature;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.extension.ExtensionUtility;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.ExtensionWizardFragment;
-import org.eclipse.wst.server.ui.internal.wizard.fragment.LicenseWizardFragment;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- * A wizard to create a new installable server.
- */
-public class ExtensionWizard extends TaskWizard {
- /**
- * Create a new ExtensionWizard.
- *
- * @param title the wizard title
- * @param message the description message
- */
- public ExtensionWizard(String title, String message) {
- super(title, new WizardFragment() {
- protected void createChildFragments(List<WizardFragment> list) {
- list.add(new ExtensionWizardFragment());
- list.add(new LicenseWizardFragment());
- list.add(new WizardFragment() {
- public void performFinish(IProgressMonitor monitor) throws CoreException {
- IFeature is = (IFeature) getTaskModel().getObject(WizardTaskUtil.TASK_FEATURE);
- if (is != null)
- install(is);
- }
- });
- }
- });
- }
-
- public static void invalidateLicense(TaskModel taskModel) {
- IFeature is = (IFeature) taskModel.getObject(WizardTaskUtil.TASK_FEATURE);
- IFeature ls = (IFeature) taskModel.getObject(LicenseWizardFragment.LICENSE_SERVER);
- if (is == ls)
- return;
-
- taskModel.putObject(LicenseWizardFragment.LICENSE, LicenseWizardFragment.LICENSE_UNKNOWN);
- taskModel.putObject(LicenseWizardFragment.LICENSE_ACCEPT, null);
- taskModel.putObject(LicenseWizardFragment.LICENSE_SERVER, null);
- }
-
- public static void updateLicense(IWizardHandle wizard, final TaskModel taskModel) {
- final IFeature feature = (IFeature) taskModel.getObject(WizardTaskUtil.TASK_FEATURE);
- IFeature ls = (IFeature) taskModel.getObject(LicenseWizardFragment.LICENSE_SERVER);
- if (feature.equals(ls))
- return;
-
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- String license = LicenseWizardFragment.LICENSE_UNKNOWN;
- license = ExtensionUtility.getLicense(feature);
- if (license == null)
- license = LicenseWizardFragment.LICENSE_NONE;
- taskModel.putObject(LicenseWizardFragment.LICENSE, license);
- taskModel.putObject(LicenseWizardFragment.LICENSE_SERVER, feature);
- }
- };
-
- try {
- wizard.run(true, false, runnable);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error with runnable", e); //$NON-NLS-1$
- }
- }
-
- /**
- * Install a new feature.
- * @param feature
- */
- protected static void install(final IFeature feature) {
- if (feature == null)
- return;
-
- final boolean[] b = new boolean[1];
- final Display display = Display.getDefault();
- display.syncExec(new Runnable() {
- public void run() {
- String msg = NLS.bind(Messages.wizNewInstallableServerConfirm, feature.getLabel());
- b[0] = MessageDialog.openConfirm(display.getActiveShell(),
- Messages.defaultDialogTitle, msg);
- }
- });
- if (!b[0])
- return;
-
- String name = NLS.bind(Messages.wizNewInstallableServerJob, feature.getLabel());
- Job job = new Job(name) {
- public IStatus run(IProgressMonitor monitor) {
- try {
- ExtensionUtility.install(feature, monitor);
- if (!monitor.isCanceled())
- promptRestart();
- return Status.OK_STATUS;
- } catch (CoreException ce) {
- return ce.getStatus();
- }
- }
- };
- job.setUser(true);
- job.schedule();
- }
-
- /**
- * Prompt the user to restart.
- */
- public static void promptRestart() {
- final Display display = Display.getDefault();
- display.asyncExec(new Runnable() {
- public void run() {
- if (MessageDialog.openQuestion(display.getActiveShell(),
- Messages.defaultDialogTitle, Messages.wizNewInstallableServerRestart)) {
- Thread t = new Thread("Restart thread") {
- public void run() {
- try {
- sleep(1000);
- } catch (Exception e) {
- // ignore
- }
- display.asyncExec(new Runnable() {
- public void run() {
- PlatformUI.getWorkbench().restart();
- }
- });
- }
- };
- t.setDaemon(true);
- t.start();
- }
- }
- });
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java
index 150d730..03a4cef 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -225,7 +225,12 @@
} catch (InvocationTargetException te) {
Trace.trace(Trace.SEVERE, "Error finishing task wizard", te);
t = te.getCause();
- } catch (Exception e) {
+ } catch(InterruptedException interruptedEx) {
+ // the dialog was canceled - do nothing.
+ Trace.trace(Trace.INFO, "The task wizard was cancelled.", interruptedEx);
+ return false; // return false since the request was canceled
+ }
+ catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error finishing task wizard 2", e);
t = e;
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ExtensionWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ExtensionWizardFragment.java
deleted file mode 100644
index a97da0d..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ExtensionWizardFragment.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.wizard.fragment;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.ui.internal.ImageResource;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.wizard.ExtensionWizard;
-import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
-import org.eclipse.wst.server.ui.internal.wizard.page.Extension2Composite;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- *
- */
-public class ExtensionWizardFragment extends WizardFragment {
- protected Extension2Composite comp;
- protected IWizardHandle wizard;
-
- public ExtensionWizardFragment() {
- // do nothing
- }
-
- public boolean hasComposite() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.internal.task.WizardTask#getWizardPage()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard2) {
- this.wizard = wizard2;
- comp = new Extension2Composite(parent, getTaskModel(), wizard);
-
- wizard.setTitle(Messages.wizNewInstallableServerTitle);
- wizard.setDescription(Messages.wizNewInstallableServerDescription);
- wizard.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_WIZBAN_NEW_SERVER));
- return comp;
- }
-
- public boolean isComplete() {
- return getTaskModel().getObject(WizardTaskUtil.TASK_FEATURE) != null;
- }
-
- public void exit() {
- ExtensionWizard.updateLicense(wizard, getTaskModel());
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
index 498555d..fa2c8ce 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -65,12 +65,13 @@
}
public List getChildFragments() {
- updateModules();
return super.getChildFragments();
}
public void enter() {
updateModules();
+ // ask the composite to refresh
+ comp.refresh();
}
protected void updateModules() {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java
index 0b0694e..3bc210e 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/NewServerWizardFragment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -23,8 +23,10 @@
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
import org.eclipse.wst.server.ui.internal.wizard.page.NewServerComposite;
+import org.eclipse.wst.server.ui.internal.wizard.page.NewManualServerComposite;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.core.util.SocketUtil;
/**
*
*/
@@ -36,6 +38,7 @@
protected IModule module;
protected IModuleType moduleType;
protected String serverTypeId;
+ protected NewServerComposite comp;
protected Map<String, WizardFragment> fragmentMap = new HashMap<String, WizardFragment>();
protected IPath runtimeLocation = null;
@@ -66,7 +69,7 @@
*/
public Composite createComposite(Composite parent, IWizardHandle wizard) {
String launchMode = (String) getTaskModel().getObject(TaskModel.TASK_LAUNCH_MODE);
- NewServerComposite comp = null;
+
if (moduleType != null || serverTypeId != null)
comp = new NewServerComposite(parent, wizard, moduleType, serverTypeId, launchMode);
else
@@ -139,8 +142,34 @@
}
public boolean isComplete() {
- return getServer() != null;
+ if(getServer() == null)
+ return false;
+
+ if(getServer().getServerType() == null)
+ return false;
+
+ return checkHostAndServerType();
}
+
+ private boolean checkHostAndServerType(){
+ boolean isComplete = false;
+
+ boolean supportsRemote = getServer().getServerType().supportsRemoteHosts();
+
+ if(comp != null){
+ Composite composite = comp.getNewManualServerComposite();
+ if(composite != null && composite instanceof NewManualServerComposite){
+ NewManualServerComposite manualComp = (NewManualServerComposite)composite;
+
+ if(!supportsRemote && !SocketUtil.isLocalhost(manualComp.getCurrentHostname())){
+ isComplete = false;
+ }
+ else
+ isComplete = true;
+ }
+ }
+ return isComplete;
+ }
private IServerWorkingCopy getServer() {
try {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/Extension2Composite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/Extension2Composite.java
deleted file mode 100644
index 5263f01..0000000
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/Extension2Composite.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM 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
- *******************************************************************************/
-package org.eclipse.wst.server.ui.internal.wizard.page;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-import org.eclipse.update.core.IFeature;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.SWTUtil;
-import org.eclipse.wst.server.ui.internal.viewers.ExtensionComposite;
-import org.eclipse.wst.server.ui.internal.wizard.ExtensionWizard;
-import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-/**
- * A composite used to select a server to install.
- */
-public class Extension2Composite extends Composite {
- private TaskModel taskModel;
- private IWizardHandle wizard;
- private ExtensionComposite comp;
-
- /**
- * Create a new NewInstallableServerComposite.
- *
- * @param parent a parent composite
- * @param taskModel a task model
- * @param wizard the wizard this composite is contained in
- */
- public Extension2Composite(Composite parent, TaskModel taskModel, IWizardHandle wizard) {
- super(parent, SWT.NONE);
- this.taskModel = taskModel;
- this.wizard = wizard;
-
- createControl();
- }
-
- /**
- * Creates the UI of the page.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = SWTUtil.convertHorizontalDLUsToPixels(this, 4);
- layout.verticalSpacing = SWTUtil.convertVerticalDLUsToPixels(this, 4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 3;
- setLayout(layout);
- //WorkbenchHelp.setHelp(this, ContextIds.SELECT_CLIENT_WIZARD);
-
- Label label = new Label(this, SWT.WRAP);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = 3;
- data.widthHint = 225;
- label.setLayoutData(data);
- label.setText(Messages.wizNewInstallableServerMessage);
-
- comp = new ExtensionComposite(this, SWT.NONE, new ExtensionComposite.FeatureSelectionListener() {
- public void featureSelected(IFeature feature) {
- handleSelection(feature);
- }
- });
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = 200;
- comp.setLayoutData(data);
-
- Dialog.applyDialogFont(this);
-
- /*Job job = new Job("Downloading information") {
- public IStatus run(IProgressMonitor monitor) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- comp.deferredInitialize(new NullProgressMonitor());
- } catch (Exception e) {
- // ignore - view has already been closed
- }
- }
- });
- return Status.OK_STATUS;
- }
- };
-
- job.setSystem(true);
- job.setPriority(Job.SHORT);
- job.schedule();*/
-
- /*Thread t= new Thread() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- runBackground();
- }
- });
- }
- };
- t.start();*/
- //runBackground();
- }
-
- /*protected void runBackground() {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- comp.deferredInitialize(monitor);
- }
- };
- try {
- wizard.run(true, false, runnable);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error with runnable", e); //$NON-NLS-1$
- }
- }*/
-
- protected void handleSelection(IFeature feature) {
- taskModel.putObject(WizardTaskUtil.TASK_FEATURE, feature);
- ExtensionWizard.invalidateLicense(taskModel);
- wizard.update();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java
index 0804b1c..553b8a5 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/HostnameComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -37,7 +37,7 @@
* A composite used to select a hostname.
*/
public class HostnameComposite extends Composite {
- private static final String LOCALHOST = "localhost";
+ public static final String LOCALHOST = "localhost";
protected String host;
protected IHostnameSelectionListener listener;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
index 454ad8b..d06dc07 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -243,8 +243,6 @@
}
public void setServer(IServerAttributes server) {
- if (isVisible())
- return;
// see bug 185875, 205869
if (refreshModules == taskModel.getObject(TASK_REFRESH_MODULES) && server == this.server) {
@@ -290,7 +288,7 @@
// get currently deployed modules
IModule[] currentModules = server.getModules();
- if (currentModules != null) {
+ if ((currentModules != null) && (currentModules.length > 0)) {
int size = currentModules.length;
for (int i = 0; i < size; i++) {
originalModules.add(currentModules[i]);
@@ -410,23 +408,31 @@
public void setVisible(boolean b) {
if (b) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- if (availableTreeViewer == null || availableTreeViewer.getControl().isDisposed())
- return;
- try { // update trees if we can
- availableTreeViewer.refresh();
- deployedTreeViewer.refresh();
- setEnablement();
- } catch (Exception e) {
- // ignore
- }
- }
- });
+ this.refresh();
}
super.setVisible(b);
}
+ /**
+ * Refresh the composite
+ */
+ public void refresh() {
+
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ if (availableTreeViewer == null || availableTreeViewer.getControl().isDisposed())
+ return;
+ try { // update trees if we can
+ availableTreeViewer.refresh();
+ deployedTreeViewer.refresh();
+ setEnablement();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ });
+ }
+
public void setTaskModel(TaskModel model) {
this.taskModel = model;
}
@@ -522,7 +528,7 @@
// slosh buttons
Composite comp = new Composite(this, SWT.NONE);
- data = new GridData(GridData.FILL_BOTH);
+ data = new GridData(GridData.FILL_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL);
data.widthHint = 120;
comp.setLayoutData(data);
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
index 6372668..baf9b34 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM 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
@@ -10,9 +10,11 @@
*******************************************************************************/
package org.eclipse.wst.server.ui.internal.wizard.page;
+import java.beans.PropertyChangeEvent;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -21,17 +23,14 @@
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.fieldassist.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.osgi.util.NLS;
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.events.SelectionListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
@@ -46,15 +45,21 @@
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.eclipse.wst.server.core.util.SocketUtil;
+import org.eclipse.wst.server.ui.*;
import org.eclipse.wst.server.ui.internal.*;
+import org.eclipse.wst.server.ui.AbstractUIControl.IUIControlListener;
+import org.eclipse.wst.server.ui.AbstractUIControl.UIControlEntry;
import org.eclipse.wst.server.ui.internal.viewers.ServerTypeComposite;
import org.eclipse.wst.server.ui.internal.wizard.TaskWizard;
import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
+import org.eclipse.wst.server.ui.internal.wizard.page.HostnameComposite.IHostnameSelectionListener;
+import org.eclipse.wst.server.ui.wizard.ServerCreationWizardPageExtension;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
+
/**
* Wizard page used to create a server and configuration at the same time.
*/
-public class NewManualServerComposite extends Composite {
+public class NewManualServerComposite extends Composite implements IUIControlListener {
public interface ServerSelectionListener {
public void serverSelected(IServerAttributes server);
public void runtimeSelected(IRuntime runtime);
@@ -92,8 +97,17 @@
protected IModule module;
protected String serverTypeId;
protected boolean includeIncompatible;
+
+ protected String lastHostname;
+ protected HostnameComposite manualHostComp;
+ IHostnameSelectionListener hostnameListener;
+ protected Label hostnameLabel;
+ protected Text hostname;
+ protected ControlDecoration hostnameDecoration;
protected ServerCreationCache cache = new ServerCreationCache();
+
+ private IServerType oldServerType;
/**
* Creates a new server and server configuration. If the initial
@@ -139,6 +153,13 @@
IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
whs.setHelp(this, ContextIds.NEW_SERVER_WIZARD);
+ List<ServerCreationWizardPageExtension> pageExtensionLst = ServerUIPlugin.getServerCreationWizardPageExtensions();
+ // Add the page modifier top section UI.
+ for (ServerCreationWizardPageExtension curPageExtension : pageExtensionLst) {
+ curPageExtension.createControl(ServerCreationWizardPageExtension.UI_POSITION.TOP, this);
+ curPageExtension.setUIControlListener(this);
+ }
+
serverTypeComposite = new ServerTypeComposite(this, moduleType, serverTypeId, new ServerTypeComposite.ServerTypeSelectionListener() {
public void serverTypeSelected(IServerType type2) {
handleTypeSelection(type2);
@@ -151,6 +172,52 @@
serverTypeComposite.setLayoutData(data);
whs.setHelp(serverTypeComposite, ContextIds.NEW_SERVER_TYPE);
+ // Add the page modifier middle section UI.
+ for (ServerCreationWizardPageExtension curPageExtension : pageExtensionLst) {
+ curPageExtension.createControl(ServerCreationWizardPageExtension.UI_POSITION.MIDDLE, this);
+ }
+
+ hostnameListener = new IHostnameSelectionListener() {
+ public void hostnameSelected(String selectedHostname) {
+ lastHostname = selectedHostname;
+ setHost(selectedHostname);
+ }
+ };
+ hostnameLabel = new Label(this, SWT.NONE);
+ hostnameLabel.setText(Messages.hostname);
+ hostname = new Text(this, SWT.SINGLE | SWT.BORDER | SWT.CANCEL);
+ hostname.setText(HostnameComposite.LOCALHOST);
+ hostnameDecoration = new ControlDecoration(hostname, SWT.TOP | SWT.LEAD);
+
+ GridData data2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL );
+ hostname.setLayoutData(data2);
+ new Label(this, SWT.NONE);
+
+ hostname.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ hostnameChanged(hostname.getText());
+ }
+ });
+
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ FieldDecoration fd = registry.getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+ hostnameDecoration.setImage(fd.getImage());
+ hostnameDecoration.setDescriptionText(fd.getDescription());
+
+ hostname.addFocusListener(new FocusListener() {
+ public void focusGained(FocusEvent e) {
+ hostnameDecoration.show();
+ }
+
+ public void focusLost(FocusEvent e) {
+ hostnameDecoration.hide();
+ }
+ });
+
+ List<String> hosts = ServerUIPlugin.getPreferences().getHostnames();
+ String[] hosts2 = hosts.toArray(new String[hosts.size()]);
+ new AutoCompleteField(hostname, new TextContentAdapter(), hosts2);
+
Label serverNameLabel = new Label(this, SWT.NONE);
serverNameLabel.setText(Messages.serverName);
@@ -193,7 +260,7 @@
IAction resetDefaultAction = new Action("", IAction.AS_PUSH_BUTTON) {//$NON-NLS-1$
public void run() {
- ServerUtil.setServerDefaultName(server);
+ ((ServerWorkingCopy)server).setDefaults(null);
serverName.setText(server.getName());
serverNameModified = false;
if (serverNameToolBar != null)
@@ -234,8 +301,7 @@
addRuntime.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IServerType serverType = serverTypeComposite.getSelectedServerType();
- if (showRuntimeWizard(serverType) != Window.CANCEL)
- updateRuntimeCombo(serverType);
+ showRuntimeWizard(serverType);
}
});
@@ -253,6 +319,12 @@
}
}
});
+
+ // Add the page modifier bottom section UI.
+ for (ServerCreationWizardPageExtension curPageExtension : pageExtensionLst) {
+ curPageExtension.createControl(ServerCreationWizardPageExtension.UI_POSITION.BOTTOM, this);
+ }
+
Dialog.applyDialogFont(this);
}
@@ -287,35 +359,71 @@
TaskWizard wizard2 = new TaskWizard(Messages.wizNewRuntimeWizardTitle, fragment, taskModel);
wizard2.setForcePreviousAndNextButtons(true);
WizardDialog dialog = new WizardDialog(getShell(), wizard2);
- return dialog.open();
+ int returnValue = dialog.open();
+ if (returnValue != Window.CANCEL) {
+ updateRuntimeCombo(serverType);
+ IRuntime rt = (IRuntime)taskModel.getObject(TaskModel.TASK_RUNTIME);
+ if (rt != null && rt.getName() != null && runtimeCombo.indexOf(rt.getName()) != -1) {
+ setRuntime(rt);
+ runtimeCombo.select(runtimeCombo.indexOf(rt.getName()));
+ }
+ }
+ return returnValue;
}
+ public String getControlStringValue(String controlId) {
+ if (controlId != null && AbstractUIControl.PROP_HOSTNAME.equals(controlId)) {
+ return host;
+ }
+ return null;
+ }
+
public void setHost(String host) {
this.host = host;
if (serverTypeComposite == null)
return;
- boolean changed = false;
- if (host == null) {
- changed = serverTypeComposite.setHost(true);
- } else if (SocketUtil.isLocalhost(host))
- changed = serverTypeComposite.setHost(true);
- else
- changed = serverTypeComposite.setHost(false);
+ IServerType selectedServerType = serverTypeComposite.getSelectedServerType();
+ handleHostnameChange(selectedServerType);
+ }
+
+ protected void handleHostnameChange(IServerType serverType) {
+
+ wizard.setMessage(null, IMessageProvider.NONE);
+ checkHostAndServerType(serverType);
+ loadServerImpl(serverType);
- if (changed)
- handleTypeSelection(serverTypeComposite.getSelectedServerType());
- else if (server != null) {
- server.setHost(host);
- if (!serverNameModified) {
- updatingServerName = true;
- ServerUtil.setServerDefaultName(server);
+ if (serverName != null && !serverNameModified) {
+ updatingServerName = true;
+ if (server == null)
+ serverName.setText("");
+ else
serverName.setText(server.getName());
- updatingServerName = false;
+ updatingServerName = false;
+ }
+
+ updateRuntimeCombo(serverType);
+ if (serverName != null) {
+ if (server == null) {
+ serverName.setEditable(false);
+ serverNameToolBar.getControl().setVisible(false);
+ } else {
+ serverName.setEditable(true);
+ serverNameToolBar.getControl().setVisible(serverNameModified);
}
}
}
+ protected void checkHostAndServerType(IServerType selectedServerType){
+ if(selectedServerType != null){
+ boolean supportsRemote = selectedServerType.supportsRemoteHosts();
+ if(!supportsRemote && !SocketUtil.isLocalhost(hostname.getText()))
+ wizard.setMessage(NLS.bind(Messages.wizCheckRemoteSupport, new Object[0]), IMessageProvider.ERROR);
+ else
+ wizard.setMessage(null, IMessageProvider.NONE);
+ }
+ }
+
/**
* Load a server of the given type.
*/
@@ -330,9 +438,10 @@
server = cache.getCachedServer(serverType, isLocalhost);
if (server != null) {
server.setHost(host);
- ServerUtil.setServerDefaultName(server);
+ ((ServerWorkingCopy)server).setDefaults(null);
runtime = server.getRuntime();
listener.runtimeSelected(runtime);
+ fireServerWorkingCopyChanged();
return;
}
@@ -347,7 +456,6 @@
server = cache.createServer(serverType, run, isLocalhost, null);
if (server != null) {
server.setHost(host);
- ServerUtil.setServerDefaultName(server);
if (serverType.hasRuntime() && server.getRuntime() == null) {
runtime = null;
@@ -357,7 +465,9 @@
if (server.getServerType() != null && server.getServerType().hasServerConfiguration() && !runtime.getLocation().isEmpty())
((ServerWorkingCopy)server).importRuntimeConfiguration(runtime, null);
}
+
((ServerWorkingCopy)server).setDefaults(null);
+ fireServerWorkingCopyChanged();
}
} catch (CoreException ce) {
Trace.trace(Trace.SEVERE, "Error creating server", ce);
@@ -365,7 +475,7 @@
runtime = null;
wizard.setMessage(ce.getLocalizedMessage(), IMessageProvider.ERROR);
}
-
+
if (server == null)
wizard.setMessage(Messages.wizErrorServerCreationError, IMessageProvider.ERROR);
}
@@ -414,7 +524,6 @@
// create a new runtime
try {
IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(null, null);
- ServerUtil.setRuntimeDefaultName(runtimeWC);
runtimes = new IRuntime[1];
runtimes[0] = runtimeWC;
newRuntime = runtimeWC;
@@ -488,10 +597,23 @@
runtime = runtime2;
if (server != null) {
server.setRuntime(runtime);
- ServerUtil.setServerDefaultName(server);
+ ((ServerWorkingCopy)server).setDefaults(null);
+ if (!serverNameModified) {
+ updatingServerName = true;
+ serverName.setText(server.getName());
+ updatingServerName = false;
+ }
}
listener.runtimeSelected(runtime);
}
+
+ protected void fireServerWorkingCopyChanged() {
+ List<ServerCreationWizardPageExtension> pageExtensionLst = ServerUIPlugin.getServerCreationWizardPageExtensions();
+ // Add the page modifier top section UI.
+ for (ServerCreationWizardPageExtension curPageExtension : pageExtensionLst) {
+ curPageExtension.setServerWorkingCopy(getServer());
+ }
+ }
/**
* Handle the server type selection.
@@ -552,6 +674,15 @@
}
}
listener.serverSelected(server);
+ // Fire the property change event.
+ List<ServerCreationWizardPageExtension> pageExtensionLst = ServerUIPlugin.getServerCreationWizardPageExtensions();
+ for (ServerCreationWizardPageExtension curPageExtension : pageExtensionLst) {
+ curPageExtension.handlePropertyChanged(new PropertyChangeEvent(this, AbstractUIControl.PROP_SERVER_TYPE, oldServerType, serverType));
+ }
+ // Update the old server type value.
+ oldServerType = serverType;
+
+ checkHostAndServerType(serverType);
wizard.update();
}
@@ -589,4 +720,48 @@
public IServerWorkingCopy getServer() {
return server;
}
+
+ protected void hostnameChanged(String newHost) {
+ if (newHost == null)
+ return;
+ if (newHost.equals(host))
+ return;
+
+ host = newHost;
+ hostnameListener.hostnameSelected(host);
+ }
+
+ public void handleUIControlMapChanged(Map<String, UIControlEntry> controlMap) {
+ if (controlMap == null) {
+ return;
+ }
+
+ for (String curControlId : controlMap.keySet()) {
+ if (AbstractUIControl.PROP_HOSTNAME.equals(curControlId)) {
+ UIControlEntry curControlEntry = controlMap.get(curControlId);
+ if (hostnameLabel != null)
+ hostnameLabel.setEnabled(curControlEntry.isEnabled());
+
+ if (hostname != null){
+ if (curControlEntry.getNewTextValue() != null)
+ hostname.setText(curControlEntry.getNewTextValue());
+
+ hostname.setEnabled(curControlEntry.isEnabled());
+ }
+
+ if (hostnameDecoration != null){
+ if(curControlEntry.isEnabled())
+ hostnameDecoration.show();
+ else
+ hostnameDecoration.hide();
+ }
+ }
+ }
+ }
+
+ public String getCurrentHostname(){
+ if(hostname != null)
+ return hostname.getText();
+ return null;
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java
index 321dd92..2251d77 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewRuntimeComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -120,7 +120,6 @@
if (runtime == null) {
try {
runtime = runtimeType.createRuntime(null, null);
- ServerUtil.setRuntimeDefaultName(runtime);
if (runtime != null)
cache.put(runtimeType, runtime);
} catch (Exception e) {
@@ -176,8 +175,6 @@
try {
server = serverType.createServer(null, null, runtime, null);
if (server != null) {
- server.setHost("localhost");
- ServerUtil.setServerDefaultName(server);
serverCache.put(runtime, server);
return server;
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java
index a61b4cf..95716bb 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewServerComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM 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
@@ -449,7 +449,6 @@
manualComp2.setLayout(layout);
manualComp2.setLayoutData(new GridData(GridData.FILL_BOTH));
- manualHostComp = createHostComposite(manualComp2);
IModuleType mt = moduleType;
boolean includeIncompatible = true;
if (moduleType != null)
@@ -487,7 +486,11 @@
data.heightHint = 325;
manualComp.setLayoutData(data);
}
-
+
+ public NewManualServerComposite getNewManualServerComposite (){
+ return manualComp;
+ }
+
protected void updateTaskModel() {
if (taskModel != null) {
IServerWorkingCopy server = getServer();
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/ServerCreationWizardPageExtension.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/ServerCreationWizardPageExtension.java
new file mode 100644
index 0000000..adc60dc
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/wizard/ServerCreationWizardPageExtension.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM 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
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.wizard;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.ui.AbstractUIControl;
+
+/**
+ * A modifier class that allow adopter to modify the behaviour of the server creation wizard page.
+ * It also has places where adopter can inject custom GUI into the server creation wizard page.
+ */
+public abstract class ServerCreationWizardPageExtension extends AbstractUIControl {
+ protected IServerWorkingCopy serverWc = null;
+
+ /**
+ * The list of position on the server creation wizard page that allows inserting custom GUI.
+ * UI_POSITION
+ */
+ public enum UI_POSITION { TOP, MIDDLE, BOTTOM }
+
+ /**
+ * Create the customer UI on the specified position.
+ * @param position the position on the server creation wizard page that allows inserting custom GUI.
+ * @param parent parent composite.
+ */
+ public abstract void createControl(UI_POSITION position, Composite parent);
+
+ /**
+ * Set the server working copy to the control to allow extension to store the extension values.
+ * @param curServerWc
+ */
+ public void setServerWorkingCopy(IServerWorkingCopy curServerWc) {
+ serverWc = curServerWc;
+ }
+}