diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.web')
251 files changed, 0 insertions, 26927 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.web/.classpath b/plugins/org.eclipse.jst.j2ee.web/.classpath deleted file mode 100644 index 7d44ee3a9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/.classpath +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="web"/> - <classpathentry kind="src" path="taglib"/> - <classpathentry kind="src" path="war-validation"/> - <classpathentry kind="src" path="webedit"/> - <classpathentry kind="src" path="webproject"/> - <classpathentry kind="src" path="property_files"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.jst.j2ee.web/.cvsignore b/plugins/org.eclipse.jst.j2ee.web/.cvsignore deleted file mode 100644 index 512f02184..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -bin -build.xml -runtime -temp.folder diff --git a/plugins/org.eclipse.jst.j2ee.web/.project b/plugins/org.eclipse.jst.j2ee.web/.project deleted file mode 100644 index eb96e2c41..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.jst.j2ee.web</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.jst.j2ee.web/build.properties b/plugins/org.eclipse.jst.j2ee.web/build.properties deleted file mode 100644 index 1b75966a6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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,\ - icons/,\ - plugin.properties,\ - templates/,\ - runtime/web.jar -jars.compile.order = runtime/web.jar -source.runtime/web.jar = web/,\ - war-validation/,\ - webedit/,\ - webproject/,\ - property_files/,\ - taglib/ -output.runtime/web.jar = bin/ diff --git a/plugins/org.eclipse.jst.j2ee.web/component.xml b/plugins/org.eclipse.jst.j2ee.web/component.xml deleted file mode 100644 index 140376996..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/component.xml +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jst.j2ee.web"><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jst.j2ee.web" fragment="false"/><plugin id="org.eclipse.jst.servlet.ui" fragment="false"/><package name="org.eclipse.jst.j2ee.web.operations"></package><package name="org.eclipse.jst.j2ee.web.taglib"></package><package name="org.eclipse.jst.servlet.ui"></package></component>
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/ServletCreateInitParam.gif b/plugins/org.eclipse.jst.j2ee.web/icons/ServletCreateInitParam.gif Binary files differdeleted file mode 100644 index e12289b3c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/ServletCreateInitParam.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/WebAppCreateContextParam.gif b/plugins/org.eclipse.jst.j2ee.web/icons/WebAppCreateContextParam.gif Binary files differdeleted file mode 100644 index 8450a6f0e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/WebAppCreateContextParam.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/WebResourceCollectionCreateURLPatternType.gif b/plugins/org.eclipse.jst.j2ee.web/icons/WebResourceCollectionCreateURLPatternType.gif Binary files differdeleted file mode 100644 index 9f75eb094..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/WebResourceCollectionCreateURLPatternType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/authority_constraint.gif b/plugins/org.eclipse.jst.j2ee.web/icons/authority_constraint.gif Binary files differdeleted file mode 100644 index 5b64c4d75..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/authority_constraint.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/error_co.gif b/plugins/org.eclipse.jst.j2ee.web/icons/error_co.gif Binary files differdeleted file mode 100644 index 119dcccd5..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/error_co.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/error_page.gif b/plugins/org.eclipse.jst.j2ee.web/icons/error_page.gif Binary files differdeleted file mode 100644 index 811b21bbb..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/error_page.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/errorcode_errorpage.gif b/plugins/org.eclipse.jst.j2ee.web/icons/errorcode_errorpage.gif Binary files differdeleted file mode 100644 index 811b21bbb..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/errorcode_errorpage.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/exception_type_errorpage.gif b/plugins/org.eclipse.jst.j2ee.web/icons/exception_type_errorpage.gif Binary files differdeleted file mode 100644 index 184556359..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/exception_type_errorpage.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/export_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/export_wiz.gif Binary files differdeleted file mode 100644 index 3c8a0ba87..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/export_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/field.gif b/plugins/org.eclipse.jst.j2ee.web/icons/field.gif Binary files differdeleted file mode 100644 index 06d38f5c8..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/field.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/filter.gif b/plugins/org.eclipse.jst.j2ee.web/icons/filter.gif Binary files differdeleted file mode 100644 index 0712d1ed9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/filter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/filter_mapping.gif b/plugins/org.eclipse.jst.j2ee.web/icons/filter_mapping.gif Binary files differdeleted file mode 100644 index 8f2e36ba6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/filter_mapping.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/form_banner.gif b/plugins/org.eclipse.jst.j2ee.web/icons/form_banner.gif Binary files differdeleted file mode 100644 index aebc0b2a3..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/form_banner.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/form_login_config.gif b/plugins/org.eclipse.jst.j2ee.web/icons/form_login_config.gif Binary files differdeleted file mode 100644 index e3fcbb1e6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/form_login_config.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/ArrowDown.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/ArrowDown.gif Binary files differdeleted file mode 100644 index 5f2f2d958..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/ArrowDown.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/ArrowUp.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/ArrowUp.gif Binary files differdeleted file mode 100644 index 7a479e8eb..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/ArrowUp.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_descriptions_Description.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_descriptions_Description.gif Binary files differdeleted file mode 100644 index 225e8136c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_descriptions_Description.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_descriptions_DescriptionType.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_descriptions_DescriptionType.gif Binary files differdeleted file mode 100644 index 45ca1829c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_descriptions_DescriptionType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_displayNames_DisplayName.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_displayNames_DisplayName.gif Binary files differdeleted file mode 100644 index 346fc4980..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_displayNames_DisplayName.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_displayNames_DisplayNameType.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_displayNames_DisplayNameType.gif Binary files differdeleted file mode 100644 index 1df6f5fc3..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_displayNames_DisplayNameType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_icons_IconType.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_icons_IconType.gif Binary files differdeleted file mode 100644 index 518124160..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateDescriptionGroup_icons_IconType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateJSPConfig_propertyGroups_JSPPropertyGroup.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateJSPConfig_propertyGroups_JSPPropertyGroup.gif Binary files differdeleted file mode 100644 index 5397c660f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateJSPConfig_propertyGroups_JSPPropertyGroup.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateJSPConfig_tagLibs_TagLibRefType.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateJSPConfig_tagLibs_TagLibRefType.gif Binary files differdeleted file mode 100644 index 34229a790..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/CreateJSPConfig_tagLibs_TagLibRefType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/add_column.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/add_column.gif Binary files differdeleted file mode 100644 index 256e5a0a3..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/add_column.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/connection.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/connection.gif Binary files differdeleted file mode 100644 index e8efe69dc..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/connection.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/convertlinks_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/convertlinks_wiz.gif Binary files differdeleted file mode 100644 index 3d75cb53a..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/convertlinks_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/default.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/default.gif Binary files differdeleted file mode 100644 index 52bac3646..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/default.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/exportftp_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/exportftp_wiz.gif Binary files differdeleted file mode 100644 index fc66e9ea7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/exportftp_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/exportwar_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/exportwar_wiz.gif Binary files differdeleted file mode 100644 index ced859dd4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/exportwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importftp_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importftp_wiz.gif Binary files differdeleted file mode 100644 index 400e049ed..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importftp_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importhttp_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importhttp_wiz.gif Binary files differdeleted file mode 100644 index 41768717c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importhttp_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importwar_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importwar_wiz.gif Binary files differdeleted file mode 100644 index 432c06679..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/importwar_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/method.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/method.gif Binary files differdeleted file mode 100644 index e33651358..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/method.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/methodreturn.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/methodreturn.gif Binary files differdeleted file mode 100644 index d528595b4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/methodreturn.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/newwebex_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/newwebex_wiz.gif Binary files differdeleted file mode 100644 index 43e86dbfd..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/newwebex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/newwebprj_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/newwebprj_wiz.gif Binary files differdeleted file mode 100644 index 8956b3d1c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/newwebprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/warFile_obj.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/warFile_obj.gif Binary files differdeleted file mode 100644 index 31ecb7aee..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/warFile_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/web_application.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/web_application.gif Binary files differdeleted file mode 100644 index 09f609d6c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/web_application.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/web_ovr.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/web_ovr.gif Binary files differdeleted file mode 100644 index e0dd2d85c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/ctool16/web_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/linksview16/mailto_view.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/linksview16/mailto_view.gif Binary files differdeleted file mode 100644 index 23f12fa33..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/linksview16/mailto_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/JSPConfig.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/JSPConfig.gif Binary files differdeleted file mode 100644 index 30f0c48da..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/JSPConfig.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/JSPPropertyGroup.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/JSPPropertyGroup.gif Binary files differdeleted file mode 100644 index 591559182..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/JSPPropertyGroup.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/TagLibRefType.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/TagLibRefType.gif Binary files differdeleted file mode 100644 index 53500daf9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/TagLibRefType.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/ascii.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/ascii.gif Binary files differdeleted file mode 100644 index ef3028807..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/ascii.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/binary.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/binary.gif Binary files differdeleted file mode 100644 index 17633ae45..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/binary.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/environment_entity.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/environment_entity.gif Binary files differdeleted file mode 100644 index bf043f959..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/environment_entity.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/jarproject_deploy.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/jarproject_deploy.gif Binary files differdeleted file mode 100644 index 4c54bf16c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/jarproject_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/java_properties.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/java_properties.gif Binary files differdeleted file mode 100644 index 49873f49e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/java_properties.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/method_return.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/method_return.gif Binary files differdeleted file mode 100644 index d528595b4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/method_return.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/projlib_obj.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/projlib_obj.gif Binary files differdeleted file mode 100644 index 6912defa4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/projlib_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/servlet.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/servlet.gif Binary files differdeleted file mode 100644 index fc1bece72..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/servlet.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/web12_deploy.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/web12_deploy.gif Binary files differdeleted file mode 100644 index f5077423b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/web12_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/web13_deploy.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/web13_deploy.gif Binary files differdeleted file mode 100644 index e3539d455..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/web13_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/webstatic_deploy.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/webstatic_deploy.gif Binary files differdeleted file mode 100644 index 80531e39b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/obj16/webstatic_deploy.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/sample16/folder.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/sample16/folder.gif Binary files differdeleted file mode 100644 index c91b26723..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/sample16/folder.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/thumbnail16/defaultFile.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/thumbnail16/defaultFile.gif Binary files differdeleted file mode 100644 index ef3028807..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/thumbnail16/defaultFile.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/thumbnail16/defaultFolder.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/thumbnail16/defaultFolder.gif Binary files differdeleted file mode 100644 index c91b26723..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/thumbnail16/defaultFolder.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/colourpal_view.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/colourpal_view.gif Binary files differdeleted file mode 100644 index 3764249fa..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/colourpal_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/gallery_view.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/gallery_view.gif Binary files differdeleted file mode 100644 index 9f779e421..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/gallery_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/links_view.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/links_view.gif Binary files differdeleted file mode 100644 index 5fd9c9494..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/links_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/sample.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/sample.gif Binary files differdeleted file mode 100644 index bda81f7da..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/sample.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/thumbnail_view.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/thumbnail_view.gif Binary files differdeleted file mode 100644 index ababbcafe..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/view16/thumbnail_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/ftpimport_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/ftpimport_wiz.gif Binary files differdeleted file mode 100644 index 56c8c3bb9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/ftpimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/ftppub_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/ftppub_wiz.gif Binary files differdeleted file mode 100644 index efb2bd4ec..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/ftppub_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/httpimport_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/httpimport_wiz.gif Binary files differdeleted file mode 100644 index 71c8182d7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/httpimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/newwebex_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/newwebex_wiz.gif Binary files differdeleted file mode 100644 index ff7c242bf..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/newwebex_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/newwprj_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/newwprj_wiz.gif Binary files differdeleted file mode 100644 index 72944e924..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/newwprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/warexport_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/warexport_wiz.gif Binary files differdeleted file mode 100644 index d25124251..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/warexport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/warimport_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/warimport_wiz.gif Binary files differdeleted file mode 100644 index 0bbebe947..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/full/wizban/warimport_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/getstart_a.GIF b/plugins/org.eclipse.jst.j2ee.web/icons/getstart_a.GIF Binary files differdeleted file mode 100644 index 6331e65e8..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/getstart_a.GIF +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/initializ_parameter.gif b/plugins/org.eclipse.jst.j2ee.web/icons/initializ_parameter.gif Binary files differdeleted file mode 100644 index 162a57805..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/initializ_parameter.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/initializ_parameter_context.gif b/plugins/org.eclipse.jst.j2ee.web/icons/initializ_parameter_context.gif Binary files differdeleted file mode 100644 index 162a57805..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/initializ_parameter_context.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/jsp_library_reference.gif b/plugins/org.eclipse.jst.j2ee.web/icons/jsp_library_reference.gif Binary files differdeleted file mode 100644 index 997b50c69..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/jsp_library_reference.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/jsp_type.gif b/plugins/org.eclipse.jst.j2ee.web/icons/jsp_type.gif Binary files differdeleted file mode 100644 index 8a6367542..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/jsp_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/key.gif b/plugins/org.eclipse.jst.j2ee.web/icons/key.gif Binary files differdeleted file mode 100644 index 03af38b6b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/key.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/key_interf_ov.gif b/plugins/org.eclipse.jst.j2ee.web/icons/key_interf_ov.gif Binary files differdeleted file mode 100644 index 307044047..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/key_interf_ov.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/methElement_obj.gif b/plugins/org.eclipse.jst.j2ee.web/icons/methElement_obj.gif Binary files differdeleted file mode 100644 index c3e27cdec..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/methElement_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/mime_mapping.gif b/plugins/org.eclipse.jst.j2ee.web/icons/mime_mapping.gif Binary files differdeleted file mode 100644 index b64775883..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/mime_mapping.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/newjprj_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/newjprj_wiz.gif Binary files differdeleted file mode 100644 index 6d137cd38..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/newjprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/newjprj_wiz_32.gif b/plugins/org.eclipse.jst.j2ee.web/icons/newjprj_wiz_32.gif Binary files differdeleted file mode 100644 index 8435ec70d..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/newjprj_wiz_32.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/newservlet_wiz.gif Binary files differdeleted file mode 100644 index f45eadca8..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/newservlet_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/newwprj_wiz.gif b/plugins/org.eclipse.jst.j2ee.web/icons/newwprj_wiz.gif Binary files differdeleted file mode 100644 index 8956b3d1c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/newwprj_wiz.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/security_constraint.gif b/plugins/org.eclipse.jst.j2ee.web/icons/security_constraint.gif Binary files differdeleted file mode 100644 index d155408e8..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/security_constraint.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/server_ovr.gif b/plugins/org.eclipse.jst.j2ee.web/icons/server_ovr.gif Binary files differdeleted file mode 100644 index b5e8b3f9b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/server_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/servlet.gif b/plugins/org.eclipse.jst.j2ee.web/icons/servlet.gif Binary files differdeleted file mode 100644 index fc1bece72..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/servlet.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/servlet_mapping.gif b/plugins/org.eclipse.jst.j2ee.web/icons/servlet_mapping.gif Binary files differdeleted file mode 100644 index c495ac8c4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/servlet_mapping.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/servlet_type.gif b/plugins/org.eclipse.jst.j2ee.web/icons/servlet_type.gif Binary files differdeleted file mode 100644 index c4a9d210b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/servlet_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/showerr_tsk.gif b/plugins/org.eclipse.jst.j2ee.web/icons/showerr_tsk.gif Binary files differdeleted file mode 100644 index 0bc60689c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/showerr_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/showwarn_tsk.gif b/plugins/org.eclipse.jst.j2ee.web/icons/showwarn_tsk.gif Binary files differdeleted file mode 100644 index 14009e997..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/showwarn_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/url_type.gif b/plugins/org.eclipse.jst.j2ee.web/icons/url_type.gif Binary files differdeleted file mode 100644 index b26c71d2e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/url_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/user_data_constraint.gif b/plugins/org.eclipse.jst.j2ee.web/icons/user_data_constraint.gif Binary files differdeleted file mode 100644 index 25dc9c892..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/user_data_constraint.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/user_ovr.gif b/plugins/org.eclipse.jst.j2ee.web/icons/user_ovr.gif Binary files differdeleted file mode 100644 index b8797f34f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/user_ovr.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/warn_tsk.gif b/plugins/org.eclipse.jst.j2ee.web/icons/warn_tsk.gif Binary files differdeleted file mode 100644 index e2b751dff..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/warn_tsk.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/web_resource_collection.gif b/plugins/org.eclipse.jst.j2ee.web/icons/web_resource_collection.gif Binary files differdeleted file mode 100644 index acba7cb36..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/web_resource_collection.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/web_type.gif b/plugins/org.eclipse.jst.j2ee.web/icons/web_type.gif Binary files differdeleted file mode 100644 index 09f609d6c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/web_type.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_12.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webapp_12.gif Binary files differdeleted file mode 100644 index 7646c44a4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_12.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_13.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webapp_13.gif Binary files differdeleted file mode 100644 index fec24d632..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_13.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_14.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webapp_14.gif Binary files differdeleted file mode 100644 index 83f916563..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_14.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_22.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webapp_22.gif Binary files differdeleted file mode 100644 index 71bf43c76..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_22.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_23.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webapp_23.gif Binary files differdeleted file mode 100644 index 9fbce0568..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_23.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_24.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webapp_24.gif Binary files differdeleted file mode 100644 index a9045c131..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webapp_24.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/webgroup_obj.gif b/plugins/org.eclipse.jst.j2ee.web/icons/webgroup_obj.gif Binary files differdeleted file mode 100644 index 274d361ca..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/webgroup_obj.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/welcome_file.gif b/plugins/org.eclipse.jst.j2ee.web/icons/welcome_file.gif Binary files differdeleted file mode 100644 index d7dab830d..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/welcome_file.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/welcome_list.gif b/plugins/org.eclipse.jst.j2ee.web/icons/welcome_list.gif Binary files differdeleted file mode 100644 index f4c713273..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/welcome_list.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/icons/xml_image.gif b/plugins/org.eclipse.jst.j2ee.web/icons/xml_image.gif Binary files differdeleted file mode 100644 index 1496cba65..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/icons/xml_image.gif +++ /dev/null diff --git a/plugins/org.eclipse.jst.j2ee.web/plugin.properties b/plugins/org.eclipse.jst.j2ee.web/plugin.properties deleted file mode 100644 index db06c8f2d..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/plugin.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -war_validator_UI_=War Validator diff --git a/plugins/org.eclipse.jst.j2ee.web/plugin.xml b/plugins/org.eclipse.jst.j2ee.web/plugin.xml deleted file mode 100644 index 57671afa6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/plugin.xml +++ /dev/null @@ -1,635 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin - id="org.eclipse.jst.j2ee.web" - name="Web Plug-in" - version="1.0.0" - provider-name="Eclipse.org" - class="org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin"> - - <runtime> - <library name="runtime/web.jar"> - <export name="*"/> - </library> - </runtime> - <requires> - <import plugin="org.eclipse.jst.j2ee"/> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.wst.server.core"/> - <import plugin="org.eclipse.jst.server.core"/> - <import plugin="org.eclipse.wst.common.frameworks"/> - <import plugin="org.eclipse.jem.workbench"/> - <import plugin="org.eclipse.wst.common.emfworkbench.integration"/> - <import plugin="org.eclipse.jst.j2ee.core"/> - <import plugin="org.eclipse.wst.validation"/> - <import plugin="org.eclipse.wst.common.emf"/> - <import plugin="org.eclipse.emf.ecore.xmi"/> - <import plugin="org.eclipse.emf.edit"/> - <import plugin="org.eclipse.jem"/> - <import plugin="org.eclipse.jem.workbench"/> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.jdt.core"/> - <import plugin="org.eclipse.wst.common.migration"/> - <import plugin="org.eclipse.emf.codegen"/> - <import plugin="org.eclipse.wst.web"/> - <import plugin="org.eclipse.jface"/> - <import plugin="org.eclipse.jst.common.annotations.controller"/> - <import plugin="org.eclipse.jst.common.frameworks"/> - <import plugin="org.eclipse.debug.ui"/> - <import plugin="org.eclipse.wst.common.modulecore"/> - </requires> - -<!--============================--> -<!-- Web JSFaces File URL extension --> -<!--============================--> - - <extension-point id="fileURL" name="FileURL"/> - - -<!--============================--> -<!-- Web Validator --> -<!--============================--> - <extension - id="WarValidator" - name="%war_validator_UI_" - point="org.eclipse.wst.validation.validator"> - <validator> - <projectNature - id="org.eclipse.jst.j2ee.web.WebNature"> - </projectNature> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="web.xml"> - </filter> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter="*.jar"> - </filter> - <filter - objectClass="org.eclipse.core.resources.IFile" - nameFilter=".websettings"> - </filter> - <helper - class="org.eclipse.jst.j2ee.internal.web.validation.UIWarHelper"> - </helper> - <dependentValidator - depValValue="true"> - </dependentValidator> - <run - class="org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator"> - </run> - </validator> - </extension> -<!--============================--> -<!-- Web Project Nature Contributions --> -<!--============================--> -<!-- <extension - id="WebNature" - name="Web Properties" - point="org.eclipse.core.resources.natures"> - <runtime> - <run - class="org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime"> - </run> - </runtime> - </extension> --> - - -<!-- Register the nature id with the AbstractJavaMOFNature --> -<!--<extension - point="org.eclipse.jem.workbench.nature_registration"> - <nature - id="org.eclipse.jst.j2ee.web.WebNature"> - </nature> - </extension> --> - <extension - id="editModel.web" - name="Web Edit Model" - point="org.eclipse.wst.common.emfworkbench.integration.editModel"> - <editModel - editModelID="org.eclipse.jst.web.editModel" - factoryClass="org.eclipse.jst.j2ee.internal.web.operations.WebEditModelFactory"> - <editModelResource - URI="WEB-INF/web.xml"> - </editModelResource> - <editModelResource - URI="WEB-INF/webservicesclient.xml"> - </editModelResource> - </editModel> - </extension> - <extension - id="WebModuleExtension" - name="WebModuleExtension" - point="org.eclipse.jst.j2ee.EARModuleExtension"> - <earModuleExtension - extensionClass="org.eclipse.jst.j2ee.internal.web.plugin.WebModuleExtensionImpl"> - </earModuleExtension> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - functionGroupID="org.eclipse.jst.j2ee" - className="org.eclipse.jst.j2ee.internal.web.providers.WebapplicationItemProviderAdapterFactory" - packageURI="webapplication.xmi" - id="org.eclipse.jst.j2ee.webapplication.provider.WebapplicationItemProviderAdapterFactory"> - </adapterFactory> - </extension> - <extension - point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory"> - <adapterFactory - functionGroupID="org.eclipse.jst.j2ee" - className="org.eclipse.jst.j2ee.internal.web.providers.JspItemProviderAdapterFactory" - packageURI="jsp.xmi" - id="org.eclipse.jst.j2ee.internal.jsp.provider.JspItemProviderAdapterFactory"> - </adapterFactory> - </extension> - <extension - point="org.eclipse.wst.common.frameworks.ExtendableOperation"> - <extendableOperation - class="org.eclipse.jst.j2ee.internal.web.archive.operations.WebProjectCreationOperation" - id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebProjectCreationOperation"> - </extendableOperation> - <extendableOperation - class="org.eclipse.jst.j2ee.internal.web.archive.operations.WARImportOperation" - id="org.eclipse.jst.j2ee.internal.web.archive.operations.WARImportOperation"> - </extendableOperation> - </extension> -<!-- ======================Lib Dir Builder ========================= --> - <extension - id="LibDirBuilder" - name="Lib Dir Builder" - point="org.eclipse.core.resources.builders"> - <builder> - <run - class="org.eclipse.jst.j2ee.internal.web.operations.LibDirBuilder"> - </run> - </builder> - </extension> -<!-- ==================================================================== --> -<!-- Extension point: org.eclipse.etools.server.core.moduleObjectAdapters --> -<!-- Purpose: Define adapters for EJB and Web resources --> -<!-- ==================================================================== --> - <extension point="org.eclipse.wst.server.core.moduleArtifactAdapters"> - - <moduleArtifactAdapter - id="org.eclipse.jst.web.server.webresource" - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory"> - <enablement> - <with variable="selection"> - <adapt type="org.eclipse.jst.j2ee.webapplication.WebApp"/> - </with> - </enablement> - </moduleArtifactAdapter> - - <moduleArtifactAdapter - id="org.eclipse.jst.web.server.webresource2" - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory"> - <enablement> - <with variable="selection"> - <adapt type="org.eclipse.jst.server.core.Servlet"/> - </with> - </enablement> - </moduleArtifactAdapter> - - <moduleArtifactAdapter - id="org.eclipse.jst.web.server.webresource3" - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory"> - <enablement> - <with variable="selection"> - <adapt type="org.eclipse.core.resources.IProject"/> - </with> - </enablement> - </moduleArtifactAdapter> - - <moduleArtifactAdapter - id="org.eclipse.jst.web.server.webresource4" - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory"> - <enablement> - <with variable="selection"> - <adapt type="org.eclipse.core.resources.IFile"/> - </with> - </enablement> - </moduleArtifactAdapter> - - <moduleArtifactAdapter - id="org.eclipse.jst.web.server.webresource5" - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory"> - - <enablement> - <with variable="selection"> - <adapt type="org.eclipse.jdt.core.ICompilationUnit"/> - </with> - </enablement> - </moduleArtifactAdapter> - </extension> - - <extension point="org.eclipse.core.runtime.adapters"> - <factory - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory" - adaptableType="org.eclipse.core.resources.IProject"> - <adapter type= "org.eclipse.debug.ui.actions.ILaunchable"/> - </factory> - <factory - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory" - adaptableType="org.eclipse.jdt.core.ICompilationUnit"> - <adapter type= "org.eclipse.debug.ui.actions.ILaunchable"/> - </factory> - <factory - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory" - adaptableType="org.eclipse.core.resources.IFile"> - <adapter type= "org.eclipse.debug.ui.actions.ILaunchable"/> - </factory> - <factory - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory" - adaptableType="org.eclipse.jst.j2ee.internal.webapplication.impl.ServletImpl"> - <adapter type= "org.eclipse.debug.ui.actions.ILaunchable"/> - </factory> - <factory - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableArtifactAdapterFactory" - adaptableType="org.eclipse.jst.j2ee.internal.webapplication.impl.WebAppImpl"> - <adapter type= "org.eclipse.debug.ui.actions.ILaunchable"/> - </factory> - </extension> - -<!-- =============================================================== --> -<!-- Extension point: com.ibm.etools.server.core.moduleFactories --> -<!-- Purpose: Define the default module project factory --> -<!-- =============================================================== --> - <extension - point="org.eclipse.wst.server.core.moduleFactories"> - <moduleFactory - projects="true" - class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableFactory" - id="com.ibm.wtp.web.server"> - <moduleType - versions="1.2, 1.3, 1.4" - types="j2ee.web"> - </moduleType> - </moduleFactory> - </extension> - <extension - point="org.eclipse.wst.common.migration.migrator"> - <migrator - className="org.eclipse.jst.j2ee.internal.web.operations.WebSettingsMigrator" - id="org.eclipse.jst.common.migration.WebSettingsMigrator.id" - filter="org.eclipse.jst.j2ee.internal.project.J2EEMigrationFilter"> - <enablement> - <projectNature natureID="org.eclipse.jst.j2ee.web.WebNature"/> - </enablement> - </migrator> - </extension> - - - -<!-- =============================================================== --> -<!-- WTP Operation extendable operations --> -<!-- =============================================================== --> - <extension - point="org.eclipse.wst.common.frameworks.ExtendableOperation"> - <extendableOperation - class="org.eclipse.jst.j2ee.internal.web.operations.RemoveServletOperation" - id="org.eclipse.jst.j2ee.internal.web.operations.RemoveServletOperation"> - </extendableOperation> - <extendableOperation - class="org.eclipse.jst.j2ee.internal.web.operations.RemoveWebSecurityRoleOperation" - id="org.eclipse.jst.j2ee.internal.web.operations.RemoveWebSecurityRoleOperation"> - </extendableOperation> - <extendableOperation - class="org.eclipse.jst.j2ee.internal.web.operations.AddServletOperation" - id="org.eclipse.jst.j2ee.internal.web.operations.AddServletOperation"> - </extendableOperation> - </extension> - -<!-- =============================================================== --> -<!-- TagLib Server Target Listener Ext --> -<!-- =============================================================== --> - - <extension point="org.eclipse.wst.server.core.runtimeTargetHandlers"> - <runtimeTargetHandler - id="com.ibm.wtp.webtools.taglib.runtimeTarget" - runtimeTypeIds="com.ibm.ws.ast.st.runtime.v60, com.ibm.etools.websphere*" - class="org.eclipse.jst.j2ee.internal.web.taglib.WebProjectServerTaglibListener"/> - </extension> - - - <extension point="org.eclipse.jst.common.navigator.java.compressedProject"> - <compressedProject natureId="org.eclipse.jst.j2ee.web.WebNature" /> - <compressedProject natureId="org.eclipse.wst.web.StaticWebNature" /> - - </extension> - -<!-- icon="icons/full/obj16/webapp_deploy.gif" --> - - -<!-- =========================================================== --> -<!-- Web Tag set definitions for XDoclet --> -<!-- =========================================================== --> - - <extension - id="WebTagSets" - point="org.eclipse.jst.common.annotations.controller.AnnotationTagSet"> - <AnnotationTagSet - name="web"> - </AnnotationTagSet> - </extension> - - <extension - id="WebAnnotationInfo" - point="org.eclipse.jst.common.annotations.controller.AnnotationTagInfo"> - <AnnotationTagInfo - tagSet="web" - tagName="filter" - scope="type"> - <attrib - use="required" - name="name"> - </attrib> - <attrib - name="description"> - </attrib> - <attrib - name="display-name"> - </attrib> - <attrib - name="small-icon"> - </attrib> - <attrib - name="large-icon"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="filter-init-param" - scope="type"> - <attrib - use="required" - name="name"> - </attrib> - <attrib - name="value"> - </attrib> - <attrib - name="description"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="filter-mapping" - scope="type"> - <attrib - name="url-pattern"> - </attrib> - <attrib - name="servlet-name"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="servlet" - scope="type"> - <attrib - use="required" - name="name"> - </attrib> - <attrib - name="display-name"> - </attrib> - <attrib - name="icon"> - </attrib> - <attrib - name="description"> - </attrib> - <attrib - name="load-on-startup"> - </attrib> - <attrib - name="run-as"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="servlet-init-param" - multiplicity="*" - scope="type"> - <attrib - use="required" - name="name"> - </attrib> - <attrib - name="value"> - </attrib> - <attrib - name="description"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="servlet-mapping" - multiplicity="*" - scope="type"> - <attrib - use="required" - name="url-pattern"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="listener" - scope="type"> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="security-role-ref" - scope="type"> - <attrib - use="required" - name="role-name"> - </attrib> - <attrib - use="required" - name="role-link"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="resource-env-ref" - scope="type"> - <attrib - use="required" - name="name"> - </attrib> - <attrib - use="required" - name="type"> - </attrib> - <attrib - name="description"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="resource-ref" - scope="type"> - <attrib - use="required" - name="name"> - </attrib> - <attrib - use="required" - name="type"> - </attrib> - <attrib - use="required" - name="auth"> - </attrib> - <attrib - name="description"> - </attrib> - <attrib - name="scope"> - </attrib> - <attrib - name="jndi-name"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="security-role" - scope="type"> - <attrib - use="required" - name="role-name"> - </attrib> - <attrib - name="description"> - </attrib> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="env-entry" - scope="type"> - <attrib name="name" use="required"> - </attrib> - <attrib name="description"/> - <attrib name="type" type="enum"> - <enumValues value="java.lang.Boolean"/> - <enumValues value="java.lang.Byte"/> - <enumValues value="java.lang.Character"/> - <enumValues value="java.lang.String"/> - <enumValues value="java.lang.Short"/> - <enumValues value="java.lang.Integer"/> - <enumValues value="java.lang.Long"/> - <enumValues value="java.lang.Float"/> - <enumValues value="java.lang.Double"/> - </attrib> - <attrib name="value"/> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="ejb-ref" - scope="type"> - <attrib name="name" use="required"/> - <attrib name="type" type="enum" use="required"> - <enumValues value="Entity"/> - <enumValues value="Session"/> - </attrib> - <attrib name="home" use="required"/> - <attrib name="remote" use="required"/> - <attrib name="link"/> - <attrib name="description"/> - </AnnotationTagInfo> - <AnnotationTagInfo - tagSet="web" - tagName="ejb-local-ref" - scope="type"> - <attrib name="name" use="required"/> - <attrib name="type" type="enum" use="required"> - <enumValues value="Entity"/> - <enumValues value="Session"/> - </attrib> - <attrib name="home" use="required"/> - <attrib name="local" use="required"/> - <attrib name="link"/> - <attrib name="description"/> - </AnnotationTagInfo> - </extension> - - - <extension - point="org.eclipse.wst.common.emfworkbench.integration.editModel"> - <editModel - editModelID="jst.web" - factoryClass="org.eclipse.wst.common.componentcore.internal.impl.ArtifactEditModelFactory"> - <editModelResource - autoload="false" - URI="WEB-INF/web.xml"/> - </editModel> - </extension> - <extension - point="org.eclipse.wst.common.migration.migrator"> - <migrator - className="org.eclipse.wst.common.internal.migration.ComponentMigrator" - id="org.eclipse.wst.common.internal.migration.ComponentMigrator"> - <enablement> - <projectNature natureID="org.eclipse.jst.j2ee.web.WebNature"/> - </enablement> - </migrator> - </extension> - <extension - point="org.eclipse.wst.common.migration.migrator"> - <migrator - className="org.eclipse.wst.common.internal.migration.ComponentMigrator" - id="org.eclipse.wst.common.internal.migration.ComponentMigrator"> - <enablement> - <projectNature natureID="com.ibm.wtp.web.WebNature"/> - </enablement> - </migrator> - </extension> - <extension - point="org.eclipse.wst.common.migration.migratorStrategy"> - <migratorStrategy - className="org.eclipse.jst.j2ee.internal.web.migration.WebProjectMigratorStrategy" - id="org.eclipse.jst.j2ee.internal.web.migration.WebProjectMigratorStrategy.ID"> - <enablement> - <projectNature natureID="org.eclipse.jst.j2ee.web.WebNature"/> - </enablement> - </migratorStrategy> - </extension> - <extension - point="org.eclipse.wst.common.migration.migratorStrategy"> - <migratorStrategy - className="org.eclipse.jst.j2ee.internal.web.migration.WebProjectMigratorStrategy" - id="org.eclipse.jst.j2ee.internal.web.migration.WebProjectMigratorStrategy.ID"> - <enablement> - <projectNature natureID="com.ibm.wtp.web.WebNature"/> - </enablement> - </migratorStrategy> - </extension> - <extension - id="NatureMappings" - name="Module Core Nature Mappings" - point="org.eclipse.wst.common.migration.natureMapping"> - <natureMapping> - <mapping - position="first" - name="Nature Mapping" - newValue="org.eclipse.wst.common.componentcore.ModuleCoreNature"> - <alias - value="org.eclipse.jst.j2ee.web.WebNature"> - </alias> - </mapping> - </natureMapping> - </extension> - - <!--============================--> - <!-- Builder Provider registrations--> - <!--============================--> - <extension - point="org.eclipse.wst.common.frameworks.DataModelProviderExtension"> - <ProviderDefinesType - providerType="WebComponentBuilder" - providerID="org.eclipse.jst.j2ee.internal.deployables.JavaComponentBuilderDataModelProvider"/> - </extension> -</plugin> diff --git a/plugins/org.eclipse.jst.j2ee.web/prepareforpii.xml b/plugins/org.eclipse.jst.j2ee.web/prepareforpii.xml deleted file mode 100644 index 4978da741..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/prepareforpii.xml +++ /dev/null @@ -1,38 +0,0 @@ -<project name="PrepareForPII" default="main" basedir="."> - - <!-- Setup temp variables --> - <target name="init"> - <property name="nlsDir" value="d:/NLS/Corona/0526"/> - <property name="plugin" value="com.ibm.wtp.web"/> - <property name="plugindir" value="d:/workspaceCorona/${plugin}"/> - <property name="outputDir" value="${nlsDir}/${plugin}"/> - - - </target> - - <!-- Create the destination dir --> - <target name="nlsDir" depends="init"> - <mkdir dir="${nlsDir}"/> - </target> - - <!-- Create the destination dir --> - <target name="plugindir" depends="nlsDir"> - <delete dir="${outputDir}"/> - <mkdir dir="${outputDir}"/> - </target> - - <!-- Move the files to the correct locations in the workspace. --> - <target name="main" depends="plugindir"> - - <messageIdGen folderPath = "${plugindir}" componentId = "E" /> - - <copy todir = "${outputDir}/property_files" > - <fileset dir="${plugindir}/property_files"> - <include name="**/*.properties"/> - </fileset> - </copy> - - <copy file="${plugindir}/plugin.properties" todir="${outputDir}"/> - - </target> -</project> diff --git a/plugins/org.eclipse.jst.j2ee.web/property_files/ProjectSupport.properties b/plugins/org.eclipse.jst.j2ee.web/property_files/ProjectSupport.properties deleted file mode 100644 index 0d54403b5..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/property_files/ProjectSupport.properties +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -Creating_Web_Project..._UI_=Creating Web Project... -The_path_for_the_links_sta_EXC_=IWAE0001E The path for the links state file is incorrect -Syntax_Error_in_the_links_UI_=Syntax Error in the links state file -Error_while_saving_links_s_EXC_=IWAE0002E Error while saving links state file -Operation_failed_due_to_SA_ERROR_=IWAE0003E Operation failed due to SAX error: -Operation_failed_due_to_IO_ERROR_=IWAE0004E Operation failed due to IO error: -Operation_failed_due_to_Co_ERROR_=IWAE0005E Operation failed due to Core error: -Operation_failed_due_to_Ja_ERROR_=IWAE0006E Operation failed due to Java Model error: -1concat_EXC_=IWAE0007E Error occured getting web.xml: {0} -Error_importing_Module_Fil_EXC_=IWAE0008E Error importing Module File -Cannot_clone_TaglibInfo_1_EXC_=IWAE0009E Cannot clone TaglibInfo -Could_not_read_TLD_15=Could not read TLD -File_Serving_Enabler_7=File Serving Enabler -Auto_Generated_-_File_Enabler_9=Auto Generated - File Enabler -Generated_by_Web_Tooling_23=Generated by Web Tooling -Not_a_web_project_29=Not a web project -A_web_project_must_be_open_and_must_exist_for_properties_to_be_edited_30=A web project must be open and must exist for properties to be edited -Invalid_Servlet_Level_set_on_WebNature_3_EXC_=IWAE0010E Invalid Servlet Level set on WebNature -Context_Root_cannot_be_empty_2=Context Root cannot be empty -Names_cannot_begin_or_end_with_whitespace_5=Names cannot begin or end with whitespace -The_character_is_invalid_in_a_context_root=The character {0} is invalid in a context root. -Folder_name_cannot_be_empty_2=Folder name cannot be empty -Folder_names_cannot_be_equal_4=Folder names cannot be equal -Folder_name_cannot_be_the_same_as_Java_source_folder_5=Folder name cannot be the same as Java source folder -Folder_name_cannot_be_the_same_as_Java_class_folder_6=Folder name cannot be the same as Java class folder -Folder_name_is_not_valid=Folder name {0} is not valid -Could_not_rename_____2=Could not rename: ''{0}'' already exists. -Sync_WLP_Op=Synchronizing Web Library Projects\n\t -Target_Update_Op=Updating target server for {0}\n\t -24concat_INFO_=IWAE0011I .startupOnInitialize() for -Sychronize_Class_Path_UI_=Sychronize Class Path -Catalog_Lib_Directory__UI_=Catalog Lib Directory: -Update_ClassPath__UI_=Update ClassPath: -Catalog_Lib_Directory__UI_=Catalog Lib Directory: -Update_ClassPath__UI_=Update ClassPath: -Set_ClassPath__UI_=Set ClassPath: diff --git a/plugins/org.eclipse.jst.j2ee.web/property_files/warvalidation.properties b/plugins/org.eclipse.jst.j2ee.web/property_files/warvalidation.properties deleted file mode 100644 index 4ecfe0132..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/property_files/warvalidation.properties +++ /dev/null @@ -1,252 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -#This properties file hold all the externalised strings for eTools WAR Validation project -# Validation project -# -# Messages should be according to the format at: -# http://hany.austin.ibm.com/messages/index.html -# -# Briefly: -# MESSAGE_ID=<ComponentPrefix><MessageNumber><TypeCode>: <MessageText> -# -# The prefix for this component is: -# CHKJ (IBM WebSphere Validation) -# -# Note the ": " that appears between the type code and the message text. -# -# :Begin: WebSphere Quality Validation Information :Begin: -#COMPONENTPREFIX CHKJ -#COMPONENTNAMEFOR CHKJ IBM WebSphere Validation -#CMVCPATHNAME ncf/src/java/com/ibm/websphere/validation/warvalidation.properties -# :End: WebSphere Quality Validation Information :End: -# - -# 2-July-2001: -# This file has been tested using the ProcessMsgFile tool, written by -# Hany Salem and owned by Dennis Hebert. Any future changes should -# also be verified using this tool. Please contact Dennis -# (hebert@us.ibm.com or T/L 543-2520) for more information. -# - -# -------------------------------- -ERROR_WAR_VALIDATION_FAILED=CHKJ3000E: WAR Validation Failed: {0} -#EXPLANATION None. -#USERACTION None. - - -# -------------------------------- -ERROR_EAR_DUPLICATE_ROLES=CHKJ1002E: Duplicate security role named {0}. -MESSAGE_WAR_VALIDATION_MISSING_JSP=CHKJ3001E: The JSP file, {0}, for the servlet \"{1}\" is missing. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_SMALL_ICON=CHKJ3002E: The <small-icon> file, {0}, is missing. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_LARGE_ICON=CHKJ3003E: The <large-icon> file, {0}, is missing. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_BROKEN_SERVLET_MAPPING=CHKJ3004W: The servlet mapping \"{0}\" refers to a servlet that is not defined. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_NO_WELCOME_FILE=CHKJ3005E: Empty welcome file list entry. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_MISSING_WELCOME_FILE=CHKJ3006E: Welcome file {0} is missing. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_MISSING_TLD=CHKJ3007E: The Tag Library Descriptor File, {0}, is missing. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_INVALID_WAR_FILE=CHKJ3008E: Missing or invalid WAR file. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_BROKEN_FILTER_MAPPING=CHKJ3009E: The filter mapping \"{0}\" refers to a filter that is not defined. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_WELCOME_FILE=CHKJ3010W: Welcome Files cannot begin or end with a /. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -WAR_DD_PARSE_LINECOL=CHKJ1009E: Parsing Error: {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -WAR_DD_PARSE_LINE=CHKJ1010E: Deployment Descriptor Parsing error. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -WAR_DD_PARSE_NOINFO=CHKJ1011E: Deployment Descriptor Parsing error. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -WAR_DD_CANNOT_OPEN_DD=CHKJ1012E: Cannot open the deployment descriptor. Validation cannot complete. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_URL=CHKJ3013E: The URL Mapping \"{0}\" is invalid. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_SEC_ROLE=CHKJ3014E: Invalid Security role-link: {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_HTTP_CMD=CHKJ3015E: Invalid HTTP method: {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_TRANSPORT=CHKJ3016E: Invalid Transport Gurarantee. Valid values are \"NONE\", \"INTEGRAL\", or \"CONFIDENTIAL\". - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_JSPFILE_REF=CHKJ3018E: The jsp-file \"{0}\" referenced by servlet {1} must be a full absolute path. - - -# -------------------------------- -ERROR_EAR_INVALID_CONTEXT_ROOT=CHKJ3017E: Web Project: {0} is mapped to an invalid Context root: {1} in EAR Project: {2}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_ERROR_PAGE=IWAE0001E CHKJ3019E: The Location of the Error Page Must Begin with a /. -#EXPLANATION None. -#USERACTION None. - -MESSAGE_WAR_VALIDATION_INVALID_SEC_ROLE_NAME=CHKJ3020E: Invalid Security role-name: {0}. -#EXPLANATION None. -#USERACTION None. - -MESSAGE_WAR_VALIDATION_INVALID_AUTH_METHOD=CHKJ3021E: Invalid auth method. Valid values are: \"BASIC\", \"DIGEST\", \"FORM\", or \"CLIENT-CERT\". -#EXPLANATION None. -#USERACTION None. - -MESSAGE_WAR_VALIDATION_IGNORE_FORM_LOGIN=CHKJ3022E: Authentication method is {0}. The form-login-config values will be ignored unless using FORM authentication method. -#EXPLANATION None. -#USERACTION None. - -MESSAGE_WAR_VALIDATION_RES_AUTH_REQUIRED_22=CHKJ3023E: Resource ref {0} must contain res-auth of "SERVLET" or "CONTAINER". -MESSAGE_WAR_VALIDATION_RES_AUTH_REQUIRED_23=CHKJ3024E: Resource ref {0} must contain res-auth of "Application" or "Container". -MESSAGE_WAR_VALIDATION_RES_AUTH_INVALID_22=CHKJ3025E: \"Application\" is not a valid value for.res-auth in a 2.2 level deployment descriptor. Use \"SERVLET\" instead. -MESSAGE_WAR_VALIDATION_RES_AUTH_INVALID_23=CHKJ3026E: \"SERVLET\" is not a valid value for.res-auth in a 2.2 level deployment descriptor. Use \"Application\" instead. - -MESSAGE_WAR_VALIDATION_INVALID_EXCEPTION_TYPE=CHKJ3027E: Invalid Exception Type {0}. The exception type must contain a fully qualified class name of a Java exception type. -#EXPLANATION None. -#USERACTION None. - - - -# -------------------------------- -MESSAGE_WAR_VALIDATION_DUPLICATE_MAPPING=CHKJ4010W: Duplicate URL mapping {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_DUPLICATE_SERVLET=CHKJ4011W: Duplicate Servlet Entry {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_SESSION_TIMEOUT=CHKJ4012W: Session Timeout is not valid. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_DUPLICATE_ENTRY=CHKJ4013W: Duplicate Entry {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_EMPTY_ENTRY=CHKJ4014W: Empty Entry {0}. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_DUPLICATE_FILTER=CHKJ4015W: Duplicate Filter Entry {0}. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_DUPLICATE_EJB_REF=CHKJ4016W: Duplicate ejb-ref element named {0}. -#EXPLANATION None. -#USERACTION None. - -# This was missing. It's defined in constants... -ERROR_EAR_UNCONTAINED_MODULE_FILE_EXCEPTION=CHKJ4017W: ERROR EAR UNCONTAINED MODULE FILE EXCEPTION - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_ERROR_CODE=IWAE0036E CHKJ4018W: Unknown Error Code: {0}. error-code must contain a valid HTTP status code. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_RES_SHARING_SCOPE=CHKJ4019W: Invalid res-sharing-scope; valid values are \"Shareable\" or \"Unshareable\". -#USERACTION None. - -MESSAGE_WAR_VALIDATION_INVALID_ENV_ENTRY=CHKJ4020W: Invalid Environment Entry Type. Valid values are \"java.lang.TYPE\", where TYPE is one of the following: Boolean, Byte, Character, String, Short, Integer, Long, Float, or Double." -#USERACTION None. - -MESSAGE_WAR_VALIDATION_MISSING_WLP_PROJECT=CHKJ4021W: Missing Web Library Project ({0}). Check the properties of this project to fix this problem. -MESSAGE_WAR_VALIDATION_CONFLICTING_WLP_PROJECT=CHKJ4022W: The Web Library Project JAR ({0}) conflicts with an actual JAR in the WEB-INF/lib directory. -MSG_SERVER_TARGET_MISMATCH=CHKJ4023W: The target server of the Web Library Project ({1}) does not match that of this Web Project ({0}). Run validation on the Web Project if you think that is not the case. - -# -------------------------------- -MESSAGE_WAR_VALIDATION_INVALID_EJB_REF_TYPE=CHKJ4023W: ejb-ref-type must be 'Entity' or 'Session'. -#EXPLANATION None. -#USERACTION None. - -of_Type_Security_Role_Name_6=of Type Security Role Name -Web_Archive_Validator_8=Web Archive Validator -of_Type_Role_Name_19=of Type Role Name -of_Type_Parameter_Name_25=of Type Parameter Name -of_Type_Parameter_Value_26=of Type Parameter Value -of_Type_Parameter_Name_32=of Type Parameter Name -of_Type_Parameter_Value_33=of Type Parameter Value -of_Type_Parameter_Name_39=of Type Parameter Name -of_Type_Parameter_Value_40=of Type Parameter Value -of_Type_ejb-ref-name_44=of Type ejb-ref-name -of_Type_Error_Location_47=of Type Error Location -of_Type_Error_Location_49=of Type Error Location -of_Type_Mime_Extension_54=of Type Mime Extension -of_Type_Mime_Type_55=of Type Mime Type -of_Type_Mime_Extension___56=of Type Mime Extension: -of_Type_Web_Resource_Collection_64=of Type Web Resource Collection -of_Type_Filter_Name_66=of Type Filter Name -Invalid_URL_70=Invalid URL -Invalid_URL_75=Invalid URL -of_Type_Servlet_Name_77=of Type Servlet Name -of_Type_Taglib_80=of Type Taglib -of_Type_TagLib___81=of Type TagLib: -of_Type_Web_Resource_Name_84=of Type Web Resource Name -of_Type_Welcome_File_Name__87=of Type Welcome File Name -of_Type_Env_Entry_Name___88=of Type Environment Entry Name diff --git a/plugins/org.eclipse.jst.j2ee.web/property_files/web.properties b/plugins/org.eclipse.jst.j2ee.web/property_files/web.properties deleted file mode 100644 index faacfcdf6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/property_files/web.properties +++ /dev/null @@ -1,87 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -ERR_JAR_NAME_EMPTY=The JAR name cannot be empty. -ERR_JAR_NAME_EXIST=The JAR name already exists. -ERR_JAVA_PROJECT_NAME_EMPTY=The Java project name cannot be empty. -ERR_JAVA_PROJECT_NAME_EXIST=The Java project name already exists. -ERR_DUPLICATED_INIT_PARAMETER=Duplicated init parameters. -ERR_DUPLICATED_URL_MAPPING=Duplicated URL mappings. - -ERR_SERVLET_MAPPING_URL_PATTERN_EMPTY=The servlet mapping url pattern cannot be empty. -ERR_SERVLET_MAPPING_URL_PATTERN_EXIST=The servlet mapping url pattern "{0}" already exists. -3=The filter mapping url pattern cannot be empty. -4=The filter mapping url pattern "{0}" already exists. -5=The filter mapping servlet cannot be empty. -6=The filter init param name cannot be empty. -ERR_FILTER_PARAMETER_NAME_EXIST=The filter initialization parameter name already exists. -ERR_FILTER_MAPPING_SERVLET_EXIST=The filter mapping servlet "{0}" already exists. -ERR_FILTER_MAPPING_SERVLET_DISPATCHER_TYPES_EMPTY=The dispatcher types cannot be empty. -ERR_DISPLAY_NAME_EMPTY=The name cannot be empty. -ERR_SERVLET_NAME_EXIST=The servlet name already exists. -ERR_SERVLET_DISPLAY_NAME_EXIST=The servlet display name already exists. -ERR_SERVLET_CLASS_NAME_USED=The class is already associated with other servlet. -ERR_SERVLET_JAVA_CLASS_NAME_INVALID=Cannot use Servlet as the servlet class name. -ERR_SERVLET_MAPPING_URL_PATTERN_EMPTY=The servlet mapping url pattern cannot be empty. -ERR_SERVLET_MAPPING_URL_PATTERN_EXIST=The servlet URL mapping pattern already exists. -ERR_SERVLET_MAPPING_SERVLET_NOT_EXIST=The servlet does not exist. -ERR_SERVLET_PARAMETER_NAME_EMPTY=The servlet initialization parameter name cannot be empty. -ERR_SERVLET_PARAMETER_NAME_EXIST=The servlet initialization parameter name already exists. -ERR_SERVLET_PARAMETER_VALUE_EMPTY=The servlet initialization parameter value cannot be empty. -ERR_SERVLET_PARAMETER_VALUE_EXIST=The servlet initialization parameter value already exists. -ERR_SERVLET_ROLE_REF_NAME_EMPTY=The servlet security role reference name cannot be empty. -ERR_SERVLET_ROLE_REF_NAME_EXIST=The servlet security role reference name already exists. -ERR_SERVLET_ROLE_LINK_EMPTY=The servlet security role reference link cannot be empty. - -ERR_FILTER_DISPLAY_NAME_EXIST=The filter name already exists. -ERR_FILTER_CLASS_NAME_USED=The class is already associated with other filter. -ERR_FILTER_CLASS_NAME_INVALID=Cannot use Filter as the filter class name. -ERR_LISTENER_DISPLAY_NAME_EXIST=The listener name already exists. -ERR_LISTENER_CLASS_NAME_USED=The class is already associated with other listener. -ERR_LISTENER_CLASS_NAME_INVALID=Cannot use Listener as the listener class name. - -ERR_PAGE_ENCODING_EMPTY=The page encoding cannot be empty. -ERR_PAGE_ENCODING_EXIST=The page encoding already exists. -ERR_URL_PATTERN_EXIST=The URL pattern exists. -ERR_INCLUDE_PRELUDES_EXIST=The include preludes exists. -ERR_INCLUDE_CODAS_EXIST=The include Codas exists. -ERR_SECURITY_CONSTRAINT_NAME_EMPTY=The security constraint name cannot be empty. -ERR_SECURITY_CONSTRAINT_NAME_EXIST=The security constraint name already exists. -ERR_CONTEXT_PARAMETER_NAME_EMPTY=The context parameter name cannot be empty. -ERR_CONTEXT_PARAMETER_NAME_EXIST=The context parameter name already exists. -ERR_RESOURCE_NAME_EMPTY=The web resource name cannot be empty. -ERR_RESOURCE_NAME_EXIST=The web resource name already exists. -ERR_URL_PATTERNS_EMPTY=The URL patterns cannot be empty. -ERR_MIME_MAPPING_EXTENSION_EMPTY=The Mime mapping extension cannot be empty. -ERR_MIME_MAPPING_EXTENSION_EXIST=The Mime mapping extension already exists. -ERR_WELCOME_PAGE_EMPTY=The Welcome file name cannot be empty. -ERR_WELCOME_PAGE_EXIST=The Welcome file name already exists in Welcome File List. -ERR_ENV_ENTRY_NAME_EMPTY=The environment entry name cannot be empty. -ERR_ENV_ENTRY_NAME_EXIST=The environment entry name already exists. -ERR_ERROR_CODE_EMPTY=The error code cannot be empty. -ERR_ERROR_CODE_MUST_BE_3_DIGITS=The error code must be three digits. -ERR_ERROR_PAGE_LOCATION_EMPTY=The error page location cannot be empty. -ERR_ERROR_PAGE_LOCATION_EXIST=The error page location already exists. -ERR_ERROR_PAGE_LOCATION_MUST_START_WITH_SLASH=The error page location must start with /. -ERR_EXCEPTION_TYPE_EMPTY=The exception type cannot be empty. -ERR_EXCEPTION_SECURITY_ID_NO_BEANS=The bean selection can not be empty. -ERR_EXCEPTION_ROLE_NAME_EMPTY=The role name can not be empty. -ERR_LOCALE_NAME_EMPTY=The locale cannot be empty. -ERR_LOCALE_NAME_EXIST=The locale already exists. -ERR_TAGLIBREF_URL_EMPTY=The tag lib ref URL cannot be empty. -ERR_TAGLIBREF_URL_EXIST=The tag lib ref URL already exists. -ERR_MESSAGE_DESTINATION_NAME_EMPTY=The message destination name cannot be empty. -ERR_MESSAGE_DESTINATION_NAME_EXIST=The message destination name already exists. -ERR_EXCEPTION_ROLE_NAME_EMPTY=The security role names cannot be empty. -ERR_EXCEPTION_METHOD_ELEMENT_EMPTY=The method elements cannot be empty. -ERR_EXCEPTION_METHOD_TRANSACTION_ATTRIBUTES_EMPTY=The method transaction attributes can not be empty. -ERR_SERVLET_LIST_EMPTY=The list of servlets to be removed cannot be empty. -ERR_FILTER_LIST_EMPTY=The list of filters to be removed cannot be empty. -ERR_LISTENER_LIST_EMPTY=The list of listeners to be removed cannot be empty. diff --git a/plugins/org.eclipse.jst.j2ee.web/property_files/webedit.properties b/plugins/org.eclipse.jst.j2ee.web/property_files/webedit.properties deleted file mode 100644 index 1859b15f9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/property_files/webedit.properties +++ /dev/null @@ -1,937 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 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 -############################################################################### -FILTER_MAPPING=Filter Mapping -LISTENER=Listener -Container_Selection_UI_=Folder Selection -Choose_a_Container__UI_=Choose a Folder: -Container__UI_=Folder: -Browse..._UI_=Browse... -Superclass_selection_UI_=Superclass selection -Choose_a_superclass_UI_=Choose a superclass -Add..._UI_=Add... -Remove_UI_=Remove -No_packages_to_choose_from_UI_=No packages to choose from. -Error_EXC_=IWAE0015E Error -Specify_a_name_and_package_UI_=Create a new Servlet class. -Which_method_stubs_would_y_UI_=Which method stubs would you like to create? -__Add_to_web.xml?_UI_=Add to web.xml? -__Add...___UI_=Add -__Delete___UI_=Delete -Cancel_UI_=Cancel -New_UI_=New -None_UI_=None -Create_the_Servlet_Class_UI_=Create the Servlet Class -Define_the_Servlet_in_the__UI_=Define the Servlet in the Deployment Descriptor (web.xml) File -Identify_any_information_t_UI_=Identify any information that should be inserted into the Deployment Descriptor (web.xml) file for the servlet. -Create_Two_Children_UI_=Create Two Children -Create_Child_UI_=Create Child -Description_UI_=Description -2concat_UI_=Create a new child for the selected {0}. -4concat_UI_=Create a child of type {0} for the selected {1}. -6concat_UI_=Create {0} -7concat_UI_=Create two new children for the selected {0}. -8concat_UI_=Create two new children of type {0} for the selected {1}. -9concat_UI_=Create Two {0}s -11concat_UI_=AuthConstraint {0} -12concat_UI_=ContextParam {0} -13concat_UI_=ErrorPage {0} -14concat_UI_=ErrorCodeErrorPage {0} -15concat_UI_=ExceptionTypeErrorPage {0} -52concat_UI_=FormLoginConfig {0} -16concat_UI_=FormLoginConfig {0} -17concat_UI_=HTTPMethodType {0} -18concat_UI_={0} = {1} -21concat_UI_=LoginConfig {0} -22concat_UI_=MimeMapping {0} -23concat_UI_=RoleNameType {0} -24concat=Create a child of type WebResourceCollection for the selected {0}. -26concat_UI_=Create a child of type InitParam for the selected {0}. -28concat_UI_=Servlet mapping ({0} -> {1}) -31concat_UI_=SessionConfig {0} -32concat_UI_=TagLibRef {0} -33concat_UI_=URLPatternType {0} -34concat_UI_=UserDataConstraint {0} -35concat_UI_=Create a child of type ContextParam for the selected {0}. -37concat_UI_=Create a child of type URLPatternType for the selected {0}. -38concat_UI_=WebResourceCollection {0} -40concat_UI_=JSPType {0} -41concat_UI_=ServletType {0} -42concat_UI_=Create a child of type WelcomeFile for the selected {0}. -45concat_ERROR_=IWAE0016E Error writing to web.xml:{0} -50concat_UI_={0} Change -New_param_UI_=New param -value_UI_=value -New_init_param_UI_=New init param -(New_Security_Role)_UI_=(New Security Role) -New_security_role_UI_=New security role -(New_Servlet)_UI_=(New Servlet) -packagename.classname_UI_=packagename.classname -New_servlet_UI_=New servlet -/url/*_UI_=/url/* -New_servlet_mapping_UI_=New servlet mapping -(New_filename)_UI_=(New filename) -New_welcome_file_UI_=New welcome file -New_welcome_file_list_UI_=New welcome file list -Problems_Opening_Editor_ERROR_=IWAE0017E Problems Opening Editor -Large_Icon_Chooser_Dialog_UI_=Large Icon Chooser Dialog -Small_Icon_Chooser_Dialog_UI_=Small Icon Chooser Dialog -Browse..._UI__UI_=Browse... -Value__UI_=Value: -Description_UI__UI_=Description -Error_EXC__ERROR_=IWAE0018E Error -root_undef_ERROR_=IWAE0019E root undef -Package__UI_=Package: -(default)_UI_=(default) -Servlet_Name__UI_=Servlet Name: -Superclass__UI_=Superclass: -Interfaces__UI_=Interfaces: -Modifiers__UI_=Modifiers: -Use_Single_Thread_Model_UI_=Use Single Thread Model -Options__UI_=Options: -Package_Selection_UI_=Package Selection -Choose_a_package__UI_=Choose a package: -Superinterfaces_Selection_UI_=Superinterfaces Selection -Choose_interfaces_UI_=Choose interfaces -Create_the_Servlet_Class_UI__UI_=Create the Servlet Class -Inherited_abstract_methods_UI_=Inherited abstract methods -Constructors_from_supercla_UI_=Constructors from superclass -Mappings__UI_=Mappings: -URL_UI_=URL -URL__UI_=URL: -Add_Mapping_UI_=Add Mapping -Display_Name__UI_=Display name: -Init_Parameters__UI_=Init Parameters: -Initialization_parameter_UI_=Initialization parameter -Value_UI_=Value -Parameter_Name__UI_=Parameter Name: -Parameter_Value__UI_=Parameter Value: -Add_Initialization_Paramet_UI_=Add Initialization Parameter -OK_UI_=OK -(default_package)_UI_=(default package) -Authorized_Roles_UI_=Authorized roles -Edit..._UI_=Edit... -(New_web_resource_collecti_UI_=(New web resource collection) -New_web_resource_collectio_UI_=New web resource collection -Delete_web_resource_collec_UI_=Delete web resource collection -Web_Resource_Collection_UI_=Web resource collection -Web_Resource_Collections_UI_=Web Resource Collections -New_UI__UI_=Add -Delete_UI_=Remove -User_Data_Constraint_UI_=User data constraint -New_security_constraint_UI_=New security constraint -Transport_guarentee_change_UI_=Transport guarentee change -Delete_security_constraint_UI_=Delete security constraint -Security_constraints_UI_=Security constraints -Name_UI_=Name -(New_Web_Resource_Collecti_UI_=(New Web Resource Collection) -Choose_a_JSP_UI_=Choose a JSP -Select_a_JSP_file_UI_=Select a JSP file -Choose_a_servlet_UI_=Choose a servlet -Select_a_servlet_class_UI_=Select a servlet class -(New_URL)_UI_=(New URL) -Icon_change_UI_=Icon change -Authorized_Roles__UI_=Authorized roles: -Delete_servlet_mappings_UI_=Delete servlet mappings -Type__UI_=Type: -Servlet_class_UI_=Servlet class -JSP_file_UI_=JSP file -Display_name__UI_=Display name: -Description__UI_=Description: -Initialization__UI_=Initialization... -Icons__UI_=Icons... -Display_name_change_UI_=Display name change -Description_change_UI_=Description change -Web_type_change_UI_=Web type change -URL_Mappings__UI_=URL mappings: -New..._UI_=New... -Add_UI_=Add -Delete_servlets_UI_=Delete servlets -Servlets_UI_=Servlets -(New_URI)_UI_=(New URI) -/WEB-INF/tlds/(taglib.tld)_UI_=/WEB-INF/tlds/(taglib.tld) -New_taglib_UI_=New taglib -Delete_taglibs_UI_=Delete taglibs -URI_UI_=URI -Location_UI_=Location -(New_ContextParameter)_UI_=(New ContextParameter) -New_context_parameter_UI_=New context parameter -Context_parameters__UI_=Context parameters: -Context_Parameter_Name_UI_=Context Parameter Name -(New_Extension)_UI_=(New Extension) -New_mime_mapping_UI_=New mime mapping -Delete_mime_mappings_UI_=Delete mime mappings -Session_time_out__UI_=Session time out: -Distributable_UI_=Distributable -Display_Name_UI_=Display Name -Session_Config_UI_=Session Config -Session_Timeout_UI_=Session Timeout -Mime_mappings__UI_=Mime mappings: -File_Extension_UI_=File Extension -Mime_Type_UI_=Mime Type -Delete_context_parameters_UI_=Delete context parameters -Welcome_file_name_change_UI_=Welcome file name change -(New_Welcome_File)_UI_=(New Welcome File) -Choose_an_Error_Page_UI_=Choose an Error Page -Select_an_Error_Page_UI_=Select an Error Page -Delete_welcome_files_UI_=Delete welcome files -Delete_error_pages_UI_=Delete error pages -Welcome_files_UI_=Welcome files -Choose_a_Login_Page_UI_=Choose a Login Page -Select_a_Login_Page_UI_=Select a Login Page -Error_mapping__UI_=Error mapping: -Error/Exception_UI_=Error/Exception -Login_UI_=Login -Realm_name__UI_=Realm name: -Authentication_method__UI_=Authentication method: -Login_page__UI_=Login page: -Error_page__UI_=Error page: -New_login_config_UI_=New login config -New_auth_method_ERROR_=IWAE0020E New auth method -New_auth_method_UI_=New auth method -New_realm_name_UI_=New realm name -New_form_login_config_UI_=New form login config -New_form_error_page_UI_=New form error page -(New_Error_Code)_UI_=(New Error Code) -New_error_page_UI_=New error page -Role_Name_UI_=Role Name -Select_all_UI_=Select all -Deselect_all_UI_=Deselect all -Authority_constraint_chang_UI_=Authority constraint change -Select_Auth_Constraints_UI_=Select Auth Constraints -Load_on_startup_UI_=Load on startup -Load_order__UI_=Load order: -New_parameter_UI_=New parameter -Initialization_Parameter_UI_=Initialization Parameter -Load_on_startup_change_UI_=Load on startup change -Delete_parameter_UI_=Delete parameter -Initialization_Parameters_UI_=Initialization Parameters -Security_role_changes_UI_=Security role changes -New_security_role_referenc_UI_=New security role reference -remove_security_role_refer_UI_=remove security role reference -Select_Authorized_Roles_UI_=Select Authorized Roles -Name__UI_=Name: -Delete_URL_Patterns_UI_=Delete URL Patterns -URL_Patterns_UI_=URL Patterns -HTTP_Methods_UI_=HTTP Methods -(New_URL_pattern)_UI_=(New URL pattern) -New_URL_pattern_UI_=New URL pattern -Web_resource_collection_na_UI_=Web resource collection name change -Web_resource_collection_de_UI_=Web resource collection description change -Add_http_method_type_UI_=Add http method type -Remove_http_method_type_UI_=Remove http method type -EJB_references_UI_=EJB references -Resource_factory_reference_UI_=Resource references -JSP_tag_libraries_UI_=JSP tag libraries -References_UI_=References -Environment_UI_=Environment -Source_UI_=Source -Error_creating_nested_text_ERROR_=IWAE0021E Error creating nested text editor -Pages_UI_=Pages -Security_UI_=Security -General_UI_=General -The_description_property_UI_=The description property -Roles_UI_=Roles -The_roles_property_UI_=The roles property -SecConstraint_UI_=SecConstraint -The_secConstraint_property_UI_=The secConstraint property -ParamName_UI_=ParamName -The_paramName_property_UI_=The paramName property -ParamValue_UI_=ParamValue -The_paramValue_property_UI_=The paramValue property -WebApp_UI_=WebApp -The_webApp_property_UI_=The webApp property -The_location_property_UI_=The location property -ErrorCode_UI_=ErrorCode -The_errorCode_property_UI_=The errorCode property -ExceptionType_UI_=ExceptionType -The_exceptionType_property_UI_=The exceptionType property -FormLoginPage_UI_=FormLoginPage -The_formLoginPage_property_UI_=The formLoginPage property -FormErrorPage_UI_=FormErrorPage -The_formErrorPage_property_UI_=The formErrorPage property -LoginConfig_UI_=LoginConfig -The_loginConfig_property_UI_=The loginConfig property -HttpMethod_UI_=HttpMethod -The_httpMethod_property_UI_=The httpMethod property -ResCollection_UI_=ResCollection -The_resCollection_property_UI_=The resCollection property -AuthMethod_UI_=AuthMethod -The_authMethod_property_UI_=The authMethod property -RealmName_UI_=RealmName -The_realmName_property_UI_=The realmName property -FormLoginConfig_UI_=FormLoginConfig -The_formLoginConfig_proper_UI_=The formLoginConfig property -Extension_UI_=Extension -The_extension_property_UI_=The extension property -MimeType_UI_=MimeType -The_mimeType_property_UI_=The mimeType property -RoleName_UI_=RoleName -The_roleName_property_UI_=The roleName property -AuthConstraint_UI_=AuthConstraint -The_authConstraint_propert_UI_=The authConstraint property -UserDataConstraint_UI_=UserDataConstraint -The_userDataConstraint_pro_UI_=The userDataConstraint property -Create_WebResourceCollecti_UI_=Create WebResourceCollection -SecurityConstraint_UI_=SecurityConstraint -SmallIcon_UI_=SmallIcon -Small_Icon_UI_=Small Icon -LargeIcon_UI_=LargeIcon -Large_Icon_UI_=Large Icon -ServletName_UI_=ServletName -The_servletName_property_UI_=The servletName property -DisplayName_UI_=DisplayName -The_displayName_property_UI_=The displayName property -LoadOnStartup_UI_=LoadOnStartup -The_loadOnStartup_property_UI_=The loadOnStartup property -Create_InitParam_UI_=Create InitParam -<servlet>_UI_=<servlet> -UrlPattern_UI_=UrlPattern -The_urlPattern_property_UI_=The urlPattern property -Servlet_UI_=Servlet -The_servlet_property_UI_=The servlet property -?_UI_=? -SessionTimeout_UI_=SessionTimeout -The_sessionTimeout_propert_UI_=The sessionTimeout property -TaglibURI_UI_=TaglibURI -The_taglibURI_property_UI_=The taglibURI property -TaglibLocation_UI_=TaglibLocation -The_taglibLocation_propert_UI_=The taglibLocation property -TransportGuarantee_UI_=TransportGuarantee -The_transportGuarantee_pro_UI_=The transportGuarantee property -The_distributable_property_UI_=The distributable property -FileList_UI_=FileList -The_fileList_property_UI_=The fileList property -Create_ContextParam_UI_=Create ContextParam -<web_app>_UI_=<web app> -WebResourceName_UI_=WebResourceName -The_webResourceName_proper_UI_=The webResourceName property -Create_URLPatternType_UI_=Create URLPatternType -WebType_UI_=WebType -JspFile_UI_=JspFile -The_jspFile_property_UI_=The jspFile property -ClassName_UI_=ClassName -The_className_property_UI_=The className property -WelcomeFile_UI_=WelcomeFile -The_welcomeFile_property_UI_=The welcomeFile property -<welcome-file>_UI_=<welcome-file> -Create_WelcomeFile_UI_=Create WelcomeFile -Welcome_File_List_UI_=Welcome File List -Error_Message_No_WRC_Entries_UI_=At least one web resource collection is required for a security constraint. If you want to delete this web resource collection, you must delete the entire security constraint. -Error_Title_No_WRC_Entries_UI_=Web resource collection -required1concat=Create a child of type #CHILD_CLASS_NAME# for the selected {0}. -(New_URL)_UI__UI_=(New URL) -New_param_UI__UI_=New param -value_UI__UI_=value -Select_Servlet_or_JSP_UI_=Select Servlet or JSP -Select_JSP_UI_=Select JSP -Add_Servlet_or_JSP_UI_=Add Servlet or JSP -Add_JSP_UI_=Add JSP -New_ErrorPage_UI_=New ErrorPage -New_ExceptionType_UI_=New ExceptionType -Add_Servlet_UI_=Add Servlet -Web_Nature_Runtime_does_no_EXC_=IWAE0022E Web Nature Runtime does not exist. -Editor_Redirection_UI_=Editor Redirection -The_selected_web.xml_file__ERROR_=IWAE0023E The selected web.xml file is not contained within a WAR Project. Therefore, this web.xml file is not a Deployment Descriptor for a Web Archive, hence the XML editor will be opened. -Problems_Opening_Editor_UI_=Problems Opening Editor -Create_#CHILD_CLASS_NAME#_UI_=Create #CHILD_CLASS_NAME# -Move_Welcome_Files_Down_UI_=Move Welcome Files Down -Move_Welcome_Files_Up_UI_=Move Welcome Files Up -Error_occurred_getting_web=Error occurred getting web.xml: {0} -Select_Class_UI_=Select Class -Could_not_uniquely_map_the_ERROR_=IWAE0024E Could not uniquely map the class name to a class. -Information_UI_=Information -The_chosen_operation_is_no_INFO_=IWAE0025I The chosen operation is not currently available. -JNDI_Name_UI_=JNDI Name -New_Servlet_UI_=New Servlet - - -(New_Filter)_1=(New Filter) -New_filter_2=New filter -New_filter_mapping_1=New filter mapping -New_listener_1=New listener -The_name_property_2=The name property -The_value_property_4=The value property -The_target_property_2=The target property -The_type_property_4=The type property -The_ExternalCacheGroups_property_2=The ExternalCacheGroups property -The_IdGenerator_property_4=The IdGenerator property -The_InvalidateOnly_property_6=The InvalidateOnly property -The_MetadataGenerator_property_8=The MetadataGenerator property -The_Priority_property_10=The Priority property -The_PropertiesGroupName_property_12=The PropertiesGroupName property -The_Timeout_property_14=The Timeout property -Small__1=Small: -Large__3=Large: -Choose_Small_Icon_5=Choose Small Icon -Select_the_Small_Icon_6=Select the Small Icon -Choose_Large_Icon_7=Choose Large Icon -Select_the_Large_Icon_8=Select the Large Icon -Caching_group_name__1=Caching group name: -Priority__2=Priority: -Timeout__3=Timeout: -second(s)_4=second(s) -Invalidate_only_5=Invalidate only -Caching_group_members__6=Caching group members: -_Servlet/JSP_7=\ Servlet/JSP -Remove_9=Remove -Use_URIs_for_cache_ID_building_1=Use URIs for cache ID building -Use_specified_string__2=Use specified string: -Variables__3=Variables: -_ID_4=\ ID -_Type_5=\ Type -_Required_6=\ Required -External_Cache_groups__1=External Cache groups: -_Group_Name_2=\ Group Name -ID_generator__3=ID generator: -Meta_data_generator__4=Meta data generator: -Remove_6=Remove -Add_Servlet_Caching_Configuration_1=Add Servlet Caching Configuration -Edit_Servlet_Caching_Configuration_2=Edit Servlet Caching Configuration -Add_1=Add -Remove_2=Remove -UP_5=UP -DOWN_6=DOWN -Add_or_Remove_Servlet_or_JSP_1=Add or Remove Servlet or JSP -Add_or_Remove_Security_Role_2=Add or Remove Security Role -Add_or_Remove_Security_Constraint_3=Add or Remove Security Constraint -Add_or_Remove_Environment_Variable_4=Add or Remove Environment Variable -Add_or_Remove_EJB_Reference_5=Add or Remove EJB Reference -Add_or_Remove_Resource_Reference_6=Add or Remove Resource Reference -Add_or_Remove_JSP_Tag_Library_7=Add or Remove JSP Tag Library -Add_or_Remove_Error_Page_8=Add or Remove Error Page -Add_or_Remove_Exception_Page_9=Add or Remove Exception Page -Add_or_Remove_Welcome_Page_10=Add or Remove Welcome Page -Add_or_Remove_Context_Parameter_11=Add or Remove Context Parameter -Add_or_Remove_Mime_Mapping_12=Add or Remove Mime Mapping -Add_or_Remove_Filter_13=Add or Remove Filter -Add_or_Remove_Listener_14=Add or Remove Listener -Add_or_Remove_Mime_Filter_15=Add or Remove Mime Filter -Add_or_Remove_File_Serving_Attribute_16=Add or Remove File Serving Attribute -Add_or_Remove_Invoker_Attribute_17=Add or Remove Invoker Attribute -Add_or_Remove_JSP_Attribute_18=Add or Remove JSP Attribute -Add_or_Remove_Servlet_Caching_Configuration_19=Add or Remove Servlet Caching Configuration -Read_Only_22=Read Only -Writable_23=Writable -Read_only_files____25=Read only files: -Web_Deployment_Descriptor_28=Web Deployment Descriptor -Environment_1=Environment -Environment_Variables_2=Environment Variables -Extensions_1=Extensions -Filters_1=Filters -Listeners_1=Listeners -Mime_1=Mime -Mime_Mappings_2=Mime Mappings -Overview_1=Overview -Pages_1=Pages -Parameters_1=Parameters -Context_Parameters_2=Context Parameters -References_1=References -References_2=References -EJB_references_3=EJB references -Resource_references_4=Resource references -JSP_tag_libraries_5=JSP tag libraries -Security_1=Security -Security_Roles_3=Security Roles -Security_Constraints_4=Security Constraints -Servlets_1=Servlets -Servlets_and_JSPs_2=Servlets and JSPs -Details_1=Details -Details_of_the_selected_environment_variable__2=Details of the selected environment variable: -Type__3=Type: -Value__13=Value: -Mime_Type_change_14=Mime Type change -Variables_1=Variables -The_following_environment_variables_are_relevant_to_this_web_application__2=The following environment variables are relevant to this web application: -(New_Variable)_3=(New Variable) -File_Serving_Attributes_1=File Serving Attributes -_Name_2=\ Name -_Value_3=\ Value -(name)_4=(name) -(value)_5=(value) -General_1=General -Reloading_enabled_2=Reloading enabled -Reload_interval__3=Reload interval: -Default_error_page__5=Default error page: -Additional_class_path__7=Additional class path: -File_serving_enabled_9=File serving enabled -Directory_browsing_enabled_10=Directory browsing enabled -Serve_servlets_by_classname_11=Serve servlets by classname -Precompile_JSPs_12=Precompile JSPs -Automatic_Request_Encoding_enabled_13=Automatic Request Encoding enabled -Automatic_Response_Encoding_enabled_14=Automatic Response Encoding enabled -Choose_a_Default_Error_Page_15=Choose a Default Error Page -Reload_Enabled_Changed_16=Reload Enabled Changed -File_Serving_Enabled_Changed_17=File Serving Enabled Changed -Directory_Browsing_Enabled_Changed_18=Directory Browsing Enabled Changed -Serve_Servlets_by_classname_Enabled_Changed_19=Serve Servlets by classname Enabled Changed -Precompile_JSPs_Enabled_Changed_20=Precompile JSPs Enabled Changed -Automatic_Request_Encoding_Enabled_Changed_21=Automatic Request Encoding Enabled Changed -Automatic_Response_Encoding_Enabled_Changed_22=Automatic Response Encoding Enabled Changed -Reload_Interval_25=Reload Interval -Default_Error_Page_26=Default Error Page -Additional_Classpath_27=Additional Classpath -Invoker_Attributes_1=Invoker Attributes -JSP_Attributes_1=JSP Attributes -MIME_Filters__1=MIME Filters -_Target_2=\ Target -_Type_3=\ Type -(target)_4=(target) -(type)_5=(type) -Servlet_Caching_Configurations_1=Servlet Caching Configurations -Details_of_the_selected_filter_2=Details of the selected filter -Filter_class__3=Filter class: -Display_name__5=Display name: -Filter_Type_Selection_7=Filter Type Selection -FilterItemProvider_UI_0=FilterName -Choose_a_Filter_Type_8=Choose a Filter Type -The_following_Filters_are_included_in_this_web_application__2=The following Filters are included in this web application: -Icons_1=Icons -The_following_icons_represent_the_selected_filter__2=The following icons represent the selected filter: -Initialization_1=Initialization -The_following_Filters_will_be_started_when_the_web_application_is_started__2=The following Filters will be started when the web application is started: -_Name_3=\ Name -_Value_4=\ Value -Delete_Filter_Init_Param_5=Delete Filter Init Param -(name)_6=(name) -(value)_7=(value) -New_Initialization_Parameter_8=New Initialization Parameter -Servlet_Mappings_2=Servlet Mappings -The_following_servlets_are_mapped_to_this_filter__3=The following servlets are mapped to this filter: -Delete_filter_mappings_4=Delete filter mappings -New_filter_mapping_5=New filter mapping -URL_Mappings_1=URL Mappings -The_following_URLs_are_mapped_to_this_filter__2=The following URLs are mapped to this filter: -Delete_filter_mappings_3=Delete filter mappings -New_filter_mapping_4=New filter mapping -Details_of_the_selected_listener_2=Details of the selected listener -Package__3=Package: -(default_package)_5=(default package) -Listeners_5=Listeners -The_following_Listeners_are_included_in_this_web_application__6=The following Listeners are included in this web application: -Listener_Type_Selection_10=Listener Type Selection -Choose_a_Listener_Type_11=Choose a Listener Type -Details_of_the_selected_file_extension__2=Details of the selected file extension: -Mime_type__3=Mime type: -Mime_Type_change_4=Mime Type change -File_Extensions_1=File Extensions -The_following_file_extensions_are_mapped_to_Mime_types__2=The following file extensions are mapped to Mime types: -Context_Parameters_1=Context Parameters -The_following_context_initialization_parameters_apply_to_all_servlets_in_this_web_application__2=The following context initialization parameters apply to all servlets in this web application: -Environment_Variables_1=Environment Variables -The_following_filters_are_used_in_this_application__2=The following filters are used in this application: -General_Information_1=General Information -Display_name__2=Display name: -Description__3=Description: -Session_time_out__4=Session time out: -Distributable_5=Distributable -Display_Name_6=Display Name -Description_7=Description -Icons_2=Icons -The_following_icons_represent_this_web_application__3=The following icons represent this web application: -The_following_listeners_are_used_in_this_application__2=The following listeners are used in this application: -Mime_Type_1=Mime Type -The_following_file_extensions_are_mapped_to_mime_types__2=The following file extensions are mapped to mime types: -This_web_application_uses_the_following_welcome_and_error_pages__2=This web application uses the following welcome and error pages: -This_web_application_references_the_following_resources__2=This web application references the following resources: -The_following_security_roles_and_constraints_are_defined_for_this_web_application__2=The following security roles and constraints are defined for this web application: -Servlets_and_JSPs_1=Servlets and JSPs -The_following_servlets_and_JSPs_are_used_in_this_application__2=The following servlets and JSPs are used in this application: -Usage_1=Usage -The_following_Enterprise_Applications_use_this_web_module__2=The following Enterprise Applications use this web module: -Error_Pages_1=Error Pages -Resources_in_the_following_URLs_will_be_accessed_in_response_to_HTTP_error_codes__2=Resources in the following URLs will be accessed in response to HTTP error codes: -_Error_Code_3=\ Error Code -_URL_4=\ URL -Java_Exception_Types_2=Java Exception Types -Resources_in_the_following_URLs_will_be_accessed_in_response_to_Java_exception_types__3=Resources in the following URLs will be accessed in response to Java exception types: -_Exception_Type_4=\ Exception Type -_URL_5=\ URL -Exception_Type_Selection_9=Exception Type Selection -Choose_an_Exception_Type_10=Choose an Exception Type -Login_1=Login -The_following_Login_configuration_values_are_used_for_this_web_application__2=The following Login configuration values are used for this web application: -Realm_name__3=Realm name: -Authentication_method__4=Authentication method: -Login_page__5=Login page: -Error_page__8=Error page: -Welcome_Pages_1=Welcome Pages -The_server_will_search_for_the_following_pages,_in_this_order,_when_the_web_application_is_referenced__2=The server will search for the following pages, in this order, when the web application is referenced: -The_following_context_parameters_are_included_in_this_web_application__2=The following context parameters are included in this web application: -Details_of_the_selected_context_parameter__2=Details of the selected context parameter: -Value__3=Value: -Context_Param_Value_change_4=Context Param Value change -WebSphere_Bindings_1=WebSphere Bindings -JNDI_Name__2=JNDI Name: -Ejb_Ref_JNDI_Name_change_3=Ejb Ref JNDI Name change -Details_of_the_selected_EJB_reference_2=Details of the selected EJB reference -Home__6=Home: -Remote__7=Remote: -Ejb_Ref_Home_change_8=Ejb Ref Home change -Ejb_Ref_Remote_change_9=Ejb Ref Remote change -EJB_Reference_Type_change_10=EJB Reference Type change -EJB_References_1=EJB References -The_following_EJB_references_are_used_in_this_web_application__2=The following EJB references are used in this web application: -JNDI_Name_3=JNDI Name -Details_of_the_selected_JSP_tag_library_2=Details of the selected JSP tag library -URI__3=URI: -Location__4=Location: -JSP_tag_library_location_change_5=JSP tag library location change -JSP_tag_library_URI_change_6=JSP tag library URI change -JSP_tag_libraries_1=JSP tag libraries -The_following_JSP_tag_libraries_are_used_in_this_web_application__2=The following JSP tag libraries are used in this web application: -Resource_Ref_JNDI_Name_change_3=Resource Ref JNDI Name change -Details_of_the_selected_resource_reference_2=Details of the selected resource reference -Authentication__4=Authentication: -Resource_Reference_Type_change_7=Resource Reference Type change -Resource_Reference_Authentication_change_10=Resource Reference Authentication change -Resource_References_1=Resource References -The_following_resource_references_are_used_in_this_web_application__2=The following resource references are used in this web application: -(New_ResourceRef)_3=(New ResourceRef) -JNDI_Name_4=JNDI Name -Authorized_Roles_2=Authorized Roles -The_following_roles_are_authorized_to_access_the_web_resource_collections_in_this_security_constraint__3=The following roles are authorized to access the web resource collections in this security constraint: -Security_Constraints_1=Security Constraints -These_constraints_prescribe_access_policies_for_specific_web_resources_2=These constraints prescribe access policies for specific web resources -User_Data_Constraint_1=User Data Constraint -The_following_are_the_transport_guarantees_required_between_client_and_server_for_the_security_constraint__2=The following are the transport guarantees required between client and server for the security constraint: -Web_Resource_Collections_1=Web Resource Collections -The_following_define_web_resources_and_their_HTTP_method_for_this_web_application__2=The following define web resources and their HTTP method for this web application: -Details_of_the_selected_security_role__2=Details of the selected security role: -Security_Roles_Description_change_5=Security Roles Description change -Security_Roles_1=Security Roles -The_following_security_roles_are_defined_for_this_web_application__2=The following security roles are defined for this web application: -Authorized_roles_2=Authorized roles -The_following_roles_are_authorized_to_access_this_servlet__3=The following roles are authorized to access this servlet: -Details_of_the_selected_servlet_or_JSP_2=Details of the selected servlet or JSP -Servlet_class__3=Servlet class: -WebSphere_Extensions_3=WebSphere Extensions -Optional_WebSphere_specific_extensions_to_the_Web_Deployment_Descriptor_4=Optional WebSphere specific extensions to the Web Deployment Descriptor -Unresolved_action__5=Unresolved action: -Servlet_Extension_Change_6=Servlet Extension Change -The_following_icons_represent_the_selected_servlet_or_JSP__3=The following icons represent the selected servlet or JSP: -The_following_URLs_are_mapped_to_this_servlet__2=The following URLs are mapped to this servlet: -The_following_servlets_and_JSPs_are_included_in_this_web_application__2=The following servlets and JSPs are included in this web application: -The_filterName_property_3=The filterName property -The_filter_property_2=The filter property -The_ListenerClass_property_2=The ListenerClass property -Details...=Details... -Load_on_startup_5=Load on startup -Load_order__6=Load order: -Delete_Servlet_Init_Param_7=Delete Servlet Init Param -(name)_8=(name) -(value)_9=(value) -New_Initialization_Parameter_10=New Initialization Parameter -Filter_mapping___1=Filter mapping: -SecurityConstraint_1=SecurityConstraint -The_following_initialization_parameters_are_configured_for_this_servlet__1=The following initialization parameters are configured for this servlet: -Filter_mapping_text=Filter mapping ({0} -> {1}) -Add_or_Remove_Resource_Environment_Reference_1=Add or Remove Resource Environment Reference -MIME_1=MIME -MIME_Mappings_2=MIME Mappings -Resource_Environment_1=Resource Environment -Automatic_Filter_Loading_enabled_1=Automatic Filter Loading enabled -Automatic_Filter_Loading_Enabled_Changed_4=Automatic Filter Loading Enabled Changed -The_following_servlets_have_this_filter_mapped_to_them_1=The following servlets have this filter mapped to them -The_following_URLs_have_this_filter_mapped_to_them_1=The following URLs have this filter mapped to them -MIME_type__1=MIME type: -MIME_Type_change_2=MIME Type change -The_following_file_extensions_are_mapped_to_MIME_types_1=The following file extensions are mapped to MIME types -Location_1=\ Location -Link__1=Link: -Ejb_Ref_Link_change_2=Ejb Ref Link change -Resource_Env_Ref_JNDI_Name_change_1=Resource Env Ref JNDI Name change -Details_of_the_selected_resource_environment_reference_1=Details of the selected resource environment reference -Type_Selection_2=Type Selection -Choose_a_type_3=Choose a type -Resource_Environment_References_1=Resource Environment References -The_following_resource_environment_references_are_used_in_this_web_application_2=The following resource environment references are used in this web application -New_ResourceEnvRef_3=New ResourceEnvRef -Add_Servlet_Extension_1=Add Servlet Extension -_ERROR_Problems_opening_editor_3=IWAE0026E Problems opening editor -_ERROR_JSP_file_does_not_exist_4=IWAE0027E JSP file does not exist -_ERROR_Problems_opening_editor_5=IWAE0028E Problems opening editor -_ERROR_Could_not_find_type_within_project_6=IWAE0029E Could not find type within project -_ERROR_Problems_opening_editor_7=IWAE0030E Problems opening editor -_ERROR_Problems_opening_editor_8=IWAE0031E Problems opening editor -Add_Variable_1=Add Variable -Edit_Variable_2=Edit Variable -Define_a_new_variable_in_this_servlet_caching_configuration_1=Define a new variable in this servlet caching configuration -Variable_2=Variable -ID__3=ID: -Type__4=Type: -Method__5=Method: -Data_ID__6=Data ID: -Invalid_ID__7=Invalid ID: -Required_8=Required -Add_External_Cache_Group_1=Add External Cache Group -Add_an_external_cache_group_to_this_servlet_caching_configuration_1=Add an external cache group to this servlet caching configuration -External_Cache_Group_2=External Cache Group -Group_Name__3=Group Name: -Group_Name_is_empty_5=Group Name is empty -Caching_group_name_is_empty_2=Caching group name is empty -Priority_must_be_an_integer_3=Priority must be an integer -Timeout_must_be_an_integer_4=Timeout must be an integer -Define_a_new_servlet_caching_configuration_1=Define a new servlet caching configuration -Servlet_Caching_Configuration_2=Servlet Caching Configuration -The_DefaultPage_property_2=The DefaultPage property -The_ErrorPage_property_4=The ErrorPage property -The_MimeType_property_6=The MimeType property -The_Name_property_8=The Name property -The_Pages_property_10=The Pages property -The_ExtendedServlet_property_2=The ExtendedServlet property -The_LocalTransaction_property_4=The LocalTransaction property -The_MarkupLanguage_property_6=The MarkupLanguage property -Define_Authorization_Constraint_1=Define Authorization Constraint -Choose_a_servlet__1=Choose a servlet: -Matching_servlets__2=Matching servlets: -Qualifier__3=Qualifier: -Add_or_Remove_EJB_Local_Reference_1=Add or Remove EJB Local Reference -Add_or_Remove_Markup_Language_2=Add or Remove Markup Language -Close_editor_3=Close editor -File_has_been_deleted_from_the_file_system._nWhat_would_you_like_to_do__4=File has been deleted from the file system.\nWhat would you like to do? -Save_and_close_editor_5=Save and close editor -Close_editor_6=Close editor -This_web.xml_file_is_not_a_valid_Deployment_Descriptor_for_a_Web_Archive,_hence_the_XML_editor_will_be_opened_7=This web.xml file is not a valid Deployment Descriptor for a Web Archive, hence the XML editor will be opened. -EJB_1=EJB -EJB_Local_2=EJB Local -Resource_3=Resource -Resource_Environment_1_4=Resource_Environment_1 -JSP_tag_libraries_5_5=JSP_tag_libraries_5 -Choose_a_filter__1=Choose a filter: -Matching_filters__2=Matching filters: -Choose_a_listener__1=Choose a listener: -Matching_listener__2=Matching listener: -Problems_opening_editor_2=Problems opening editor -application.xml_does_not_exist_3=application.xml does not exist -Refresh_4=Refresh -Details_of_the_selected_EJB_Local_reference_1=Details of the selected EJB Local reference -Local_home__2=Local home: -Local__3=Local: -EJB_Local_References_1=EJB Local References -The_following_EJB_local_references_are_used_in_this_web_application_2=The following EJB local references are used in this web application -(New_EJB_Local_Ref)_3=(New EJB Local Ref) -(New_ResourceEnvRef)_1=(New ResourceEnvRef) -Description__2=Description: -Description_change_3=Description change -Details_of_the_Servlet_Extension_of_the_selected_servlet_1=Details of the Servlet Extension of the selected servlet -Markup_Languages_2=Markup Languages -Local_Transaction_3=Local Transaction -Delete_Filter_Mapping_1=Delete Filter Mapping -Add_Filter_Mappings_2=Add Filter Mappings -Choose_a_JSP__1=Choose a JSP: -Name__2=Name: -MIME_type__3=MIME type: -Error_page__4=Error page: -Browse_5=Browse -Default_page__6=Default page: -Browse_7=Browse -Pages__8=Pages: -_Name_9=\ Name -_URI_10=\ URI -(Name)_11=(Name) -(URI)_12=(URI) -Name_is_empty_13=Name is empty -MIME_is_empty_14=MIME is empty -Define_a_new_markup_language_entry_1=Define a new markup language entry -Markup_Language_2=Markup Language -Choose_a_Page_1=Choose a Page -Description__1=Description: -Environment_variable_value_change_1=Environment variable value change -Environment_variable_description_change_2=Environment variable description change -Description_name_change_2=Description name change -Context_Param_Description_change_1=Context Param Description change -Ejb_Ref_Description_change_1=Ejb Ref Description change -Resource_Environment_Ref_Description_change_1=Resource Environment Ref Description change -Resource_Ref_Description_change_1=Resource Ref Description change -Details_of_the_selected_security_constraint_1=Details of the selected security constraint -Display_Name__2=Display Name: -Security_Constraint_DisplayName_change_3=Security Constraint DisplayName change -Empty_List_2=Empty List -_UI_Select_a_tag_library_to_add_to_the_deployment_descriptor_1=Select a tag library to add to the deployment descriptor -_UI_Add_a_Tag_Library_2=Add a Tag Library -_UI_Tag_Libraries__3=Tag Libraries: -_UI_Available_Custom_Tags__4=Available Custom Tags: -_UI__Tag_5=\ Tag -_UI__Description_6=\ Description -_UI_URI__7=URI: -_UI_Select_a_Tag_Library_8=Select a Tag Library -_UI_URI_cannot_be_empty_10=URI cannot be empty -Browse..._1=Browse... -Browse..._3=Browse... -Browse..._4=Browse... -Remove_Link_7=Remove Link -Home_interface_selection_8=Home interface selection -Local_interface_selection_13=Local interface selection -Choose_an_interface_16=Choose an interface -Matching_interfaces__17=Matching interfaces: -Set_EJB_Local_Ref_Link_18=Set EJB Local Ref Link -Remove_EJB_Local_Ref_Link_19=Remove EJB Local Ref Link -EJB_selection_3=EJB selection -Choose_an_EJB_4=Choose an EJB -Matching_EJBs__5=Matching EJBs: -Location__6=Location: -Empty_List_11=Empty List -Set_EJB_Ref_Link_8=Set EJB Ref Link -Remove_EJB_Ref_Link_9=Remove EJB Ref Link -Home_interface_selection_11=Home interface selection -Remote_interface_selection_14=Remote interface selection -Choose_an_interface_17=Choose an interface -Matching_interfaces__18=Matching interfaces: -Specify_an_Error_Code_and_Location_1=Specify an Error Code and Location -Specify_an_Exception_Type_and_Location_2=Specify an Exception Type and Location -Add_an_Error_Page_3=Add an Error Page -Error_Code__4=Error Code: -Exception_Type__5=Exception Type: -Select..._6=Select... -Browse..._7=Browse... -Location__8=Location: -Browse..._9=Browse... -Error_Code_is_empty_13=Error Code is empty -Exception_Type_is_empty_14=Exception Type is empty -Location_is_empty_16=Location is empty -Location_18=Location -Select_a_Page_19=Select a Page -Add_a_page_to_this_markup_language_1=Add a page to this markup language -Page_2=Page -Name__3=Name: -URI__4=URI: -Name_is_empty_8=Name is empty -URI_is_empty_10=URI is empty -Details_of_the_Servlet_Extension_for_the_selected_servlet_1=Details of the Servlet Extension for the selected servlet -Delete_Markup_Language_7=Delete Markup Language -Add_Markup_Language_entry_8=Add Markup Language entry -Edit_Markup_Language_entry_9=Edit Markup Language entry -The_name_property_1=The name property -The_URI_property_2=The URI property -Empty_List_1=Empty List -Web_Library_Projects_1=Web Library Projects -The_following_JARs_are_mapped_to_Java_projects__2=The following JARs are mapped to Java projects: -_JAR_Name_3=\ JAR Name -_Java_Project_4=\ Java Project -Error_5=Error -Add_Page_1=Add Page -Up_1=Up -Down_2=Down -Resource_Reference_Shareable_change_3=Resource Reference Shareable change -Environment_variable_type_change_1=Environment variable type change -WebSphere_Extensions_1=WebSphere Extensions -Browse..._2=Browse... -Remove_Page_3=Remove Page -Tag_Library_1=Tag Library -Create_Page_1=Create Page -Create_MarkupLanguage_1=Create MarkupLanguage -Add_or_Remove_Servlet_Extension_1=Add or Remove Servlet Extension -_INFO_No_security_roles_exist._1=IWAE0032I No security roles exist. -_INFO_No_Enterprise_Beans_which_implement_the_remote_interface_exist._1=IWAE0033I No Enterprise Beans which implement the remote interface exist. -_INFO_No_Enterprise_Beans_which_implement_the_local_interface_exist._2=IWAE0034I No Enterprise Beans which implement the local interface exist. -_INFO_No_servlets_exist_to_add._1=IWAE0035I No servlets exist to add. -_INFO_No_classes_which_implement_javax.servlet.Filter_exist._1=IWAE0037I No classes which implement javax.servlet.Filter exist. -_INFO_No_filters_exist_to_add._1=IWAE0038I No filters exist to add. -_INFO_No_listeners_exist_to_add._1=IWAE0039I No listeners exist to add. -_ERROR_Error_updating_Web_Properties_1=IWAE0040E Error updating Web Properties -_INFO_No_home_interfaces_exist._1=IWAE0041I No home interfaces exist. -_INFO_No_local_interfaces_exist._2=IWAE0042I No local interfaces exist. -_INFO_No_remote_interfaces_exist._2=IWAE0043I No remote interfaces exist. -_INFO_No_tag_libraries_exist_to_add._1=IWAE0044I No tag libraries exist to add. -_INFO_No_exceptions_exist_to_add._1=IWAE0045I No exceptions exist to add. -Add_Resource_Reference_Extension_3=Add Resource Reference Extension -Virtual_Host_Name__1=Virtual Host Name: -Connection_management__1=Connection management: -Isolation_level__2=Isolation level: -_Markup_Language_1=\ Markup Language -_Mime_Type_2=\ Mime Type -Boundary__3=Boundary: -Resolver__4=Resolver: -Unresolved_Action__5=Unresolved Action: -Select_an_Error_Code_1=Select an Error Code -Code_2=Code -Description_3=Description -*_denotes_error_code_new_to_HTTP_1.1_4=* denotes error code new to HTTP 1.1 -Continue*_6=Continue* -Switching_Protocols*_8=Switching Protocols* -OK_10=OK -Created_12=Created -Accepted_14=Accepted -Non-Authoritative_Information*_16=Non-Authoritative Information* -No_Content_18=No Content -Reset_Content*_20=Reset Content* -Partial_Content*_22=Partial Content* -Multiple_Choices_24=Multiple Choices -Moved_Permanently_26=Moved Permanently -Found_28=Found -See_Other*_30=See Other* -Not_Modified_32=Not Modified -Use_Proxy*_34=Use Proxy* -Temporary_Redirect*_36=Temporary Redirect* -Bad_Request_38=Bad Request -Unauthorized_40=Unauthorized -Forbidden_42=Forbidden -Not_Found_44=Not Found -Method_Not_Allowed*_46=Method Not Allowed* -Not_Acceptable*_48=Not Acceptable* -Proxy_Authentication_Required*_50=Proxy Authentication Required* -Request_Timeout*_52=Request Timeout* -Conflict*_54=Conflict* -Gone*_56=Gone* -Length_Required*_58=Length Required* -Precondition_Failed*_60=Precondition Failed* -Request_Entity_Too_Large*_62=Request Entity Too Large* -Request_URI_Too_Long*_64=Request URI Too Long* -Unsupported_Media_Type*_66=Unsupported Media Type* -Requested_Range_Not_Satisfiable*_68=Requested Range Not Satisfiable* -Expectation_Failed*_70=Expectation Failed* -Internal_Server_Error_72=Internal Server Error -Not_Implemented_74=Not Implemented -Bad_Gateway_76=Bad Gateway -Service_Unavailable_78=Service Unavailable -Gateway_Timeout*_80=Gateway Timeout* -HTTP_Version_Not_Supported*_82=HTTP Version Not Supported* -Choose_a_Servlet_1=Choose a Servlet -Unspecified_1=Unspecified -Sharing__1=Sharing: -Error_Page_1=Error Page -New_EJB_Ref=(New EJB Ref) -selectSR=Select a Security Role -Role_name=Role name -NoSR=No Security Roles exist. -RemoveUDC=Remove User Data Constraint -UDC_desc_change=User Data Constraint description changed -Run_As=Run As -detRunAs=Details of the selected servlet's run-as element -SR=Security role: -Select=Select... -Remove=Remove -RemoveRA=Remove run-as -SetRA=Set run-as -SetRN=Set role-name -SecurityRoleRefDialog.Security_Role_Ref=Security Role Ref -SecurityRoleRefDialog.Role_name=Role name: -SecurityRoleRefDialog.Role_link=Role link: -SecurityRoleRefDialog.Description=Description: -WebapplicationEditor.Add_or_Remove_Security_Role_Ref=Add or Remove Security Role Ref -Ser_AuthSection._Link=\ Link -Ser_AuthSection.Edit_Security_Role_Ref=Edit Security Role Ref -srr_header=Security Role References -srr_description=The following security role references are defined for this servlet: -Local_encoding_mapping_list_UI_=Locale Encoding Mapping List -local_encoding_mapping_UI_=Locale Encoding Mapping -_UI_JSPConfig_type=JSP Config -_UI_TagLibRefType_type=TagLibRefType -_UI_JSPPropertyGroup_type=JSPPropertyGroup -_UI_JSPPropertyGroup_urlPattern_feature=URL Pattern -_UI_JSPPropertyGroup_elIgnored_feature=El Ignored -_UI_JSPPropertyGroup_pageEncoding_feature=Page Encoding -_UI_JSPPropertyGroup_scriptingInvalid_feature=Scripting Invalid -_UI_JSPPropertyGroup_isXML_feature=Is XML -_UI_JSPPropertyGroup_includePreludes_feature=Include Preludes -_UI_JSPPropertyGroup_includeCodas_feature=Include Codas - - diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/AbstractTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/AbstractTaglibLocator.java deleted file mode 100644 index 20cbe4d8a..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/AbstractTaglibLocator.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.locator; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibLocator; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; - -import org.eclipse.jem.util.logger.proxy.Logger; - - -/** - * @version 1.0 - * @author - */ -public abstract class AbstractTaglibLocator implements ITaglibLocator { - protected IProject project; - static protected final ITaglibInfo[] EMPTY_TAGLIBINFO_ARRAY = new ITaglibInfo[0]; - - public AbstractTaglibLocator(IProject project) { - this.project = project; - } - - protected String calculateURIForFile(IPath projectRelativePath) { - IPath result = new Path("/"); //$NON-NLS-1$ - IPath serverRoot = getServerRoot(); - IPath filePath = projectRelativePath; - result = result.append(filePath.removeFirstSegments(serverRoot.segmentCount())); - return result.makeAbsolute().toString(); - } - - abstract protected IPath getServerRoot(); - - protected TLDDigester getTLDDigester(IFile tldFile) { - InputStream stream = null; - try { - stream = tldFile.getContents(); - return getTLDDigester(stream); - } catch (CoreException e) { - Logger.getLogger().log(e); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - Logger.getLogger().log(e); - } - } - } - return null; - } - - protected TLDDigester getTLDDigester(InputStream stream) { - TLDDigester digester = new TLDDigester(stream); - return digester; - } - - protected ITaglibInfo createTaglibForTLD(IFile file) { - TLDDigester digester = getTLDDigester(file); - try { - if (digester != null) { - if (isValidTLD(digester)) { - String uri = digester.getURI(); - if (uri != null) { - TaglibInfo taglibInfo = new TaglibInfo(this.project, uri, file.getProjectRelativePath()); - taglibInfo.setPrefix(digester.getShortName()); - taglibInfo.setIsURIFromTLD(true); - return taglibInfo; - } - } - } - } finally { - if (digester != null) - digester.close(); - } - return null; - } - - protected ITaglibInfo createTaglibForTLD(String uri, IPath file) { - return new TaglibInfo(this.project, uri, file); - } - - protected ITaglibInfo createTaglibForJar(String uri, IPath jarfile, IPath tldLocation) { - return new TaglibInfo(this.project, uri, jarfile, tldLocation); - } - - protected ITaglibInfo createTaglibForLibModuleJar(String uri, IPath jarfile, IResource tldFile) { - TaglibInfo taglibInfo = new TaglibInfo(tldFile.getProject(), uri, jarfile, tldFile.getProjectRelativePath()); - taglibInfo.setIsLibModule(true); - return taglibInfo; - } - - protected boolean hasJarExtension(IPath file) { - String extension = file.getFileExtension(); - if (extension != null) { - if (extension.equalsIgnoreCase("jar")) //$NON-NLS-1$ - return true; - if (extension.equalsIgnoreCase("zip")) //$NON-NLS-1$ - return true; - } - return false; - } - - - protected boolean hasJarExtension(String filename) { - return hasJarExtension(new Path(filename)); - } - - - protected boolean hasTLDExtension(IPath file) { - String extension = file.getFileExtension(); - if (extension != null && extension.equalsIgnoreCase("tld")) //$NON-NLS-1$ - return true; - return false; - } - - protected boolean hasTagExtension(String filename) { - return hasTagExtension(new Path(filename)); - } - - protected boolean hasTagExtension(IPath file) { - String extension = file.getFileExtension(); - if (extension != null && extension.equalsIgnoreCase("tag")) //$NON-NLS-1$ - return true; - return false; - } - - - protected boolean hasTLDExtension(String filename) { - return hasTLDExtension(filename); - } - - protected boolean isValidTLD(TLDDigester digester) { - return true; - } - - /* - * @see ITaglibLocator#search(IResource) - */ - public ITaglibInfo[] search(IResource resource) { - final ArrayList results = new ArrayList(); - - try { - resource.accept(new IResourceVisitor() { - public boolean visit(IResource aresource) throws CoreException { - if (aresource.getType() != IResource.FILE) { - if (aresource.getType() != IResource.ROOT && aresource.getProject() != AbstractTaglibLocator.this.project) - return false; - return true; - } - ITaglibInfo[] taglibs = searchFile((IFile) aresource); - if (taglibs != null) - results.addAll(Arrays.asList(taglibs)); - - return false; - } - }); - } catch (CoreException e) { - Logger.getLogger().log(e); - } - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - abstract protected ITaglibInfo[] searchFile(IFile file); - - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/AbstractWebTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/AbstractWebTaglibLocator.java deleted file mode 100644 index 048e54984..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/AbstractWebTaglibLocator.java +++ /dev/null @@ -1,286 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.locator; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.web.internal.operation.ILibModule; - -abstract public class AbstractWebTaglibLocator extends AbstractTaglibLocator { - /** - * Constructor for AbstractWebProjectTaglibLocator. - * - * @param project - */ - public AbstractWebTaglibLocator(IProject project) { - super(project); - } - - protected boolean isInLibFolder(IFile file) { - IContainer libFolder = WebPropertiesUtil.getWebLibFolder(project); - IPath libPath = libFolder.getProjectRelativePath(); - int numOfLibPathSegs = libPath.segmentCount(); - if (file.getProjectRelativePath().matchingFirstSegments(libPath) == numOfLibPathSegs) { - return true; - } - return false; - } - - protected boolean isTLDFile(IFile file) { - if (getJSPVersion()<J2EEVersionConstants.JSP_1_2_ID) - return hasTLDExtension(file.getProjectRelativePath()); - return isInWebInfFolder(file) && hasTLDExtension(file.getProjectRelativePath()); - } - - protected boolean isInWebInfFolder(IFile file) { - IPath webInfPath = getWebDeploymentDescriptorPath(); - int numOfWebInfPathSegs = webInfPath.segmentCount(); - if (file.getProjectRelativePath().matchingFirstSegments(webInfPath) == numOfWebInfPathSegs) - return true; - return false; - } - - protected boolean isTaglibJar(IFile file) { - return isInLibFolder(file) && hasJarExtension(file.getProjectRelativePath()); - } - - protected boolean isTaglibTLD(String filename) { - if (filename != null) { - if (filename.equalsIgnoreCase(IWebNatureConstants.META_INFO_DIRECTORY + "/taglib.tld")) //$NON-NLS-1$ - return true; - } - return false; - } - - protected ZipEntry[] findTLDEntriesInZip(ZipFile zFile) { - Enumeration entries = zFile.entries(); - ArrayList results = new ArrayList(); - - while (entries.hasMoreElements()) { - ZipEntry entry = (ZipEntry) entries.nextElement(); - if (!entry.isDirectory()) { - // Look for the first .tld file found in the META-INF directory. - IPath entryPath = new Path(entry.getName()); - if (isValidTLDJarPath(entryPath)) - results.add(entry); - } - } - - return (ZipEntry[]) results.toArray(new ZipEntry[results.size()]); - } - - protected TLDDigester getTLDDigester(IFile jarFile, IPath jarRelativePath) { - InputStream stream = null; - TLDDigester digester = null; - try { - ZipFile zFile = new ZipFile(jarFile.getLocation().toFile()); - ZipEntry[] entries = findTLDEntriesInZip(zFile); - if (entries != null) { - for (int i = 0; i < entries.length; i++) { - ZipEntry entry = entries[i]; - if (entry.getName().equalsIgnoreCase(jarRelativePath.toString())) { - stream = zFile.getInputStream(entry); - break; - } - } - if (stream != null) - digester = getTLDDigester(stream); - } - } catch (Exception e) { - Logger.getLogger().log(e); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - Logger.getLogger().log(e); - } - } - } - return digester; - } - - protected boolean isValidTLD(TLDDigester digester) { - if (digester == null || !super.isValidTLD(digester)) - return false; - int JSPVersion = getJSPVersion(); - // JSP 1.2 TLDs are not allowed in JSP 1.1 projects - if (JSPVersion==J2EEVersionConstants.JSP_1_1_ID && (digester.getJSPLevel() == null || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_1_1_TEXT))) - return false; - // JSP 2.0 TLDs are not allowed in JSP 1.2 projects - if (JSPVersion==J2EEVersionConstants.JSP_1_2_ID && (digester.getJSPLevel() == null || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_1_2_TEXT) || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_1_1_TEXT))) - return false; - // JSP 2.0 TLDs are allowed in JSP 2.0 projects only - if (JSPVersion==J2EEVersionConstants.JSP_2_0_ID && (digester.getJSPLevel() == null || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_2_0_TEXT) || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_1_2_TEXT) || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_1_1_TEXT))) - return false; - return true; - } - - protected boolean isValidTLDJarPath(IPath path) { - int JSPVersion = getJSPVersion(); - if (JSPVersion==J2EEVersionConstants.JSP_1_2_ID || JSPVersion==J2EEVersionConstants.JSP_2_0_ID) { - if (!hasTLDExtension(path)) - return false; - if (!(path.matchingFirstSegments(new Path("META-INF")) > 0)) //$NON-NLS-1$ - return false; - } else { - if (!path.equals(new Path("META-INF/taglib.tld"))) //$NON-NLS-1$ - return false; - } - return true; - } - - protected ITaglibInfo[] searchJarFile(IFile jarFile) { - return searchJarFile(null, jarFile.getLocation().toFile(), jarFile.getProjectRelativePath()); - } - - protected ITaglibInfo[] searchJarFile(File jarFile) { - return searchJarFile(null, jarFile, new Path(jarFile.getAbsolutePath())); - } - - protected ITaglibInfo[] searchJarFile(String uri, File jarFile, IPath projectRelativePath) { - - ArrayList results = new ArrayList(); - ZipFile zFile = null; - try { - // Need to check if the jar file has a .tld file anywhere under the - // META-INF directory. If there is, add a taglib for the uri that - // is inside the TLD file. - zFile = new ZipFile(jarFile); - ZipEntry[] entries = findTLDEntriesInZip(zFile); - - for (int i = 0; i < entries.length; i++) { - ZipEntry entry = entries[i]; - if (entry != null) { - // most entries can be skipped this way - if (entry.getName() == null || !entry.getName().toLowerCase().endsWith("tld")) //$NON-NLS-1$ - continue; - TLDDigester digester = getTLDDigester(zFile.getInputStream(entry)); - IPath entryPath = new Path(entry.getName()); - int JSPVersion = getJSPVersion(); - if (JSPVersion==J2EEVersionConstants.JSP_1_2_ID || JSPVersion==J2EEVersionConstants.JSP_2_0_ID) { - String tURI = uri; - if (uri == null) { - tURI = digester.getURI(); - } - - // If a uri is found, add a taglib for the uri - if (tURI != null) { - ITaglibInfo taglib = createTaglibForJar(tURI, projectRelativePath, entryPath); - ((TaglibInfo) taglib).setIsURIFromTLD(true); - ((TaglibInfo) taglib).setPrefix(digester); - results.add(taglib); - } - } - - if (isTaglibTLD(entryPath.toString())) { - boolean canAddTaglibTLD = canAddTaglibTld(digester); - if (canAddTaglibTLD) { - ITaglibInfo taglib = createTaglibForJar(calculateURIForFile(projectRelativePath), projectRelativePath, entryPath); - ((TaglibInfo) taglib).setPrefix(digester); - results.add(taglib); - } - } - if (digester != null) - digester.close(); - } - } - } catch (ZipException e) { - Logger.getLogger().logError(e); - } catch (IOException e) { - Logger.getLogger().logError(e); - } finally { - if (zFile != null) { - try { - zFile.close(); - } catch (IOException e) { - //Do nothing - } - } - } - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - /** - * @return - */ - protected boolean canAddTaglibTld(TLDDigester digester) { - return isValidTLD(digester); - } - - protected int getJSPVersion() { - WebArtifactEdit webEdit = null; - int JSPVersion = 0; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - JSPVersion = webEdit.getJSPVersion(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return JSPVersion; - } - - protected ILibModule[] getLibModules() { - //TODO this will throw classcastexception, do we use ILibModule anymore? - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit != null) - return (ILibModule[])webEdit.getLibModules(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return new ILibModule[] {}; - } - - /** - * @see AbstractTaglibLocator#getServerRoot() - */ - protected IPath getServerRoot() { - return getModuleServerRoot().getProjectRelativePath(); - } - - protected IContainer getModuleServerRoot() { - return WebPropertiesUtil.getModuleServerRoot(project); - } - - protected IPath getWebDeploymentDescriptorPath() { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - return webEdit.getDeploymentDescriptorPath(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/JavaProjectTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/JavaProjectTaglibLocator.java deleted file mode 100644 index ddc287472..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/JavaProjectTaglibLocator.java +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.locator; - -import java.util.ArrayList; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; - - -public class JavaProjectTaglibLocator extends AbstractTaglibLocator { - protected IJavaProject javaProject; - protected IPath metaInfPath; - - /** - * Constructor for JavaProjectTaglibLocator. - * - * @param project - */ - public JavaProjectTaglibLocator(IProject project) { - super(project); - } - - protected boolean isTLDFile(IFile file) { - return isInMetaInfFolder(file) && hasTLDExtension(file.getProjectRelativePath()); - } - - protected boolean isTaglibTLD(IFile tldFile) { - return isTLDFile(tldFile) && tldFile.getProjectRelativePath().lastSegment().equalsIgnoreCase("taglib.tld"); //$NON-NLS-1$ - } - - protected boolean isInMetaInfFolder(IFile file) { - this.metaInfPath = getMetaInfPath(); - if (file.getFullPath().matchingFirstSegments(this.metaInfPath) >= 1) { - return true; - } - return false; - } - - protected IPath getMetaInfPath() { - if (this.metaInfPath == null) { - try { - this.metaInfPath = getJavaProject().getOutputLocation(); - this.metaInfPath = this.metaInfPath.append(J2EEConstants.META_INF); - } catch (JavaModelException e) { - this.metaInfPath = new Path("/"); //$NON-NLS-1$ - } - } - return this.metaInfPath; - } - - /** - * @see AbstractTaglibLocator#searchFile(IFile) - */ - protected ITaglibInfo[] searchFile(IFile file) { - if (isTLDFile(file)) { - return searchTLDFile(file); - } - return EMPTY_TAGLIBINFO_ARRAY; - } - - protected IJavaProject getJavaProject() { - if (this.javaProject == null) - this.javaProject = JavaCore.create(this.project); - return this.javaProject; - } - - /** - * @see AbstractTaglibLocator#getServerRoot() - */ - protected IPath getServerRoot() { - try { - return getJavaProject().getOutputLocation(); - } catch (JavaModelException e) { - //Do nothing - } - return new Path("/"); //$NON-NLS-1$ - } - - protected ITaglibInfo[] searchTLDFile(IFile file) { - ArrayList results = new ArrayList(2); - TLDDigester digester = null; - try { - // Add a taglib for the uri in the tld file. - digester = getTLDDigester(file); - ITaglibInfo taglib = createTaglibForTLD(file); - if (taglib != null) { - ((TaglibInfo) taglib).setPrefix(digester); - results.add(taglib); - } - - - // Create a URI based on the file location in the project - if (isTaglibTLD(file)) { - taglib = createTaglibForTLD(calculateURIForFile(file.getProjectRelativePath()), file.getProjectRelativePath()); - if (taglib != null) { - ((TaglibInfo) taglib).setPrefix(digester); - results.add(taglib); - } - } - - } finally { - if (digester != null) - digester.close(); - } - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebLibModuleTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebLibModuleTaglibLocator.java deleted file mode 100644 index e7fa5fb80..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebLibModuleTaglibLocator.java +++ /dev/null @@ -1,166 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.locator; - -import java.io.IOException; -import java.util.List; -import java.util.Vector; -import java.util.zip.ZipException; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibRegistry; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; -import org.eclipse.wst.web.internal.operation.ILibModule; - -/** - * @version 1.0 - * @author - */ -public class WebLibModuleTaglibLocator extends AbstractWebTaglibLocator { - - public WebLibModuleTaglibLocator(IProject project) { - super(project); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.AbstractTaglibLocator#search(org.eclipse.core.resources.IResource) - */ - public ITaglibInfo[] search(IResource resource) { - List libModuleTaglibs = calculateLibModuleTaglibs(); - return (ITaglibInfo[]) libModuleTaglibs.toArray(new ITaglibInfo[libModuleTaglibs.size()]); - } - - protected List calculateLibModuleTaglibs() { - // Check to see if there are any lib modules, if so, we must check to see - // if there are any taglibs in these and concat the results. - - ILibModule[] libModules = getLibModules(); - Vector results = new Vector(); - - // Go through all of the library modules and add any taglibs - // from the java projects they map to. - boolean addedJar = false; - - for (int i = 0; i < libModules.length; i++) { - ILibModule iLibModule = libModules[i]; - IProject prj = iLibModule.getProject(); - ITaglibRegistry registry = WebPlugin.getDefault().getTaglibRegistryManager().getTaglibRegistry(prj); - if (registry != null) { // CMVC defect 221661, Web library project being closed - ITaglibInfo[] javaTaglibs = registry.getTaglibs(); - - // Need to go through the java taglibs and change them to the appropriate - for (int j = 0; j < javaTaglibs.length; j++) { - ITaglibInfo iTaglibInfo = javaTaglibs[j]; - if (iTaglibInfo.isInJar()) - break; - // defect 212671 - IPath webProjectRelativePath = WebPropertiesUtil.getWebLibFolder(project).getProjectRelativePath(); - IPath jarLocationPath = webProjectRelativePath.append(iLibModule.getJarName()); - IPath jarName = jarLocationPath.removeFirstSegments(getServerRoot().segmentCount()); - // defect 212671 This is important because jarName may not have a leading / - IPath jarURI = new Path("/"); //$NON-NLS-1$ - jarURI = jarURI.append(jarName); - int JSPVersion = getJSPVersion(); - if (iTaglibInfo.isURIFromTLD()) { - if (JSPVersion==J2EEVersionConstants.JSP_1_2_ID || JSPVersion==J2EEVersionConstants.JSP_2_0_ID) { - TaglibInfo newTaglib = new TaglibInfo(prj, iTaglibInfo.getURI(), jarLocationPath, iTaglibInfo.getTLDLocation()); - newTaglib.setIsLibModule(true); - newTaglib.setIsURIFromTLD(true); - results.add(newTaglib); - } - } - // Add a taglib entry for the jar file if it contains a taglib.tld file. - if (!addedJar && isTaglibTLD(iTaglibInfo.getTLDLocation())) { - // Direct references can be made no matter what the JSP Level - TaglibInfo newTaglib = new TaglibInfo(prj, jarURI.toString(), jarLocationPath, iTaglibInfo.getTLDLocation()); - newTaglib.setIsLibModule(true); - // defect 212671 - newTaglib.setIsURIFromTLD(false); - boolean canAddTaglibTLD = true; - if (JSPVersion==J2EEVersionConstants.JSP_1_1_ID) { // this clause is for performance, get digester only for jsp 1.1 - try { - TLDDigester digester = new TLDDigester(newTaglib.getTLDStream()); - if (digester.getJSPLevel() == null || !digester.getJSPLevel().equals(J2EEVersionConstants.VERSION_1_1_TEXT)) - // If JSP1.1 then tld better be 1.1 defect CMVC 217548 - canAddTaglibTLD = false; - } catch (ZipException e) { - // Do nothing - } catch (IOException e) { - // Do nothing - } catch (CoreException e) { - // Do nothing - } - } else if (JSPVersion==J2EEVersionConstants.JSP_1_2_ID) { // this clause is for performance, get digester only for jsp 1.1 - try { - TLDDigester digester = new TLDDigester(newTaglib.getTLDStream()); - String digesterJSPLevel = digester.getJSPLevel(); - - if (digesterJSPLevel == null || !digesterJSPLevel.equals(J2EEVersionConstants.VERSION_1_2_TEXT) || !digesterJSPLevel.equals(J2EEVersionConstants.VERSION_1_1_TEXT))// If JSP2.0 then tld better be 1.1 or 1.2 and not 2.0 defect CMVC 217548 - canAddTaglibTLD = false; - } catch (ZipException e) { - //do nothing - } catch (IOException e) { - //Do nothing - } catch (CoreException e) { - //Do nothing - } - } else if (JSPVersion==J2EEVersionConstants.JSP_2_0_ID) { // this clause is for performance, get digester only for jsp 1.1 - try { - TLDDigester digester = new TLDDigester(newTaglib.getTLDStream()); - String digesterJSPLevel = digester.getJSPLevel(); - if (digesterJSPLevel == null || !digesterJSPLevel.equals(J2EEVersionConstants.VERSION_2_0_TEXT) || !digesterJSPLevel.equals(J2EEVersionConstants.VERSION_1_2_TEXT) - || !digesterJSPLevel.equals(J2EEVersionConstants.VERSION_1_1_TEXT))// If JSP2.0 then tld better be 1.1 or 1.2 and not 2.0 defect CMVC 217548 - canAddTaglibTLD = false; - } catch (ZipException e) { - //Do nothing - } catch (IOException e) { - //Do nothing - } catch (CoreException e) { - //Do nothing - } - } - if (canAddTaglibTLD) - results.add(newTaglib); - addedJar = true; // no matter whether we added the entry or not we cannot add any other entry either. - } - } - } - } - return results; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.AbstractTaglibLocator#searchFile(org.eclipse.core.resources.IFile) - */ - protected ITaglibInfo[] searchFile(IFile file) { - // do nothing - return new ITaglibInfo[0]; - } - - protected boolean isTaglibTLD(IPath tldPath) { - return tldPath.lastSegment().equalsIgnoreCase("taglib.tld"); //$NON-NLS-1$ - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebProjectServerTargetTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebProjectServerTargetTaglibLocator.java deleted file mode 100644 index 016899723..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebProjectServerTargetTaglibLocator.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 15, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.locator; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.web.operations.ServerTargetUtil; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.ServerJarsUtil; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; -import org.eclipse.wst.server.core.IRuntime; - -/** - * @author admin - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public class WebProjectServerTargetTaglibLocator extends AbstractWebTaglibLocator { - - private List serverTaglibs; - private IRuntime runtime; - - /** - * @param project - */ - public WebProjectServerTargetTaglibLocator(IProject project) { - super(project); - this.serverTaglibs = new ArrayList(2); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.AbstractTaglibLocator#search(org.eclipse.core.resources.IResource) - */ - public ITaglibInfo[] search(IResource resource) { - // ignore resource calculate server target taglibs - IRuntime newRuntime = ServerTargetUtil.getServerTarget(this.project.getName()); - if (this.runtime != newRuntime) { - try { - // TODO right now only v6 server contributes taglibs, if more servers are added need - // to determine that - if (ServerJarsUtil.isTargetedAtWASV6(newRuntime)) { - this.serverTaglibs = calculateServerTargetTaglibs(); - } else - this.serverTaglibs.clear(); - - } catch (Throwable e) { - e.printStackTrace(); - } finally { - this.runtime = newRuntime; - } - } - return (ITaglibInfo[]) this.serverTaglibs.toArray(new ITaglibInfo[this.serverTaglibs.size()]); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.AbstractTaglibLocator#searchFile(org.eclipse.core.resources.IFile) - */ - protected ITaglibInfo[] searchFile(File file) { - if (hasJarExtension(file.getName())) { - return searchJarFile(file); - } - return EMPTY_TAGLIBINFO_ARRAY; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.AbstractTaglibLocator#searchFile(org.eclipse.core.resources.IFile) - */ - protected ITaglibInfo[] searchFile(IFile file) { - // do nothing - return null; - } - - /** - * @return - */ - protected List calculateServerTargetTaglibs() { - IPath serverJars[] = ServerJarsUtil.getServerJars(this.project); - List serverTaglibList = new ArrayList(); - for (int i = 0; i < serverJars.length; i++) { - IPath path = serverJars[i]; - serverTaglibList.addAll(Arrays.asList(searchFile(path.toFile()))); - } - return serverTaglibList; - } - - protected ITaglibInfo createTaglibForJar(String uri, IPath jarfile, IPath tldLocation) { - TaglibInfo info = (TaglibInfo) super.createTaglibForJar(uri, jarfile, tldLocation); - info.setServerContribution(true); - return info; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.locator.AbstractWebTaglibLocator#canAddTaglibTld(org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.TLDDigester) - */ - protected boolean canAddTaglibTld(TLDDigester digester) { - // as this is a server contributed entry - return false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebProjectTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebProjectTaglibLocator.java deleted file mode 100644 index 6350bf4fa..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebProjectTaglibLocator.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.locator; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.web.taglib.DirTaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; - -import org.eclipse.jem.util.logger.proxy.Logger; - -/** - * @version 1.0 - * @author - */ -public class WebProjectTaglibLocator extends AbstractWebTaglibLocator { - public WebProjectTaglibLocator(IProject project) { - super(project); - } - - protected ITaglibInfo[] searchFile(IFile file) { - if (isTaglibJar(file)) { - return searchJarFile(file); - } else if (isTLDFile(file)) { - return searchTLDFile(file); - } - return EMPTY_TAGLIBINFO_ARRAY; - } - - protected ITaglibInfo[] searchDir(IContainer container) { - // File containerDir = container.getLocation().toFile(); - // if(containerDir.isDirectory()){ - // File tldFiles[] = containerDir.listFiles(new FileFilter() { - // public boolean accept(File pathname) { - // return (!pathname.isDirectory() && ((new Path(pathname - // .getName()).getFileExtension() - // .equalsIgnoreCase("tld")))); - // } - // }); - // if (tldFiles == null || tldFiles.length == 0) { - File tagFiles[] = container.getLocation().toFile().listFiles(new FileFilter() { - public boolean accept(File pathname) { - return (!pathname.isDirectory() && ((new Path(pathname.getName()).getFileExtension().equalsIgnoreCase("tag")))); //$NON-NLS-1$ - } - }); - if (tagFiles != null && tagFiles.length > 0) { - ITaglibInfo taglib = createTaglibForDir(container, tagFiles); - - if (taglib != null) - return new ITaglibInfo[]{taglib}; - } - // } - // } - return EMPTY_TAGLIBINFO_ARRAY; - } - - - /** - * @param container - * @param tagFiles - * @return - */ - private ITaglibInfo createTaglibForDir(IContainer container, File[] tagFiles) { - String uri = calculateURIForFile(container.getProjectRelativePath()); - - - - DirTaglibInfo dirTaglibInfo = new DirTaglibInfo(container, uri, container.getProjectRelativePath()); - - dirTaglibInfo.setPrefix(calculateShortNameForTaglib(uri)); - - return dirTaglibInfo; - } - - /** - * @param uri - * @return - */ - private String calculateShortNameForTaglib(String uri) { - uri = uri.replace('\\', '/'); - if (uri.equalsIgnoreCase("/WEB-INF/tags")) //$NON-NLS-1$ - return "tags"; //$NON-NLS-1$ - - - String suffixOfURI = uri.substring("/WEB-INF/tags/".length()); //$NON-NLS-1$ - suffixOfURI = suffixOfURI.replace('/', '-'); - suffixOfURI = suffixOfURI.replace('\\', '-'); - - return suffixOfURI; - - } - - protected ITaglibInfo[] searchTLDFile(IFile file) { - ArrayList results = new ArrayList(2); - - // Even though the spec says auto-discover should work for loose tld's, both websphere & - // tomcat dont do it hence - // it is commented - // // Add a taglib for the uri in the tld file. - // if (getWebNature().isJSP1_2() && isInWebInfFolder(file)) { - // ITaglibInfo taglib = createTaglibForTLD(file); - // if (taglib != null) - // results.add(taglib); - // } - - // Create a URI based on the file location in the project - //TLDDigester - boolean canAddTaglibTLD = true; - TLDDigester digester = getTLDDigester(file); - - if (!isValidTLD(digester))// If JSP1.1 then taglib.tld better be 1.1 defect CMVC 217548 - canAddTaglibTLD = false; - - if (canAddTaglibTLD) { - ITaglibInfo taglib = createTaglibForTLD(calculateURIForFile(file.getProjectRelativePath()), file.getProjectRelativePath()); - ((TaglibInfo) taglib).setPrefix(digester); - if (taglib != null) - results.add(taglib); - } - if (digester != null) - digester.close(); - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - - /* - * @see ITaglibLocator#search(IResource) - */ - public ITaglibInfo[] search(IResource resource) { - final ArrayList results = new ArrayList(); - - try { - resource.accept(new IResourceVisitor() { - public boolean visit(IResource aresource) throws CoreException { - int JSPVersion = getJSPVersion(); - if (aresource.getType() != IResource.FILE) { - if (aresource.getType() != IResource.ROOT && WebProjectTaglibLocator.this.project != aresource.getProject()) - return false; - if (JSPVersion==J2EEVersionConstants.JSP_2_0_ID) { - ITaglibInfo[] taglibs = searchDir((IContainer) aresource); - if (taglibs != null) - results.addAll(Arrays.asList(taglibs)); - return true; - } - // directory taglibs are only in jsp 2.0 - return false; - - } - - if (hasTagExtension(aresource.getName())) { - if (JSPVersion==J2EEVersionConstants.JSP_2_0_ID) { - ITaglibInfo[] taglibs = searchDir(aresource.getParent()); - if (taglibs != null) - results.addAll(Arrays.asList(taglibs)); - } - } else { - ITaglibInfo[] taglibs = searchFile((IFile) aresource); - if (taglibs != null) - results.addAll(Arrays.asList(taglibs)); - } - - return false; - } - }); - } catch (CoreException e) { - Logger.getLogger().log(e); - } - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebXMLTaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebXMLTaglibLocator.java deleted file mode 100644 index 2947a0e42..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/locator/WebXMLTaglibLocator.java +++ /dev/null @@ -1,333 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.locator; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.TLDDigester; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.WebXMLTaglibInfo; -import org.eclipse.jst.j2ee.jsp.JSPConfig; -import org.eclipse.jst.j2ee.jsp.TagLibRefType; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.TagLibRef; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.web.internal.operation.ILibModule; - -/** - * @version 1.0 - * @author - */ -public class WebXMLTaglibLocator extends AbstractWebTaglibLocator { - - public WebXMLTaglibLocator(IProject project) { - super(project); - } - - protected ILibModule findLibModule(String jarFile) { - String fileName = new Path(jarFile).lastSegment(); - ILibModule[] libModules = getLibModules(); - for (int i = 0; i < libModules.length; i++) { - ILibModule iLibModule = libModules[i]; - if (iLibModule.getJarName().equals(fileName)) - return iLibModule; - } - return null; - } - - protected IFile findWebAppRelativeFile(IPath path) { - if (path != null) { - IResource resource = getModuleServerRoot().findMember(path); - if (resource != null && resource.getType() == IResource.FILE) - return (IFile) resource; - } - return null; - } - - protected IPath[] findTLDsInJar(IFile jarFile) { - ZipFile zFile = null; - IPath[] results = new IPath[0]; - - try { - zFile = new ZipFile(jarFile.getLocation().toFile()); - ZipEntry[] entries = findTLDEntriesInZip(zFile); - results = new IPath[entries.length]; - for (int i = 0; i < entries.length; i++) { - ZipEntry entry = entries[i]; - results[i] = new Path(entry.getName()); - } - } catch (ZipException e) { - //Do nothing - } catch (IOException e) { - //Do nothing - } finally { - if (zFile != null) { - try { - zFile.close(); - } catch (IOException e) { - //Do nothing - } - } - } - return results; - } - - /* - * @see ITaglibLocator#search(IResource) - */ - public ITaglibInfo[] searchFile(IFile file) { - // This locator only looks at web.xml files. - if (!getWebDeploymentDescriptorPath().equals(file.getFullPath())) - return EMPTY_TAGLIBINFO_ARRAY; - - ArrayList results = new ArrayList(); - WebArtifactEdit webEdit = null; - try { - WebApp webApp = null; - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit != null) - webApp = (WebApp) webEdit.getDeploymentDescriptorRoot(); - - if (webApp == null) - return EMPTY_TAGLIBINFO_ARRAY; - - List taglibs = new ArrayList(); - if (webApp.getVersionID() >= J2EEVersionConstants.WEB_2_4_ID) { - JSPConfig config = webApp.getJspConfig(); - if (config != null) - taglibs = config.getTagLibs(); - } else { - taglibs = webApp.getTagLibs(); - } - - for (Iterator iter = taglibs.iterator(); iter.hasNext();) { - TagLibRef taglibRef13; - TagLibRefType taglibRef14; - String uri; - String taglibLocation; - if (webApp.getVersionID() >= J2EEVersionConstants.WEB_2_4_ID) { - taglibRef14 = (TagLibRefType) iter.next(); - uri = taglibRef14.getTaglibURI(); - taglibLocation = taglibRef14.getTaglibLocation(); - } else { - taglibRef13 = (TagLibRef) iter.next(); - uri = taglibRef13.getTaglibURI(); - taglibLocation = taglibRef13.getTaglibLocation(); - } - - IPath projectRelativeLocation = new Path(taglibLocation); - IPath webModuleRelativeLocation = getWebAppRelativePath(taglibLocation); - if (webModuleRelativeLocation != null) { - projectRelativeLocation = getServerRoot().append(webModuleRelativeLocation); - } - WebXMLTaglibInfo taglibInfo = null; - IFile locationFile = findWebAppRelativeFile(webModuleRelativeLocation); - boolean isLocationResolved = true; - if (hasJarExtension(taglibLocation)) { - if (locationFile == null) { - // If the location file is null it means that the file could not - // be found in this project, check to see if it is referencing - // a TLD in a lib module - IResource resource = findLibModuleRelativeFile(webModuleRelativeLocation); - if (resource == null || !resource.exists()) { - // Go ahead and create an entry which cannot be resolved - // Only the /META-INF/taglib.tld file can be specified in web.xml - isLocationResolved = false; - taglibInfo = (WebXMLTaglibInfo) createTaglibForJar(uri, projectRelativeLocation, new Path("META-INF/taglib.tld")); //$NON-NLS-1$ - } else { - locationFile = (IFile) resource; - taglibInfo = (WebXMLTaglibInfo) createTaglibForLibModuleJar(uri, projectRelativeLocation, resource); - setPrefix(taglibInfo, locationFile); - } - } else { - isLocationResolved = true; - // Only the /META-INF/taglib.tld file can be specified in web.xml - taglibInfo = (WebXMLTaglibInfo) createTaglibForJar(uri, projectRelativeLocation, new Path("META-INF/taglib.tld")); //$NON-NLS-1$ - setPrefix(taglibInfo, locationFile); - } - } else { - if (locationFile == null) - isLocationResolved = false; - taglibInfo = (WebXMLTaglibInfo) createTaglibForTLD(uri, projectRelativeLocation); - setPrefix(taglibInfo, locationFile); - - } - if (taglibInfo != null) { - taglibInfo.setIsWebXMLEntry(true); - taglibInfo.setWebXMLLocation(new Path(taglibLocation)); - taglibInfo.setIsLocationResolved(isLocationResolved); - // If the location cannot be resolved, set the taglibInfo to be invalid - if (!isLocationResolved) - taglibInfo.setIsValid(false); - results.add(taglibInfo); - } - } - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - /** - * This method retrieves the short-name from the tld file and adds it as a prefix to the - * ITaglibInfo entry - * - * @param taglibInfo - * @param locationFile - */ - private void setPrefix(ITaglibInfo taglibInfo, IFile locationFile) { - if (locationFile != null && locationFile.exists()) { - TLDDigester digester = null; - try { - if (isTaglibJar(locationFile)) { - digester = getTLDDigester(locationFile, new Path("META-INF/taglib.tld")); //$NON-NLS-1$ - ((TaglibInfo) taglibInfo).setPrefix(digester); - } else if (hasTLDExtension(locationFile.getFullPath())) { - digester = getTLDDigester(locationFile); - ((TaglibInfo) taglibInfo).setPrefix(digester); - } - } finally { - if (digester != null) - digester.close(); - } - } - } - - protected ITaglibInfo createTaglibForTLD(String uri, IPath file) { - return new WebXMLTaglibInfo(this.project, uri, file); - } - - protected ITaglibInfo createTaglibForJar(String uri, IPath jarfile, IPath tldLocation) { - WebXMLTaglibInfo taglibInfo = new WebXMLTaglibInfo(this.project, uri, jarfile, tldLocation); - return taglibInfo; - } - - - protected ITaglibInfo createTaglibForLibModuleJar(String uri, IPath jarfile, IResource tldFile) { - WebXMLTaglibInfo taglibInfo = new WebXMLTaglibInfo(tldFile.getProject(), uri, jarfile, tldFile.getProjectRelativePath()); - taglibInfo.setIsLibModule(true); - return taglibInfo; - } - - - /** - * Method findLibModuleRelativeFile. - * - * @param location - * @return String - */ - private IResource findLibModuleRelativeFile(IPath location) { - if (location != null) { - ILibModule libModule = findLibModule(location.lastSegment()); - if (libModule != null) { - IProject tProject = libModule.getProject(); - if (tProject.isOpen()) { - try { - IJavaProject javaProject = JavaCore.create(tProject); - IPath outputLocation = javaProject.getOutputLocation(); - IPath searchPath = outputLocation.removeFirstSegments(1); - searchPath = searchPath.append(J2EEConstants.META_INF); - searchPath = searchPath.append("taglib.tld"); //$NON-NLS-1$ - IResource searchResource = tProject.findMember(searchPath); - if (searchResource != null) - return searchResource; - } catch (JavaModelException e) { - //Do nothing - } - } - } - } - return null; - } - - /** - * Method getWebAppRelativePath. This method resolves a location specified in a taglib uri to a - * project relative IPath - * - * @return null if the relative path cannot be resolved to an actual resource or a web library - * project - * @param location - * @return IPath - */ - private IPath getWebAppRelativePath(String location) { - IPath resolvedPath = null; - if (location != null && !location.trim().equals("")) { //$NON-NLS-1$ - IPath preResolvePath = new Path(location); - IContainer webModuleFolder = getModuleServerRoot(); - IContainer webLibraryFolder = WebPropertiesUtil.getWebLibFolder(project); - IContainer webInfFolder = webLibraryFolder.getParent(); - if (preResolvePath.getDevice() == null && !preResolvePath.isEmpty()) { - IContainer searchContainer = webModuleFolder; - if (!preResolvePath.isAbsolute()) { - searchContainer = webInfFolder; - } - for (int i = 0; i < preResolvePath.segmentCount(); i++) { - String pathSegment = preResolvePath.segment(i); - if (pathSegment.equals(".")) //$NON-NLS-1$ - continue; - else if (pathSegment.equals("..")) { //$NON-NLS-1$ - searchContainer = searchContainer.getParent(); - if (searchContainer.getFullPath().equals(webModuleFolder.getParent().getFullPath())) - break; // path must be confined to webModuleFolder - } else { - IResource resourceFound = searchContainer.findMember(pathSegment); - if (resourceFound instanceof IContainer) { - searchContainer = (IContainer) resourceFound; - } else if (i == preResolvePath.segmentCount() - 1) { - if (resourceFound != null) { - if (resourceFound.getType() == IResource.FILE) { - resolvedPath = resourceFound.getFullPath().removeFirstSegments(webModuleFolder.getFullPath().segmentCount()); - break; // for readability - } - } else { - // maybe its a web library project, so let us check if the current - // container is the lib folder - if (webLibraryFolder.getFullPath().equals(searchContainer.getFullPath())) { - // the last segment could be the name of the jar for the web - // library project - if (findLibModule(pathSegment) != null) { - resolvedPath = searchContainer.getFullPath().removeFirstSegments(webModuleFolder.getFullPath().segmentCount()); - resolvedPath = resolvedPath.append(pathSegment); - } - } - } - } else - break;// not a container, not the last segment either so its an invalid - // path - } - } - } - } - return resolvedPath; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/DirTaglibInfo.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/DirTaglibInfo.java deleted file mode 100644 index b018e38d5..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/DirTaglibInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 17, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.taglib; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - - -/** - * @author admin - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public class DirTaglibInfo extends TaglibInfo implements IDirTaglibInfo { - - private IContainer container; - - //private IFile[] tagFiles; - - /** - * @param project - * @param uri - * @param tldLocation - */ - public DirTaglibInfo(IContainer container, String uri, IPath tldLocation) { - super(container.getProject(), uri, tldLocation); - this.container = container; - setDirectoryEntry(true); - // TODO Auto-generated constructor stub - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.taglib.IDirTaglibInfo#getTagFiles() - */ - public IFile[] getTagFiles() { - List iFiles = new ArrayList(); - - try { - IResource resources[] = this.container.members(); - - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - if (resource.getType() == IResource.FILE && resource.getFileExtension().equalsIgnoreCase("tag")) { //$NON-NLS-1$ - iFiles.add(resource); - } - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return (IFile[]) iFiles.toArray(new IFile[iFiles.size()]); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.taglib.IDirTaglibInfo#getDirectory() - */ - public IContainer getDirectory() { - return this.container; - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.taglib.IDirTaglibInfo#getTags() - */ - public String[] getTags() { - IFile tagFiles[] = getTagFiles(); - List tagList = new ArrayList(); - for (int i = 0; i < tagFiles.length; i++) { - IFile array_element = tagFiles[i]; - String filename = array_element.getName(); - String extn = (new Path(array_element.getName())).getFileExtension(); - String tagname = filename.substring(0, filename.indexOf("." + extn)); //$NON-NLS-1$ - tagList.add(tagname); - } - return (String[]) tagList.toArray(new String[tagList.size()]); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/IDirTaglibInfo.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/IDirTaglibInfo.java deleted file mode 100644 index e969b8956..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/IDirTaglibInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 17, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.taglib; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; - -/** - * @author admin - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public interface IDirTaglibInfo extends ITaglibInfo { - - IContainer getDirectory(); - - IFile[] getTagFiles(); - - String[] getTags(); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibInfo.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibInfo.java deleted file mode 100644 index 0f62268bd..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibInfo.java +++ /dev/null @@ -1,164 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import java.io.IOException; -import java.io.InputStream; -import java.util.zip.ZipException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; - -/** - * @version 1.0 - * @author - */ -public interface ITaglibInfo { - - /** - * This method is added so that all implementors of ITaglibInfo implement clone and hence object - * references of type ITaglibInfo can be cloned. - * - * @return Object - */ - public Object clone(); - - /** - * Return the URI that this taglib is known by. This string does not have anything to do with - * the tablib's location in the project structure. - * - * @return String The uri. - */ - String getURI(); - - /** - * Returns the project relative location of the taglib. If the taglib is inside of a .jar file, - * then the project relative location of the jar file is returned. If the taglib is specified by - * a loose tld file, then the project relative location of the tld file is returned. If it is a - * server contributed taglib jar, return the actual file system location of the file. - * - * @return IPath The project relative location of the taglib. - */ - IPath getLocation(); - - /** - * Returns the relative location of the TLD file for the taglib. If the TLD is loose, then the - * path returned is project relative. If it is in a jar file, then the path returned is relative - * to the jar file. If the taglib is a mapping in the web.xml file, then this returns the - * project relative value of the <taglib-location>file. - * - * @return IPath Return location of the TLD file - */ - IPath getTLDLocation(); - - /** - * Return an input stream on TLD file that this taglib represents. It is the responsibility of - * the caller of this method to close the stream. - * - * @return InputStream - */ - InputStream getTLDStream() throws ZipException, IOException, CoreException; - - /** - * Return the recommended prefix for this taglib. If unset, the short-name from the TLD file is - * returned - * - * @return String The recommended prefix for this taglib - */ - String getPrefix(); - - /** - * Return the project that is the source of this taglib (where it resides). In the case of a - * library module, this would be the referenced JavaProject. - * - * @return IProject the source project for this taglib - */ - IProject getSourceProject(); - - /** - * Sets the recommended prefix for this taglib when it is used in a jsp. - * - * @param prefix - * The prefix- typically 4 characters or less. - */ - void setPrefix(String prefix); - - /** - * Return true if the tld file of the taglib is inside a jar file and false if it is in loose in - * the project. - * - * @return boolean True if tld file is in a jar - */ - boolean isInJar(); - - /** - * Return true if this Taglib is a web.xml mapping - * - * @return boolean True if web.xml mapped. - */ - boolean isWebXMLEntry(); - - /** - * Return true if the URI of this mapping was retrieved from the <uri>element of the TLD file. - * - * @return boolean True if uri is from a TLD. False otherwise. - */ - boolean isURIFromTLD(); - - /** - * Return true if the taglib mapping represented is valid. Valid means that the location of the - * TLD can actually be resolved. - * - * @return boolean - */ - boolean isValid(); - - /** - * Return true if the taglib is inside a lib module mapped jar. If this is the case, then - * getLocation() returns the jar name and getTLDLocation() returns the project relative TLD file - * location in the java project. - * - * @return boolean True if TLD is in a lib mapped project. - */ - boolean isLibModule(); - - /** - * Sets the isWebXMLEntry. - * - * @param isWebXMLEntry - * The isWebXMLEntry to set - */ - void setIsWebXMLEntry(boolean isWebXMLEntry); - - /** - * Set the validity of the taglib entry - * - * @param isValid - */ - void setIsValid(boolean isValid); - - - /** - * Return true if the taglib is contributed from by a server's container as what is known as - * well known URI's in jsp spec - * - * @return - */ - boolean isServerContribution(); - - /** - * Return true if its a directory entry which contains .tag files - * - * @return - */ - boolean isDirectoryEntry(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibLocator.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibLocator.java deleted file mode 100644 index c519218fa..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibLocator.java +++ /dev/null @@ -1,16 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import org.eclipse.core.resources.IResource; - - -public interface ITaglibLocator { - ITaglibInfo[] search(IResource resource); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistry.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistry.java deleted file mode 100644 index fb0dfaee7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistry.java +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.IPath; - -public interface ITaglibRegistry { - /** - * Return the project that this taglib registry is over - * - * @return IProject The project for this registry - */ - IProject getProject(); - - /** - * Get the taglib that maps to the passed in URI. Return null if the URI is not present in any - * mapping. - * - * @param uri - * @return ITaglibInfo The taglib that matches the uri or null - */ - ITaglibInfo getTaglib(String uri); - - /** - * Return all the taglibs that map to a given location - * - * @param location - * The project relative location - * @return ITaglibInfo[] All taglibs that map to the passed in location - */ - ITaglibInfo[] getTaglibs(IPath location); - - /** - * Return all the taglibs available in the project. This may include many mappings to a single - * taglib. A separate taglib is returned for each of mapping in this case. - * - * @return ITaglibInfo[] All the taglibs for project - */ - ITaglibInfo[] getTaglibs(); - - /** - * Returns the recommended taglibs for this project. Only one taglib is returned for each - * location- this is the recommended URI to use to map to this location. Note that this list - * filters the visible taglibs to return one per resource. Thus this list cannot be used to - * validate a given uri. - * - * @return ITaglibInfo[] - */ - ITaglibInfo[] getRecommendedTaglibs(); - - /** - * Returns the visible taglibs for this project. All taglib uri's that are visible are returned. - * This list can be used to display all the valid taglibs. - * - * @return ITaglibInfo[] - */ - ITaglibInfo[] getVisibleTaglibs(); - - - /** - * Call with to allow the tablib registry a chance to update itself to correspond with the - * passed in resource delta. This method should not be called by clients. It is called by the - * ITaglibRegistryManager. - * - * @param delta - */ - void processResourceChanged(IResourceDelta delta); - - /** - * Add a listener to the taglib registry. This listener will be notified whenever a taglib is - * added, removed, or changed from the project that this registry is associated with. - * - * @param listener - * The listener to notify - */ - void addTaglibRegistryListener(ITaglibRegistryListener listener); - - /** - * Remove a listener from the taglib registry. - * - * @param listener - * The listener to remove - */ - void removeTaglibRegistryListener(ITaglibRegistryListener listener); - - /** - * Refresh the registry to an up-to-date status - */ - public void refresh(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistryListener.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistryListener.java deleted file mode 100644 index 9010cc4da..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistryListener.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -public interface ITaglibRegistryListener { - void taglibAdded(ITaglibInfo taglib); - - void taglibRemoved(ITaglibInfo taglib); - - void taglibChanged(ITaglibInfo taglib); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistryManager.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistryManager.java deleted file mode 100644 index 83e767726..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ITaglibRegistryManager.java +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import org.eclipse.core.resources.IProject; - -public interface ITaglibRegistryManager { - - ITaglibRegistry getTaglibRegistry(IProject project); - - /** - * use this if you want to access the registry only if it exists - * - * @param project - * @return - */ - boolean isTaglibRegistryExists(IProject project); - - - void dispose(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/IWebXMLTaglibInfo.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/IWebXMLTaglibInfo.java deleted file mode 100644 index fa1ebe7c0..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/IWebXMLTaglibInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import org.eclipse.core.runtime.IPath; - -/** - * @author wsad2 - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public interface IWebXMLTaglibInfo extends ITaglibInfo { - - /** - * Method isResolved. If the return value is true then the getLocation method actually resolves - * to a resource , if the return value is false then the getLocation method doesnt resolve to a - * resouce. - * - * @return boolean - */ - public boolean isLocationResolved(); - - /** - * Method getWebXMLTaglibLocation. This method returns the actual value specified as the - * location of the taglib defined in a deployment descriptor entry - * - * @return IPath - */ - public IPath getWebXMLTaglibLocation(); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ServerJarsUtil.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ServerJarsUtil.java deleted file mode 100644 index b6f2259e5..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/ServerJarsUtil.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 15, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.taglib; - -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.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.RuntimeClasspathContainer; -import org.eclipse.wst.server.core.IRuntime; - -/** - * @author admin - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public class ServerJarsUtil { - - public static final String baseV6 = "com.ibm.ws.ast.st.runtime.v60"; //$NON-NLS-1$ - - - - public static IPath[] getServerJars(IProject project) { - IPath ret[] = new IPath[0]; - IJavaProject javaProject = null; - try { - javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID); - - List list = new ArrayList(); - IClasspathEntry[] cp = javaProject.getRawClasspath(); - int size = cp.length; - for (int i = 0; i < size; i++) { - - if (cp[i].getPath().segment(0).equals(RuntimeClasspathContainer.SERVER_CONTAINER)) { - IClasspathContainer classpathContainer = JavaCore.getClasspathContainer(cp[i].getPath(), javaProject); - for (int j = 0; j < classpathContainer.getClasspathEntries().length; j++) { - IClasspathEntry entry = classpathContainer.getClasspathEntries()[j]; - if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { - list.add(entry.getPath()); - } - } - } - - } - - ret = (IPath[]) list.toArray(new IPath[list.size()]); - } catch (Exception e) { - //Do nothing - } - - return ret; - } - - public static boolean isTargetedAtWASV6(IRuntime serverTarget) { - boolean allowed = false; - String id = getServerId(serverTarget); - if (id != null) { - // System.out.println("Server id = " + id); - // System.out.print("Server type = " + - // serverTarget.getRuntimeType()); - if (serverTarget != null) { - if (baseV6.equals(id)) { - allowed = true; - } - } - } - return allowed; - } - - private static String getServerId(IRuntime serverTarget) { - String id = null; - if (serverTarget != null && serverTarget.getRuntimeType() != null) { - id = serverTarget.getRuntimeType().getId(); - } - return id; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TLDDigester.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TLDDigester.java deleted file mode 100644 index b467dd093..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TLDDigester.java +++ /dev/null @@ -1,250 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.EntityResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -/** - * This class parses tld files and produces TLDs, and Tags, and Attributes - * - * Creation date: (11/7/2001 10:33:15 AM) - * - * @author: Mindaugas Idzelis - */ -public class TLDDigester { - private InputStream istream; - private Document document; - - protected final static String PUBLICID_11 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"; //$NON-NLS-1$ - protected final static String PUBLICID_12 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"; //$NON-NLS-1$ - protected final static String PUBLICID_20 = "http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"; //$NON-NLS-1$ - private static ErrorHandler errorHandler; - private static EntityResolver resolver; - - - public TLDDigester(InputStream stream) { - super(); - this.istream = stream; - getDocument(); - } - - public void close() { - if (this.istream != null) { - try { - this.istream.close(); - } catch (IOException exc) { - //Do nothing - } - } - } - - // public boolean isJSP11() { - // if(getDocument() != null){ - // DocumentType docType = getDocument().getDoctype(); - // if (docType != null && PUBLICID_11.equals(docType.getPublicId())) - // return true; - // } - // return false; - // } - public String getJSPLevel() { - if (getDocument() != null) { - // xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee - // web-jsptaglibrary_2_0.xsd" - // version="2.0" - Element docElement = getDocument().getDocumentElement(); - if (docElement != null && "2.0".equals(docElement.getAttribute("version")) //$NON-NLS-1$ //$NON-NLS-2$ - && PUBLICID_20.equals(docElement.getAttribute("xsi:schemaLocation"))) //$NON-NLS-1$ - return J2EEVersionConstants.VERSION_2_0_TEXT; - - DocumentType docType = getDocument().getDoctype(); - - if (docType != null && PUBLICID_12.equals(docType.getPublicId())) - return J2EEVersionConstants.VERSION_1_2_TEXT; - - if (docType != null && PUBLICID_11.equals(docType.getPublicId())) - return J2EEVersionConstants.VERSION_1_1_TEXT; - - } - return null; - } - - public String getURI() { - Node taglibNode = getTaglibNode(); - if (taglibNode != null) - return getTagValue(taglibNode, "uri"); //$NON-NLS-1$ - return null; - } - - public String getShortName() { - Node taglibNode = getTaglibNode(); - String retVal = null; - if (taglibNode != null) { - retVal = getTagValue(taglibNode, "shortname"); //$NON-NLS-1$ - if (retVal == null) - retVal = getTagValue(taglibNode, "short-name"); //$NON-NLS-1$ - } - return retVal; - } - - public String getDescription() { - Node taglibNode = getTaglibNode(); - String retVal = null; - if (taglibNode != null) { - retVal = getTagValue(taglibNode, "description"); //$NON-NLS-1$ - if (retVal == null) - retVal = getTagValue(taglibNode, "info"); //$NON-NLS-1$ - } - return null; - } - - protected Document createDocument() { - Document doc = null; - - InputSource inputSource = new InputSource(this.istream); - // ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); - try { - // Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - try { - - dbf.setValidating(false); - - // dbf.setAttribute("http://apache.org/xml/features/continue-after-fatal-error", - // Boolean.TRUE); //$NON-NLS-1$ - // dbf.setAttribute("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", - // Boolean.FALSE); //$NON-NLS-1$ - // dbf.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", - // Boolean.FALSE); //$NON-NLS-1$ - - DocumentBuilder builder = dbf.newDocumentBuilder(); - builder.setEntityResolver(getEntityResolver()); - builder.setErrorHandler(getNullErrorHandler()); - doc = builder.parse(inputSource); - } catch (ParserConfigurationException e) { - //e.printStackTrace(); - } catch (SAXException e) { - //e.printStackTrace(); - } catch (IOException e) { - //e.printStackTrace(); - } - } finally { - // Thread.currentThread().setContextClassLoader(prevClassLoader); - } - return doc; - } - - public Document getDocument() { - if (this.document == null) { - this.document = createDocument(); - } - return this.document; - } - - protected Node getTaglibNode() { - Document doc = getDocument(); - Node taglibNode = null; - if (doc != null) { - taglibNode = findChildNode(doc, "taglib"); //$NON-NLS-1$ - } - return taglibNode; - } - - protected Node findChildNode(Node parent, String nodeName) { - NodeList list = parent.getChildNodes(); - int length = list.getLength(); - for (int i = 0; i < length; ++i) { - Node curNode = list.item(i); - if (curNode.getNodeType() == Node.ELEMENT_NODE) { - Element curElement = (Element) curNode; - if (curElement.getNodeName().equalsIgnoreCase(nodeName)) - return curElement; - } - } - return null; - } - - protected String getTagValue(Node node, String tagName) { - Node childNode = findChildNode(node, tagName); - if (childNode != null) { - Node textNode = childNode.getFirstChild(); - if ((textNode != null) && (textNode.getNodeType() == Node.TEXT_NODE)) { - return removeWhitespace(textNode.getNodeValue()); - } - } - return null; - } - - protected String removeWhitespace(String string) { - return string.trim().replace(' ', '_'); - } - - /** - * Returns an EntityResolver that won't try to load and resolve ANY entities - */ - private static EntityResolver getEntityResolver() { - if (resolver == null) { - resolver = new EntityResolver() { - public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException { - InputSource result = null; - if (result == null) { - result = new InputSource(new StringReader("")); //$NON-NLS-1$ - result.setPublicId(publicID); - result.setSystemId(systemID != null ? systemID : "/_" + getClass().getName()); //$NON-NLS-1$ - } - return result; - } - }; - } - return resolver; - } - - /** - * Returns an ErrorHandler that will not stop the parser on reported errors - */ - private static ErrorHandler getNullErrorHandler() { - if (errorHandler == null) { - errorHandler = new ErrorHandler() { - public void error(SAXParseException exception) throws SAXException { - Logger.getLogger().log(exception); - } - - public void fatalError(SAXParseException exception) throws SAXException { - Logger.getLogger().log(exception); - } - - public void warning(SAXParseException exception) throws SAXException { - Logger.getLogger().log(exception); - } - }; - } - return errorHandler; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TaglibInfo.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TaglibInfo.java deleted file mode 100644 index 36651a6f6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TaglibInfo.java +++ /dev/null @@ -1,378 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.web.operations.ProjectSupportResourceHandler; - - -public class TaglibInfo implements ITaglibInfo, Cloneable { - private IPath location; - private String uri; - private IPath tldLocation; - private String prefix; - private IProject project; - - private boolean isInJar = false; - private boolean isWebXMLEntry = false; - private boolean isURIFromTLD = false; - private boolean isLibModule = false; - private boolean isValid = true; - - private boolean isServerContribution = false; - private boolean isDirectoryEntry = false; - - public TaglibInfo(IProject project, String uri, IPath tldLocation) { - this.project = project; - this.uri = uri; - this.location = tldLocation; - this.tldLocation = tldLocation; - this.isInJar = false; - } - - public TaglibInfo(IProject project, String uri, IPath jarLocation, IPath tldLocation) { - this.project = project; - this.uri = uri; - this.location = jarLocation; - this.isInJar = true; - this.tldLocation = tldLocation; - } - - - public Object clone() { - Object o = null; - try { - o = super.clone(); - } catch (CloneNotSupportedException e) { - System.err.println(ProjectSupportResourceHandler.getString("Cannot_clone_TaglibInfo_1_EXC_")); //$NON-NLS-1$ - } - return o; - } - - /* - * @see ITaglibInfo#getLocation() - */ - public IPath getLocation() { - return this.location; - } - - /* - * @see ITaglibInfo#getURI() - */ - public String getURI() { - return this.uri; - } - - /* - * @see ITaglibInfo#isInJar() - */ - public boolean isInJar() { - return this.isInJar; - } - - /* - * @see ITaglibInfo#getTLDLocation() - */ - public IPath getTLDLocation() { - return this.tldLocation; - } - - - /** - * Sets the location of the TLD file. - * - * @param tldLocation - * The tldLocation to set - */ - public void setTLDLocation(IPath tldLocation) { - this.tldLocation = tldLocation; - } - - /* - * @see Object#toString() - */ - public String toString() { - if (this.isInJar) - return "TaglibInfo(JAR" + (isWebXMLEntry() ? ",WEB.XML: " : ": ") + getURI() + ", " + this.location + ", " + this.tldLocation + ", " + isURIFromTLD() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ - - return "TaglibInfo(TLD" + (isWebXMLEntry() ? ",WEB.XML: " : ": ") + getURI() + ", " + this.location + ", " + isURIFromTLD() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ - } - - /* - * @see ITaglibInfo#isWebXMLEntry() - */ - public boolean isWebXMLEntry() { - return this.isWebXMLEntry; - } - - /* - * @see Object#equals(Object) - */ - public boolean equals(Object object) { - if (object == null) - return false; - if (!(object instanceof ITaglibInfo)) - return false; - ITaglibInfo taglibInfo = (ITaglibInfo) object; - return this.getLocation().equals(taglibInfo.getLocation()) && this.getTLDLocation().equals(taglibInfo.getTLDLocation()) && this.getURI().equals(taglibInfo.getURI()) && this.isWebXMLEntry() == taglibInfo.isWebXMLEntry(); - } - - /** - * Sets the isWebXMLEntry. - * - * @param isWebXMLEntry - * The isWebXMLEntry to set - */ - public void setIsWebXMLEntry(boolean isWebXMLEntry) { - this.isWebXMLEntry = isWebXMLEntry; - } - - /* - * @see ITaglibInfo#setIsValid() - */ - public void setIsValid(boolean validity) { - this.isValid = validity; - } - - /* - * @see ITaglibInfo#getPrefix() - */ - public String getPrefix() { - return this.prefix; - } - - /* - * @see ITaglibInfo#getSourceProject() - */ - public IProject getSourceProject() { - return this.project; - } - - /* - * @see ITaglibInfo#setPrefix(String) - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public void setPrefix(TLDDigester digester) { - if (digester != null) { - String aprefix = digester.getShortName(); - if (aprefix != null) - setPrefix(aprefix); - } - } - - - - /* - * @see ITaglibInfo#getTLDStream() - */ - public InputStream getTLDStream() throws ZipException, IOException, CoreException { - File javaIOFile = null; - IFile file = null; - boolean bIsInJar = false; - if (isLibModule()) { - file = (IFile) this.project.findMember(getTLDLocation()); - javaIOFile = file.getLocation().toFile(); - } else if (isServerContribution()) { - javaIOFile = getLocation().toFile(); - bIsInJar = isInJar(); - } else { - file = (IFile) this.project.findMember(getLocation()); - if (file != null) { - javaIOFile = file.getLocation().toFile(); - } - - // for webxml entries try relative to web.xml - if (javaIOFile == null || !javaIOFile.exists()) { - if (isWebXMLEntry()) { - IPath taglibPath = getLocation(); - if (!taglibPath.isAbsolute()) { - IResource resolvedResource = project.findMember(taglibPath); - if (resolvedResource instanceof IFile) { - file = (IFile) resolvedResource; - javaIOFile = file.getLocation().toFile(); - } - } - } - } - bIsInJar = isInJar(); - } - - if (bIsInJar) { - if (javaIOFile != null) { - ZipFile zFile = new ZipFile(javaIOFile); - try { - ZipEntry entry = zFile.getEntry(getTLDLocation().toString()); - if (entry != null) { - InputStream zipInputStream = zFile.getInputStream(entry); - InputStream retStream = bufferInputStream(zipInputStream); - zipInputStream.close(); - return retStream; - } - } finally { - if (zFile != null) - zFile.close(); - } - } - } else { - if (file != null) - return file.getContents(); - // there is no server contributed tld, only jars - // else if(javaIOFile != null) - // return new FileInputStream(javaIOFile); - } - return null; - } - - protected InputStream bufferInputStream(InputStream is) { - try { - ByteArrayOutputStream output = new ByteArrayOutputStream(); - if (is != null) { - int available = is.available(); - int totalRead = 0; - byte[] read = new byte[available]; - while (totalRead < available) { - int numRead = is.read(read, 0, available); - output.write(read, 0, numRead); - totalRead += numRead; - } - } - output.close(); - return new ByteArrayInputStream(output.toByteArray()); - } catch (IOException e) { - //Do nothing - } finally { - if (is != null) { - try { - is.close(); - } catch (IOException e) { - //Do nothing - } - } - } - return null; - } - - public String getTLDString() { - InputStream is = null; - try { - is = getTLDStream(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - if (is != null) { - int available = is.available(); - byte[] read = new byte[available]; - int numRead = is.read(read); - output.write(read, 0, numRead); - } - output.close(); - return output.toString(); - } catch (ZipException e) { - //Do nothing - } catch (IOException e) { - //Do nothing - } catch (CoreException e) { - //Do nothing - } finally { - if (is != null) { - try { - is.close(); - } catch (IOException e) { - //Do nothing - } - } - } - return ProjectSupportResourceHandler.getString("Could_not_read_TLD_15"); //$NON-NLS-1$ - } - - /** - * @see ITaglibInfo#isURIFromTLD() - */ - public boolean isURIFromTLD() { - return this.isURIFromTLD; - } - - /** - * Sets the isURIFromTLD. - * - * @param isURIFromTLD - * The isURIFromTLD to set - */ - public void setIsURIFromTLD(boolean isURIFromTLD) { - this.isURIFromTLD = isURIFromTLD; - } - - /** - * @see ITaglibInfo#isLibModule() - */ - public boolean isLibModule() { - return this.isLibModule; - } - - /** - * Sets the isLibModule. flag - * - * @param isLibModule - * The isLibModule to set - */ - public void setIsLibModule(boolean isLibModule) { - this.isLibModule = isLibModule; - } - - /** - * @see ITaglibInfo#isValid() - */ - public boolean isValid() { - return this.isValid; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.taglib.ITaglibInfo#isServerContribution() - */ - public boolean isServerContribution() { - return this.isServerContribution; - } - - public void setServerContribution(boolean isServerContribution) { - this.isServerContribution = isServerContribution; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.taglib.ITaglibInfo#isDirectoryEntry() - */ - public boolean isDirectoryEntry() { - return this.isDirectoryEntry; - } - - /** - * @param isDirectoryEntry - * The isDirectoryEntry to set. - */ - public void setDirectoryEntry(boolean isDirectoryEntry) { - this.isDirectoryEntry = isDirectoryEntry; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TaglibRegistryManager.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TaglibRegistryManager.java deleted file mode 100644 index 5f82ebe1c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/TaglibRegistryManager.java +++ /dev/null @@ -1,177 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.j2ee.internal.web.taglib.registry.JavaTaglibRegistry; -import org.eclipse.jst.j2ee.internal.web.taglib.registry.WebTaglibRegistry; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - - -public class TaglibRegistryManager implements ITaglibRegistryManager { - - - - protected HashMap registries = new HashMap(); - protected IResourceChangeListener resourceListener; - - private class ResourceChangeListener implements IResourceChangeListener, IResourceDeltaVisitor { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - if (event.getSource() instanceof IWorkspace) { - IResourceDelta delta = event.getDelta(); - switch (event.getType()) { - case IResourceChangeEvent.POST_CHANGE : - if (delta != null) { - try { - delta.accept(this); - } catch (CoreException e) { - //Do nothing - } - } - break; - case IResourceChangeEvent.PRE_CLOSE : - case IResourceChangeEvent.PRE_DELETE : - removeTaglibRegistry((IProject) event.getResource()); - break; - } - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta) - */ - public boolean visit(IResourceDelta delta) throws CoreException { - if (delta != null) { - TaglibRegistryManager.this.resourceChanged(delta); - return true; - } - return false; - } - - } - - public TaglibRegistryManager() { - super(); - initialize(); - } - - protected ITaglibRegistry createNewRegistry(IProject project) { - ITaglibRegistry registry = null; - WebArtifactEdit webEdit = null; - try { - if (project != null && project.isAccessible()) { // ensure web library project not closed - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit!=null) { - registry = new WebTaglibRegistry(project); - } else if (project.hasNature(JavaCore.NATURE_ID)) { - registry = new JavaTaglibRegistry(project); - } - } - } catch (CoreException e) { - //Do nothing - } finally { - if (webEdit != null) - webEdit.dispose(); - } - if (registry != null) { - this.registries.put(project, registry); - } - return registry; - } - - protected void initialize() { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - this.resourceListener = new ResourceChangeListener(); - workspace.addResourceChangeListener(this.resourceListener); - } - - protected void resourceChanged(IResourceDelta delta) { - if (delta.getResource() instanceof IProject) - return; - - Collection registryCol = this.registries.values(); - for (Iterator iter = registryCol.iterator(); iter.hasNext();) { - ITaglibRegistry registry = (ITaglibRegistry) iter.next(); - if (delta.getResource().getProject() == registry.getProject()) { - registry.processResourceChanged(delta); - } - } - } - - protected void removeTaglibRegistry(IProject project) { - this.registries.remove(project); - } - - /** - * @see ITaglibRegistryManager#getTaglibRegistry(IProject) - */ - public ITaglibRegistry getTaglibRegistry(IProject project) { - ITaglibRegistry registry = (ITaglibRegistry) this.registries.get(project); - if (registry == null) { - registry = createNewRegistry(project); - } - return registry; - } - - /** - * @see ITaglibRegistryManager#dispose() - */ - public void dispose() { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - workspace.removeResourceChangeListener(this.resourceListener); - this.registries = null; - } - - /** - * @see Object#toString() - */ - public String toString() { - StringBuffer buf = new StringBuffer(); - Collection regCol = this.registries.values(); - for (Iterator iter = regCol.iterator(); iter.hasNext();) { - ITaglibRegistry registry = (ITaglibRegistry) iter.next(); - buf.append("=== Registry for " + registry.getProject() + "===\n"); //$NON-NLS-1$ //$NON-NLS-2$ - buf.append(registry); - buf.append("\n"); //$NON-NLS-1$ - } - return buf.toString(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.taglib.ITaglibRegistryManager#isTaglibRegistryExists(org.eclipse.core.resources.IProject) - */ - public boolean isTaglibRegistryExists(IProject project) { - return this.registries.containsKey(project); - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/WebProjectServerTaglibListener.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/WebProjectServerTaglibListener.java deleted file mode 100644 index 640f64940..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/WebProjectServerTaglibListener.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 15, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.taglib; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IRuntimeTargetHandler; -import org.eclipse.wst.server.core.IRuntimeType; - -/** - * @author admin - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public class WebProjectServerTaglibListener implements IRuntimeTargetHandler { - private IRuntime runtimeToBeRemoved; - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.model.IRuntimeTargetHandlerDelegate#setRuntimeTarget(org.eclipse.core.resources.IProject, - * org.eclipse.wst.server.core.IRuntime, org.eclipse.core.runtime.IProgressMonitor) - */ - public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException { - // TODO right now only v6 server contributes taglibs, if more servers are added need to - // determine that - if (this.runtimeToBeRemoved != null) { - if (ServerJarsUtil.isTargetedAtWASV6(this.runtimeToBeRemoved) || ServerJarsUtil.isTargetedAtWASV6(runtime)) { - if (WebPlugin.getDefault().getTaglibRegistryManager().isTaglibRegistryExists(project)) - WebPlugin.getDefault().getTaglibRegistryManager().getTaglibRegistry(project).refresh(); - } - } - this.runtimeToBeRemoved = null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.model.IRuntimeTargetHandlerDelegate#removeRuntimeTarget(org.eclipse.core.resources.IProject, - * org.eclipse.wst.server.core.IRuntime, org.eclipse.core.runtime.IProgressMonitor) - */ - public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor) throws CoreException { - this.runtimeToBeRemoved = runtime; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.server.core.IRuntimeTargetHandler#getId() - */ - public String getId() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.server.core.IRuntimeTargetHandler#supportsRuntimeType(org.eclipse.wst.server.core.IRuntimeType) - */ - public boolean supportsRuntimeType(IRuntimeType runtimeType) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - // TODO Auto-generated method stub - return null; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/WebXMLTaglibInfo.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/WebXMLTaglibInfo.java deleted file mode 100644 index 239c8e227..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/WebXMLTaglibInfo.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; - - -/** - * @author wsad2 - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class WebXMLTaglibInfo extends TaglibInfo implements IWebXMLTaglibInfo { - - public WebXMLTaglibInfo(IProject project, String uri, IPath tldLocation) { - super(project, uri, tldLocation); - setWebXMLLocation(getLocation()); - } - - public WebXMLTaglibInfo(IProject project, String uri, IPath jarLocation, IPath tldLocation) { - super(project, uri, jarLocation, tldLocation); - setWebXMLLocation(getLocation()); - } - - - - private boolean isLocationResolved = true; - - private IPath webXMLLocation; - - - /** - * @see org.eclipse.jst.j2ee.internal.internal.taglib.IWebXMLTaglibInfo#isLocationResolved() - */ - public boolean isLocationResolved() { - return this.isLocationResolved; - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.taglib.IWebXMLTaglibInfo#getWebXMLTaglibLocation() - */ - public IPath getWebXMLTaglibLocation() { - return this.webXMLLocation; - } - - - /** - * Sets the isLocationResolved. - * - * @param isLocationResolved - * The isLocationResolved to set - */ - public void setIsLocationResolved(boolean isResolved) { - this.isLocationResolved = isResolved; - } - - /** - * Sets the webXMLLocation. - * - * @param webXMLLocation - * The webXMLLocation to set - */ - public void setWebXMLLocation(IPath webXMLLocation) { - this.webXMLLocation = webXMLLocation; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/AbstractTaglibRegistry.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/AbstractTaglibRegistry.java deleted file mode 100644 index 9f5085899..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/AbstractTaglibRegistry.java +++ /dev/null @@ -1,555 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib.registry; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.Vector; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.web.locator.WebProjectTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.locator.WebXMLTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibLocator; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibRegistry; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibRegistryListener; - - -/** - * @version 1.0 - * @author - */ -abstract public class AbstractTaglibRegistry implements ITaglibRegistry { - private static final boolean debug = false; - - protected IProject project; - protected Vector listeners; - protected Vector taglibs; // of type ITaglibInfo - protected ITaglibLocator[] locators; - protected boolean needsRefresh = false; - - public AbstractTaglibRegistry(IProject project) { - this.project = project; - initialize(); - refresh(); - } - - protected void initialize() { - this.locators = new ITaglibLocator[]{new WebProjectTaglibLocator(this.project), new WebXMLTaglibLocator(this.project)}; - } - - /* - * @see ITaglibRegistry#addTaglibRegistryListener(ITaglibRegistryListener) - */ - protected void addTaglib(ITaglibInfo taglib) { - // Add web.xml entries at the top of the list so that they are - // always returned first from the getTaglib(uri) method. - if (taglib.isWebXMLEntry()) - this.taglibs.add(0, taglib); - else - this.taglibs.add(taglib); - } - - public void addTaglibRegistryListener(ITaglibRegistryListener listener) { - if (this.listeners == null) - this.listeners = new Vector(); - this.listeners.add(listener); - } - - /* - * @see ITaglibRegistry#getTaglib(IPath) - */ - public ITaglibInfo[] getTaglibs(IPath location) { - Vector results = getTaglibsVector(location); - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - protected Vector getTaglibsVector(IPath location) { - Vector results = new Vector(); - Vector tTaglibs = primGetTaglibs(); - - boolean isWebXML = isWebXMLFile(location); - - // Start at the beginning of the taglib list and return the first - // one that matches the location passed in. - for (Iterator iter = tTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo taglib = (ITaglibInfo) iter.next(); - if (isWebXML) { - if (taglib.isWebXMLEntry()) - results.add(taglib); - } else if (taglib.getLocation().equals(location)) - results.add(taglib); - } - return results; - } - - protected Vector getExistingTaglibs(IPath location) { - Vector results = new Vector(); - Vector tTaglibs = this.taglibs; - - boolean isWebXML = isWebXMLFile(location); - - // Start at the beginning of the taglib list and return the first - // one that matches the location passed in. - for (Iterator iter = tTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo taglib = (ITaglibInfo) iter.next(); - if (isWebXML) { - if (taglib.isWebXMLEntry()) - results.add(taglib); - } else if (taglib.getLocation().equals(location) && !taglib.isWebXMLEntry()) - results.add(taglib); - } - return results; - } - - public IProject getProject() { - return this.project; - } - - /* - * @see ITaglibRegistry#getRecommendedTaglibs() - */ - public ITaglibInfo[] getRecommendedTaglibs() { - // we pass false because we dont want to show all entries per resource,just one - return getValidTaglibs(false); - } - - /* - * @see ITaglibRegistry#getVisibleTaglibs() - */ - public ITaglibInfo[] getVisibleTaglibs() { - // we pass true because we want to show all entries that are valid uri's for a resource - return getValidTaglibs(true); - } - - - protected ITaglibInfo[] getValidTaglibs(boolean showAllEntriesPerResource) { - Vector allTaglibs = primGetTaglibs(); - Vector results = new Vector(allTaglibs.size()); - Set locationSet = new HashSet(); - Set uriSet = new HashSet(); - - // first pass web.xml entries - for (Iterator iter = allTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo iTaglib = (ITaglibInfo) iter.next(); - if (iTaglib.isWebXMLEntry()) { - if (!uriSet.contains(iTaglib.getURI())) { - // show all web.xml entries whether they are mapped to the same resource - // if(showAllEntriesPerResource || - // !locationSet.contains(iTaglib.getLocation())){ - if (!locationSet.contains(iTaglib.getLocation())) - locationSet.add(iTaglib.getLocation()); - results.add(iTaglib); - // } - uriSet.add(iTaglib.getURI()); - } - } - } - - // second pass uri in tld entries - for (Iterator iter = allTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo iTaglib = (ITaglibInfo) iter.next(); - if (iTaglib.isURIFromTLD() && !iTaglib.isWebXMLEntry()) { - if (!uriSet.contains(iTaglib.getURI())) { - if (!iTaglib.isInJar()) { - // i.e its a tld file in the web application - if (showAllEntriesPerResource || !locationSet.contains(iTaglib.getLocation())) { - if (!locationSet.contains(iTaglib.getLocation())) - locationSet.add(iTaglib.getLocation()); - results.add(iTaglib); - } - } else { // i.e its a tld file in a JAR file in the web application - String jarRelativePath = iTaglib.getTLDLocation().toString(); - if (jarRelativePath.equalsIgnoreCase(IWebNatureConstants.META_INFO_DIRECTORY + "/taglib.tld")) { //$NON-NLS-1$ - if (!iTaglib.isServerContribution() // dont add META-INF/taglib.tld that - // comes from a server - && (showAllEntriesPerResource || !locationSet.contains(iTaglib.getLocation()))) { - if (!locationSet.contains(iTaglib.getLocation())) - locationSet.add(iTaglib.getLocation()); - results.add(iTaglib); - } - } else { // if not metainf/taglib.tld - // we want to include all the non meta-inf entries in the results - results.add(iTaglib); - } - } - uriSet.add(iTaglib.getURI()); - } // if !uriSet.contains - } // if .isURIFromTLD - } - - // third pass for entries whose uri's are resource paths - for (Iterator iter = allTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo iTaglib = (ITaglibInfo) iter.next(); - if (!iTaglib.isURIFromTLD() && !iTaglib.isWebXMLEntry() && !iTaglib.isDirectoryEntry()) { - if (!uriSet.contains(iTaglib.getURI())) { - if (showAllEntriesPerResource || !locationSet.contains(iTaglib.getLocation())) { - results.add(iTaglib); - locationSet.add(iTaglib.getLocation()); - } - } - } - } - - // fourth pass for entries whose uri's are resource paths & directory entries - for (Iterator iter = allTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo iTaglib = (ITaglibInfo) iter.next(); - if (iTaglib.isDirectoryEntry()) { - IPath directoryLoc = iTaglib.getLocation(); - if (!uriSet.contains(iTaglib.getURI())) { - boolean canAdd = true; - for (Iterator iterator = locationSet.iterator(); iterator.hasNext();) { - IPath locationPath = (IPath) iterator.next(); - - if (directoryLoc.matchingFirstSegments(locationPath) == locationPath.segmentCount() - 1) { - canAdd = false; - break; - } - } - if (canAdd) {// don't add directories that have tld's in them - results.add(iTaglib); - locationSet.add(iTaglib.getLocation()); - } - } - } - } - - - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - protected Vector primGetTaglibs() { - if (this.needsRefresh) - refresh(); - return this.taglibs; - } - - /* - * @see ITaglibRegistry#getTaglibs() - */ - public ITaglibInfo[] getTaglibs() { - Vector tTaglibs = primGetTaglibs(); - return (ITaglibInfo[]) tTaglibs.toArray(new ITaglibInfo[tTaglibs.size()]); - } - - /* - * @see ITaglibRegistry#getTaglib(String) - */ - public ITaglibInfo getTaglib(String uri) { - List tTaglibs = Arrays.asList(getVisibleTaglibs()); - //commented out because we dont want to return the taglib for resources that are not - // visible - // or are not visible because of precedence //primGetTaglibs(); - for (Iterator iter = tTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo taglib = (ITaglibInfo) iter.next(); - if (taglib.getURI().equals(uri)) - return taglib; - } - return null; - } - - protected void fireTaglibAdded(ITaglibInfo addedTaglib) { - if (debug) - System.out.println("TaglibRegistry: taglib added: " + addedTaglib); //$NON-NLS-1$ - - if (this.listeners == null) - return; - for (Iterator iter = this.listeners.iterator(); iter.hasNext();) { - ITaglibRegistryListener listener = (ITaglibRegistryListener) iter.next(); - listener.taglibAdded(addedTaglib); - } - } - - protected void fireTaglibChanged(ITaglibInfo changedTaglib) { - if (debug) - System.out.println("TaglibRegistry: taglib changed: " + changedTaglib); //$NON-NLS-1$ - - if (this.listeners == null) - return; - for (Iterator iter = this.listeners.iterator(); iter.hasNext();) { - ITaglibRegistryListener listener = (ITaglibRegistryListener) iter.next(); - listener.taglibChanged(changedTaglib); - } - } - - protected void fireTaglibRemoved(ITaglibInfo removedTaglib) { - if (debug) - System.out.println("TaglibRegistry: taglib removed: " + removedTaglib); //$NON-NLS-1$ - - if (this.listeners == null) - return; - for (Iterator iter = this.listeners.iterator(); iter.hasNext();) { - ITaglibRegistryListener listener = (ITaglibRegistryListener) iter.next(); - listener.taglibRemoved(removedTaglib); - } - } - - abstract protected boolean isWebXMLFile(IPath filePath); - - protected boolean isTaglibTLD(IPath tldPath) { - return tldPath.lastSegment().equalsIgnoreCase("taglib.tld"); //$NON-NLS-1$ - } - - public void processResourceChanged(IResourceDelta delta) { - int kind = delta.getKind(); - IResource resource = delta.getResource(); - int flags = delta.getFlags(); - if (delta.getKind() == IResourceDelta.CHANGED && flags == IResourceDelta.NO_CHANGE) - return; - - // If the websettings file changed, refresh everything in case the context root - // was modified or the J2EE level was changed. - if (requiresFullUpdate(delta)) { - updateAll(); - return; - } - // Make sure resource is not null - if (resource == null) - return; - - // Only process resource changes that are under the refreshRoot. - IPath resourcePath = resource.getProjectRelativePath(); - - IResource refreshRoot = getRefreshRoot(); - // RATLC00974251 for a java project before build is done, output location does not exist - if (refreshRoot == null) - return; - - IPath refreshPath = refreshRoot.getProjectRelativePath(); - if (resourcePath.matchingFirstSegments(refreshPath) != refreshPath.segmentCount()) - return; - - if (debug) - System.out.println("TaglibRegistry(" + this.project.getName() + ").resourceChanged: " + delta); //$NON-NLS-1$ //$NON-NLS-2$ - - if (kind == IResourceDelta.CHANGED || kind == IResourceDelta.REPLACED) { - handleResourceModified(resource); - } else if (kind == IResourceDelta.REMOVED) { - handleResourceRemoved(resource); - } else if (kind == IResourceDelta.ADDED) { - handleResourceAdded(resource); - } else { - if (debug) - System.out.println("TaglibRegistry.resourceChanged: UNHANDLED DELTA TYPE"); //$NON-NLS-1$ - } - } - - protected void handleResourceAdded(IResource resource) { - handleResourceModified(resource); - } - - protected void handleResourceModified(IResource resource) { - try { - resource.accept(new IResourceVisitor() { - public boolean visit(IResource aresource) throws CoreException { - if (aresource.getType() != IResource.ROOT && AbstractTaglibRegistry.this.project != aresource.getProject()) - return false; - - if (aresource.getType() == IResource.FILE) { - processFile(aresource); - return false; - } - if (shouldProcessDirectory(aresource)) { - processDirectory(aresource); - } - return (canVisitResource(aresource)); - - } - - - }); - } catch (CoreException e) { - Logger.getLogger().log(e); - } - } - - /** - * Return true if the resource and its children should be visited - * - * @param resource - * @return - */ - protected boolean canVisitResource(IResource resource) { - if (resource.getType() != IResource.ROOT && this.project != resource.getProject()) - return false; - if (resource.getType() != IResource.FILE) - return true; - return true; - } - - protected void handleResourceRemoved(IResource resource) { - IPath location = resource.getProjectRelativePath(); - ITaglibInfo[] removedTaglibs = removeTaglibs(location); - if (removedTaglibs != null) { - for (int i = 0; i < removedTaglibs.length; i++) { - ITaglibInfo iTaglibInfo = removedTaglibs[i]; - if (debug) - System.out.println("TaglibRegistry.handleResourceRemoved taglib removed: " + iTaglibInfo); //$NON-NLS-1$ - fireTaglibRemoved(iTaglibInfo); - } - } - } - - protected IResource getRefreshRoot() { - return getProject(); - } - - public void refresh() { - this.taglibs = new Vector(); - IResource refreshRoot = getRefreshRoot(); - - // RATLC00974251 for a java project before build is done, output location does not exist - if (refreshRoot != null) - handleResourceAdded(refreshRoot); - - this.needsRefresh = false; - } - - protected void updateAll() { - try { - IResource refreshRoot = getRefreshRoot(); - - // RATLC00974251 for a java project before build is done, output location does not exist - if (refreshRoot == null) - return; - refreshRoot.accept(new IResourceVisitor() { - public boolean visit(IResource resource) throws CoreException { - handleResourceModified(resource); - return true; - } - }); - } catch (CoreException e) { - //Do nothing - } - } - - /** - * Remove all the taglibs associated with the location. - * - * @param location - * @return ITaglibInfo[] The taglibs that are removed. Null if none are removed. - */ - protected ITaglibInfo[] removeTaglibs(IPath location) { - List results = new ArrayList(); - - boolean isWebXML = isWebXMLFile(location); - for (int i = 0; i < this.taglibs.size(); i++) { - ITaglibInfo taglib = (ITaglibInfo) this.taglibs.get(i); - if (isWebXML) { - if (taglib.isWebXMLEntry()) { - removeTaglib(i); - results.add(taglib); - i--; - } - } else if (taglib.getLocation().equals(location)) { - removeTaglib(i); - results.add(taglib); - i--; - } - } - return results.isEmpty() ? null : (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - abstract protected boolean requiresFullUpdate(IResourceDelta delta); - - protected void removeTaglib(int i) { - this.taglibs.remove(i); - } - - protected ITaglibInfo[] searchForTaglibs(IResource resource) { - ArrayList results = new ArrayList(); - for (int i = 0; i < this.locators.length; i++) { - ITaglibLocator tLocator = this.locators[i]; - ITaglibInfo[] tTaglibs = tLocator.search(resource); - if (tTaglibs != null) { - for (int j = 0; j < tTaglibs.length; j++) { - results.add(tTaglibs[j]); - } - } - } - return (ITaglibInfo[]) results.toArray(new ITaglibInfo[results.size()]); - } - - /* - * @see ITaglibRegistry#removeTaglibRegistryListener(ITaglibRegistryListener) - */ - public void removeTaglibRegistryListener(ITaglibRegistryListener listener) { - if (this.listeners == null) - return; - this.listeners.remove(listener); - } - - /* - * @see Object#toString() - */ - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("TaglibRegistry: \n"); //$NON-NLS-1$ - for (Iterator iter = this.taglibs.iterator(); iter.hasNext();) { - ITaglibInfo taglib = (ITaglibInfo) iter.next(); - sb.append("\t"); //$NON-NLS-1$ - sb.append(taglib); - sb.append("\n"); //$NON-NLS-1$ - } - return sb.toString(); - } - - protected void processDirectory(IResource resource) { - // do nothing - } - - protected boolean shouldProcessDirectory(IResource resource) { - return true; - } - - /** - * @param resource - */ - protected void processFile(IResource resource) { - Vector existingTaglibs = getExistingTaglibs(resource.getProjectRelativePath()); - ITaglibInfo[] newTaglibs = searchForTaglibs(resource); - - for (int i = 0; i < newTaglibs.length; i++) { - ITaglibInfo newTaglib = newTaglibs[i]; - int existingIndex = existingTaglibs.indexOf(newTaglib); - if (existingIndex >= 0) { - // If its an exact match, leave it in alone the taglibs registry - // but fire a taglibChangedEvent. - if (!newTaglib.isWebXMLEntry()) - fireTaglibChanged(newTaglib); - existingTaglibs.remove(existingIndex); - } else { - // The taglib did not exist previously in the list, add it and - // fire a taglibAdded event. - addTaglib(newTaglib); - fireTaglibAdded(newTaglib); - } - } - - for (Iterator iter = existingTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo remainingTaglib = (ITaglibInfo) iter.next(); - this.taglibs.remove(remainingTaglib); - fireTaglibRemoved(remainingTaglib); - } - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/JavaTaglibRegistry.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/JavaTaglibRegistry.java deleted file mode 100644 index 457634864..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/JavaTaglibRegistry.java +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib.registry; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.internal.web.locator.JavaProjectTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibLocator; - - -public class JavaTaglibRegistry extends AbstractTaglibRegistry { - - protected IPath classpathFilePath; - - /** - * Constructor for JavaTaglibRegistry. - * - * @param project - */ - public JavaTaglibRegistry(IProject project) { - super(project); - } - - protected void initialize() { - this.locators = new ITaglibLocator[]{new JavaProjectTaglibLocator(this.project)}; - } - - protected boolean isWebXMLFile(IPath filePath) { - return false; - } - - protected IPath getClasspathFilePath() { - if (this.classpathFilePath == null) - this.classpathFilePath = getProject().getFullPath().append(".classpath"); //$NON-NLS-1$ - return this.classpathFilePath; - } - - protected IJavaProject getJavaProject() { - return JavaCore.create(getProject()); - } - - protected IResource getRefreshRoot() { - try { - return getProject().getWorkspace().getRoot().findMember(getJavaProject().getOutputLocation()); - } catch (JavaModelException e) { - //Do nothing - } - return getProject(); - } - - /** - * @see AbstractTaglibRegistry#requiresFullUpdate(IResourceDelta) - */ - protected boolean requiresFullUpdate(IResourceDelta delta) { - // If the websettings are updated, a full refresh is required. - return delta.getResource().getFullPath().equals(getClasspathFilePath()); - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/WebTaglibRegistry.java b/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/WebTaglibRegistry.java deleted file mode 100644 index 5e568983b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/taglib/org/eclipse/jst/j2ee/internal/web/taglib/registry/WebTaglibRegistry.java +++ /dev/null @@ -1,177 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.taglib.registry; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.Vector; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.web.locator.WebLibModuleTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.locator.WebProjectServerTargetTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.locator.WebProjectTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.locator.WebXMLTaglibLocator; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibInfo; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibLocator; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - - -public class WebTaglibRegistry extends AbstractTaglibRegistry { - - private ITaglibLocator libModuleLocator; - private ITaglibLocator serverTargetLocator; - private ITaglibLocator webProjectTaglibLocator; - - /** - * Constructor for WebTaglibRegistry. - * - * @param project - */ - public WebTaglibRegistry(IProject project) { - super(project); - } - - protected void initialize() { - // the reason these two locators are not part of the list is they are per file locator but - // per project - this.libModuleLocator = new WebLibModuleTaglibLocator(this.project); - this.serverTargetLocator = new WebProjectServerTargetTaglibLocator(this.project); - this.webProjectTaglibLocator = new WebProjectTaglibLocator(this.project); - this.locators = new ITaglibLocator[]{this.webProjectTaglibLocator, new WebXMLTaglibLocator(this.project)}; - } - - protected boolean isWebXMLFile(IPath filePath) { - IPath webAppDDPath = getWebDeploymentDescriptorPath(); - return webAppDDPath.removeFirstSegments(1).equals(filePath); - } - - protected boolean requiresFullUpdate(IResourceDelta delta) { - // TODO figure out context root change to update the tag libs - // If the context root is updated, a full refresh is required. - //if (delta != null) - // return delta.getResource().getFullPath().equals(getWTPModuleFile()); - return false; - } - - /* - * (non-Javadoc) we need to return the Resource/folder from where taglib search begins and for a - * web project we can make it faster by searching from WEB-INF folder - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.registry.AbstractTaglibRegistry#getRefreshRoot() - */ - protected IResource getRefreshRoot() { - return project; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.registry.AbstractTaglibRegistry#shouldProcessDirectory() - */ - protected boolean shouldProcessDirectory(IResource resource) { - IContainer tagsFolder = getTagsFolder(); - if (tagsFolder != null && tagsFolder.getProjectRelativePath().equals(resource.getProjectRelativePath())) { - return true; - } - return false; - - } - - private IContainer getTagsFolder() { - IContainer webinf = (IContainer) getRefreshRoot(); - if (webinf != null) { - IResource tagsFolder = webinf.findMember("tags"); //$NON-NLS-1$ - if (tagsFolder != null && tagsFolder instanceof IContainer) - return (IContainer) tagsFolder; - } - return null; - } - - /* - * (non-Javadoc) return true only if the resource is a parent of WEB-INF or is within WEB-INF - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.registry.AbstractTaglibRegistry#canVisitResource(org.eclipse.core.resources.IResource) - */ - protected boolean canVisitResource(IResource resource) { - if (resource != null && resource.getType() != IResource.ROOT && this.project != resource.getProject()) - return false; - - IResource webinf = getRefreshRoot(); - // resource within WEB-INF - if (webinf != null && resource != null && webinf.getProjectRelativePath().isPrefixOf(resource.getProjectRelativePath())) - return true; - // resource parent of WEB-INF - else if (webinf != null && resource != null && resource.getProjectRelativePath().isPrefixOf(webinf.getProjectRelativePath())) - return true; - // some other branch - else - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.taglib.registry.AbstractTaglibRegistry#processDirectory(org.eclipse.core.resources.IResource) - */ - protected void processDirectory(IResource resource) { - Vector existingTaglibs = getExistingTaglibs(resource.getProjectRelativePath()); - ITaglibInfo[] newTaglibs = this.webProjectTaglibLocator.search(resource); - - for (int i = 0; i < newTaglibs.length; i++) { - ITaglibInfo newTaglib = newTaglibs[i]; - int existingIndex = existingTaglibs.indexOf(newTaglib); - if (existingIndex >= 0) { - // If its an exact match, leave it in alone the taglibs registry - // but fire a taglibChangedEvent. - if (!newTaglib.isWebXMLEntry()) - fireTaglibChanged(newTaglib); - existingTaglibs.remove(existingIndex); - } else { - // The taglib did not exist previously in the list, add it and - // fire a taglibAdded event. - addTaglib(newTaglib); - fireTaglibAdded(newTaglib); - } - } - - for (Iterator iter = existingTaglibs.iterator(); iter.hasNext();) { - ITaglibInfo remainingTaglib = (ITaglibInfo) iter.next(); - this.taglibs.remove(remainingTaglib); - fireTaglibRemoved(remainingTaglib); - } - - } - - protected Vector primGetTaglibs() { - // Check to see if there are any lib modules, if so, we must check to see - // if there are any taglibs in these and concat the results. - Vector results = new Vector(); - results.addAll(super.primGetTaglibs()); - - results.addAll(Arrays.asList(this.libModuleLocator.search(this.project))); - results.addAll(Arrays.asList(this.serverTargetLocator.search(this.project))); - return results; - } - - protected IPath getWebDeploymentDescriptorPath() { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - return webEdit.getDeploymentDescriptorPath(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/templates/servletHeader.template b/plugins/org.eclipse.jst.j2ee.web/templates/servletHeader.template deleted file mode 100644 index 3954ec642..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/templates/servletHeader.template +++ /dev/null @@ -1,37 +0,0 @@ -<% CreateServletTemplateModel model = (CreateServletTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") { %>package <%=model.getJavaPackageName()%>;<%}%>
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Servlet implementation class for Servlet: <%=model.getServletClassName()%>
- *
- * @web.servlet
- * name="<%=model.getServletName()%>"
- * display-name="<%=model.getServletName()%>" <%
- if (model.getServletDescription() !=null && model.getServletDescription() != "") { %>
- * description="<%=model.getServletDescription()%>" <% } %>
- *
- <% List mappings = model.getServletMappings();
- if (mappings!=null && mappings.size()>0) {
- for (int i=0; i<mappings.size(); i++) {
- String map = model.getServletMapping(i); %>
- * @web.servlet-mapping
- * url-pattern="<%=map%>"
- * <% } }
- List initParams = model.getInitParams();
- if (initParams!=null && initParams.size()>0) {
- for (int i=0; i<initParams.size(); i++) {
- String name = model.getInitParam(i,CreateServletTemplateModel.NAME);
- String value = model.getInitParam(i,CreateServletTemplateModel.VALUE);
- String description = model.getInitParam(i,CreateServletTemplateModel.DESCRIPTION); %>
- * @web.servlet-init-param
- * name="<%=name%>"
- * value="<%=value%>" <% if (description !=null && description!="") { %>
- * description="<%=description%>" <%} %>
- * <% } } %>
- */
-
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/templates/servletHeaderNonAnnotated.template b/plugins/org.eclipse.jst.j2ee.web/templates/servletHeaderNonAnnotated.template deleted file mode 100644 index ac27405c1..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/templates/servletHeaderNonAnnotated.template +++ /dev/null @@ -1,13 +0,0 @@ -<% CreateServletTemplateModel model = (CreateServletTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") { %>package <%=model.getJavaPackageName()%>;<%}%>
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Servlet implementation class for Servlet: <%=model.getServletClassName()%>
- *
- */
-
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/templates/servletXDoclet.javajet b/plugins/org.eclipse.jst.j2ee.web/templates/servletXDoclet.javajet deleted file mode 100644 index 42d15fb9d..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/templates/servletXDoclet.javajet +++ /dev/null @@ -1,81 +0,0 @@ -<%@ jet package="org.eclipse.jst.j2ee.web"
- imports="org.eclipse.jst.j2ee.internal.web.operations.* java.util.* "
- class="ServletTemplate"
-%><%@ include file="servletHeader.template" %>
-
-<%if (model.isPublic()) {%>public<%}%> <%if (model.isAbstract()) {%>abstract <%}%><%if (model.isFinal()) {%>final <%}
-%>class <%=model.getServletClassName()%> extends <%=model.getSuperclassName()%><%
- List interfaces = model.getInterfaces();
- if (interfaces.size()>0) {%> implements <% }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {
- /* (non-Java-doc)
- * @see javax.servlet.http.HttpServlet#HttpServlet()
- */
- public <%=model.getServletClassName()%>() {
- super();
- } <% if (model.shouldGenDestroy()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.Servlet#destroy()
- */
- public void destroy() {
- // TODO Auto-generated method stub
- super.destroy();
- } <% } %> <% if (model.shouldGenDoDelete()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.http.HttpServlet#doDelete(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
- */
- protected void doDelete(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- super.doDelete(arg0, arg1);
- } <% } %> <% if (model.shouldGenDoGet()) { %>
-
- /* (non-Java-doc)
- * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse arg1)
- */
- protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- } <% } %> <% if (model.shouldGenDoPost()) { %>
-
- /* (non-Java-doc)
- * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse arg1)
- */
- protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- } <% } %> <% if (model.shouldGenDoPut()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
- */
- protected void doPut(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- super.doPut(arg0, arg1);
- } <% } %> <% if (model.shouldGenGetServletInfo()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.Servlet#getServletInfo()
- */
- public String getServletInfo() {
- // TODO Auto-generated method stub
- return super.getServletInfo();
- } <% } %> <% if (model.shouldGenInit()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.GenericServlet#init()
- */
- public void init() throws ServletException {
- // TODO Auto-generated method stub
- super.init();
- } <% } %> <% if (model.shouldGenToString()) { %>
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- // TODO Auto-generated method stub
- return super.toString();
- } <% } %>
-}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/templates/servletXDocletNonAnnotated.javajet b/plugins/org.eclipse.jst.j2ee.web/templates/servletXDocletNonAnnotated.javajet deleted file mode 100644 index adf160eb9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/templates/servletXDocletNonAnnotated.javajet +++ /dev/null @@ -1,81 +0,0 @@ -<%@ jet package="org.eclipse.jst.j2ee.web"
- imports="org.eclipse.jst.j2ee.internal.web.operations.* java.util.* "
- class="ServletTemplate"
-%><%@ include file="servletHeaderNonAnnotated.template" %>
-
-<%if (model.isPublic()) {%>public<%}%> <%if (model.isAbstract()) {%>abstract <%}%><%if (model.isFinal()) {%>final <%}
-%>class <%=model.getServletClassName()%> extends <%=model.getSuperclassName()%><%
- List interfaces = model.getInterfaces();
- if (interfaces.size()>0) {%> implements <% }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {
- /* (non-Java-doc)
- * @see javax.servlet.http.HttpServlet#HttpServlet()
- */
- public <%=model.getServletClassName()%>() {
- super();
- } <% if (model.shouldGenDestroy()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.Servlet#destroy()
- */
- public void destroy() {
- // TODO Auto-generated method stub
- super.destroy();
- } <% } %> <% if (model.shouldGenDoDelete()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.http.HttpServlet#doDelete(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
- */
- protected void doDelete(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- super.doDelete(arg0, arg1);
- } <% } %> <% if (model.shouldGenDoGet()) { %>
-
- /* (non-Java-doc)
- * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse arg1)
- */
- protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- } <% } %> <% if (model.shouldGenDoPost()) { %>
-
- /* (non-Java-doc)
- * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse arg1)
- */
- protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- } <% } %> <% if (model.shouldGenDoPut()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
- */
- protected void doPut(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
- // TODO Auto-generated method stub
- super.doPut(arg0, arg1);
- } <% } %> <% if (model.shouldGenGetServletInfo()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.Servlet#getServletInfo()
- */
- public String getServletInfo() {
- // TODO Auto-generated method stub
- return super.getServletInfo();
- } <% } %> <% if (model.shouldGenInit()) { %>
-
- /* (non-Javadoc)
- * @see javax.servlet.GenericServlet#init()
- */
- public void init() throws ServletException {
- // TODO Auto-generated method stub
- super.init();
- } <% } %> <% if (model.shouldGenToString()) { %>
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- // TODO Auto-generated method stub
- return super.toString();
- } <% } %>
-}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/UIWarHelper.java b/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/UIWarHelper.java deleted file mode 100644 index 6ef962712..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/UIWarHelper.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.validation; - -import java.util.Hashtable; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - - -/** - * Insert the type's description here. Creation date: (10/2/2001 7:06:43 PM) - * - * @author: Administrator - */ -public class UIWarHelper extends WarHelper { - - Hashtable aWarFileMap = new Hashtable(); - - /** - * UIWarHelper constructor comment. - */ - public UIWarHelper() { - super(); - } - - /** - * - * This is a war specific helper, get file here always mean get web.xml . - * - * @param object - * org.omg.CORBA.Object - */ - public IFile getFile(Object object) { - - IFile warFile; - IProject project = getProject(); - - warFile = (IFile) aWarFileMap.get(project.toString()); - if (warFile != null) - return warFile; - - IPath path = getDeploymentDescriptorPath(project); - IPath projectPath = project.getFullPath(); - path = path.removeFirstSegments(path.matchingFirstSegments(projectPath)); // make it relative - warFile = project.getFile(path); - aWarFileMap.put(project.toString(), warFile); - - return warFile; - } - - protected IPath getDeploymentDescriptorPath(IProject project) { - WebArtifactEdit webArtifactEdit = null; - try { - webArtifactEdit = (WebArtifactEdit)StructureEdit.getFirstArtifactEditForRead(project); - if (webArtifactEdit != null) - return webArtifactEdit.getDeploymentDescriptorPath(); - } finally { - if (webArtifactEdit!=null) - webArtifactEdit.dispose(); - } - return null; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/UIWarValidator.java b/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/UIWarValidator.java deleted file mode 100644 index f1b48e409..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/UIWarValidator.java +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.validation; - - - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.j2ee.model.internal.validation.WarValidator; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.validation.core.IFileDelta; -import org.eclipse.wst.validation.core.IValidationContext; -import org.eclipse.wst.validation.core.IReporter; -import org.eclipse.wst.validation.core.ValidationException; -import org.eclipse.wst.validation.internal.operations.IWorkbenchHelper; - - -/** - * Insert the type's description here. Creation date: (10/2/2001 6:46:56 PM) - * - * @author: Administrator - */ -public class UIWarValidator extends WarValidator { - /** - * Method validateLibModules. - * - * - */ - - //TODO create validation for modules -/* protected void validateLibModules(J2EEWebNatureRuntime webNature) { - if (webNature != null) { - ILibModule[] libModules = webNature.getLibModules(); - IProject project = webNature.getProject(); - - for (int i = 0; i < libModules.length; i++) { - ILibModule lib = libModules[i]; - IProject tProject = lib.getProject(); - if (tProject != null) { // Project could be null if JavaProject is deleted, for - // example - if (!tProject.exists() || !tProject.isOpen()) { - addWarning(WAR_CATEGORY, MESSAGE_WAR_VALIDATION_MISSING_WLP_PROJECT, new String[]{tProject.getName()}, webNature.getProject()); - } - } - - String jarName = lib.getJarName(); - IPath jarPath = webNature.getLibraryFolder().getFullPath().append(jarName); - if (((Resource) project).findExistingResourceVariant(jarPath) != null) - addWarning(WAR_CATEGORY, MESSAGE_WAR_VALIDATION_CONFLICTING_WLP_PROJECT, new String[]{jarName}, webNature.getProject()); - } - } - }*/ - - protected org.eclipse.jst.j2ee.internal.web.validation.UIWarHelper warHelper; - - /** - * UIWarValidator constructor comment. - */ - public UIWarValidator() { - super(); - } - - /** - * Insert the method's description here. Creation date: (10/2/2001 8:01:45 PM) - * - * @return org.eclipse.wst.validation.internal.core.core.war.workbenchimpl.UIWarHelper - */ - public org.eclipse.jst.j2ee.internal.web.validation.UIWarHelper getWarHelper() { - return warHelper; - } - - /** - * Insert the method's description here. Creation date: (10/2/2001 8:01:45 PM) - * - * @param newWarHelper - * org.eclipse.wst.validation.internal.core.core.war.workbenchimpl.UIWarHelper - */ - public void setWarHelper(org.eclipse.jst.j2ee.internal.web.validation.UIWarHelper newWarHelper) { - warHelper = newWarHelper; - } - - /** - * Insert the method's description here. Creation date: (10/2/2001 6:49:26 PM) - */ - public void validate() throws ValidationException { - // First remove all previous msg. for this project - // _reporter.removeAllMessages(this,null); - super.validate(); - validateEARForContextRoot(); - } - - /** - * Insert the method's description here. Creation date: (10/2/2001 6:49:26 PM) - */ - public void validate(IValidationContext inHelper, IReporter inReporter, IFileDelta[] inChangedFiles) throws org.eclipse.wst.validation.core.ValidationException { - setWarHelper((UIWarHelper) inHelper); - IProject proj = ((IWorkbenchHelper) inHelper).getProject(); - WorkbenchComponent[] workBenchModules = null; - StructureEdit moduleCore = null; - try{ - moduleCore = StructureEdit.getStructureEditForRead(proj); - workBenchModules = moduleCore.getWorkbenchModules(); - for (int i = 0; i < workBenchModules.length; i++) { - WorkbenchComponent wbModule = workBenchModules[i]; - WebArtifactEdit webEdit = null; - try{ - webEdit = WebArtifactEdit.getWebArtifactEditForRead(wbModule ); - if(webEdit != null) { - WebApp webApp = (WebApp) webEdit.getDeploymentDescriptorRoot(); - super.validate(inHelper, inReporter, inChangedFiles, webApp); - } - } - catch(Exception e){ - e.printStackTrace(); - } finally { - if(webEdit != null) - webEdit.dispose(); - } - } - } finally { - if(moduleCore != null) - moduleCore.dispose(); - } - } - - - - /** - * Insert the method's description here. Creation date: (10/2/2001 6:49:26 PM) - */ - public void validateEARForContextRoot() { - -// IProject project = getWarHelper().getProject(); -// J2EEWebNatureRuntime webNature = J2EEWebNatureRuntime.getRuntime(project); -// String contextRoot = webNature.getContextRoot(); -// -// if (webNature == null) -// return; -// -// EARNatureRuntime earRuntimeNature[] = webNature.getReferencingEARProjects(); - -// for (int i = 0; i < earRuntimeNature.length; i++) { -// // for each Ear Project that contains this web project update the context root. -// // hold the model and validate the context root & release the model -// org.eclipse.jst.j2ee.internal.earcreation.EAREditModel editModel = null; -// try { -// editModel = earRuntimeNature[i].getEarEditModelForRead(this); -// if (editModel != null) { -// Module module = null; -// if ((module = earRuntimeNature[i].getModule(project)) != null) { -// String webModcontextRoot = ((WebModule) module).getContextRoot(); -// if (webModcontextRoot != null && !webModcontextRoot.equals(contextRoot)) { -// String[] params = new String[3]; -// params[0] = project.getName(); -// params[1] = ((WebModule) module).getContextRoot(); -// params[2] = earRuntimeNature[i].getProject().getName(); -// addError(WAR_CATEGORY, ERROR_EAR_INVALID_CONTEXT_ROOT, params); -// } -// } -// } -// } finally { -// if (editModel != null) { -// editModel.releaseAccess(this); -// editModel = null; -// } -// } -// -// } - - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/WarHelper.java b/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/WarHelper.java deleted file mode 100644 index da6e88b40..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/war-validation/org/eclipse/jst/j2ee/internal/web/validation/WarHelper.java +++ /dev/null @@ -1,127 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.validation; - - - -//import org.eclipse.wst.validation.internal.core.core.IMessage; -import java.util.Hashtable; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.internal.validation.J2EEValidationHelper; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WTProjectLoadStrategyImpl; -import org.eclipse.jst.j2ee.model.internal.validation.WARMessageConstants; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - - -public class WarHelper extends J2EEValidationHelper { - Hashtable warFileMap = new Hashtable(); - final static String HelperID = "org.eclipse.wst.validation.internal.core.war.workbenchimpl.WarHelper"; //$NON-NLS-1$ - - /** - * WarHelper constructor comment. - */ - - public WarHelper() { - super(); - - registerModel(WARMessageConstants.WAR_MODEL_NAME, "loadWarFile"); //$NON-NLS-1$ - } - - /** - * This method will be invoked indirectly from the WarValidator (via. the WorkbenchReporter). It - * will expect the coming object to be a EObject for the node who generated this message. Note: - * This methods may need to be implemented higher up in the class stack. - */ - public int getLineNo(Object object) { - - - if (object instanceof Integer) { // Error discovered using the XML parser - return ((Integer) object).intValue(); - } - - return super.getLineNo(object); - } - - /** - * Given a resource, return its non-eclipse-specific location. If this resource, or type of - * resource, isn't handled by this helper, return null. - */ - public String getPortableName(IResource resource) { - if (!(resource instanceof IFile)) { - return null; - } - - IPath resourcePath = resource.getFullPath(); - if (resourcePath != null) - return resourcePath.toString(); - - return null; - } - - /** - * Similar to the getFile() method, we know that we are talking about web.xml, but need a unique - * ID. - * - * @return java.lang.String - * @param object - * Object - */ - public String getTargetObjectName(Object object) { - String ret = null; - if (object != null) { - IFile warFile = (IFile) warFileMap.get(getProject().toString());// validator framework - // will call getFile() - // first. - if (warFile != null) { - ret = (warFile.toString() + HelperID); - } - } - return ret; - } - - /** - * Get the WAR file for validation - */ - - public EObject loadWarFile() { - IProject proj = getProject(); - if (proj == null) - return null; - // openFilesCache = new ArrayList(); - WARFile warFile = null; // Default return value. - WebArtifactEdit webEdit = null; - Resource webDD = null; - try { - WTProjectLoadStrategyImpl loader = new WTProjectLoadStrategyImpl(proj); - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(proj); - if (webEdit != null) - webDD = webEdit.getDeploymentDescriptorResource(); - loader.setResourceSet(webDD.getResourceSet()); - warFile = ((CommonarchivePackage) EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory().openWARFile(loader, proj.getName()); - //openFilesCache.add(warFile); - } catch (Exception e) { - e.printStackTrace(); - } finally{ - if( webEdit != null ) - webEdit.dispose(); - } - return warFile; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java deleted file mode 100644 index d7924f3c4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java +++ /dev/null @@ -1,417 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.deployables; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable; -import org.eclipse.jst.j2ee.internal.deployables.LooseArchiveDeployable; -import org.eclipse.jst.j2ee.internal.deployables.LooseArchiveDeployableFactory; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.server.core.ILooseArchive; -import org.eclipse.jst.server.core.ILooseArchiveSupport; -import org.eclipse.jst.server.core.IWebModule; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IModuleType; -import org.eclipse.wst.web.internal.operation.ILibModule; - -/** - * @version 1.0 - * @author - */ -public class J2EEFlexProjWebDeployable extends J2EEFlexProjDeployable implements IWebModule, ILooseArchiveSupport, IModuleType { - protected String contextRoot; - - protected ILooseArchive[] archives; - private IPath rootfolder = null; - - protected Map uris = new HashMap(); - - public static final String WEB_MODULE_TYPE = "jst.web"; - - - - /** - * @param aNature - * @param aFactoryId - */ - public J2EEFlexProjWebDeployable(IProject project, String aFactoryId, WorkbenchComponent aWorkbenchModule) { - super(project, aFactoryId, aWorkbenchModule); - this.contextRoot = getUncachedContextRoot(); - } - - public String getId() { - return getProject().getName(); - } - - public String getContextRoot() { - return wbModule.getName(); - } - - - - public String getUncachedContextRoot() { - //return getWebNature().getContextRoot(); - - return project.getName(); - - } - - - - - public String getJ2EESpecificationVersion() { - String Version = "1.2"; //$NON-NLS-1$ - - WebArtifactEdit webEdit = null; - try{ - webEdit = WebArtifactEdit.getWebArtifactEditForRead( wbModule ); - if(webEdit != null) { - int nVersion = webEdit.getJ2EEVersion(); - switch( nVersion ){ - case 12: - Version = IModuleConstants.J2EE_VERSION_1_2; - break; - case 13: - Version = IModuleConstants.J2EE_VERSION_1_3; - break; - case 14: - Version = IModuleConstants.J2EE_VERSION_1_4; - break; - default: - Version = IModuleConstants.J2EE_VERSION_1_2; - break; - } - } - } - catch(Exception e){ - e.printStackTrace(); - } finally { - if(webEdit != null) - webEdit.dispose(); - } - - return Version; - } - - public String getJSPFileMapping(String jspFile) { - return null; - } - - private int getServletVersion(){ - WebArtifactEdit webEdit = null; - int nVersion = 22; - try{ - webEdit = WebArtifactEdit.getWebArtifactEditForRead( wbModule ); - if(webEdit != null) { - nVersion = webEdit.getServletVersion(); - } - } - catch(Exception e){ - e.printStackTrace(); - } finally { - if(webEdit != null) - webEdit.dispose(); - } - return nVersion; - } - - public String getJSPSpecificationVersion() { - - String ret = "1.2"; //$NON-NLS-1$ - int nVersion = getServletVersion(); - switch( nVersion ){ - - case 22: - ret = IModuleConstants.JSP_VERSION_1_1; - break; - case 23: - ret = IModuleConstants.JSP_VERSION_1_2; - break; - case 24: - ret = IModuleConstants.JSP_VERSION_2_0; - break; - default: - ret = IModuleConstants.JSP_VERSION_1_1; - break; - } - return ret; - } - - public String getServletSpecificationVersion() { - - String ret = "2.3"; //$NON-NLS-1$ - int nVersion = getServletVersion(); - switch( nVersion ){ - - case 22: - ret = IModuleConstants.SERVLET_VERSION_2_2; - break; - case 23: - ret = IModuleConstants.SERVLET_VERSION_2_3; - break; - case 24: - ret = IModuleConstants.SERVLET_VERSION_2_4; - break; - default: - ret = IModuleConstants.SERVLET_VERSION_2_3; - break; - } - return ret; - } - - - public String getServletMapping(String className) { - return null; - } - - - public boolean isPublishRequired() { - return false; - } - - protected LooseArchiveDeployableFactory getLooseArchiveDeployableFactory() { - /* - * Iterator factories = - * Arrays.asList(ServerCore.getModuleFactories()).iterator(); while - * (factories.hasNext()) { ModuleFactory deployableFactory = - * (ModuleFactory) factories.next(); ModuleFactoryDelegate - * deployableFactoryDelegate = deployableFactory.getDelegate(); if - * (deployableFactoryDelegate instanceof LooseArchiveDeployableFactory) - * return (LooseArchiveDeployableFactory) deployableFactoryDelegate; } - */ - return null; - } - -/* protected ILooseArchive getArchiveDeployable(IProject aProject, LooseArchiveDeployableFactory fact) { - return (ILooseArchive) fact.getModuleProject(aProject); - }*/ - - protected ILibModule[] getLibModules() { - return null; - } - - public ILooseArchive[] getLooseArchives() { - return this.archives; - } - - /* - * @see com.ibm.etools.server.core.util.DeployableProject#getRootFolder() - */ - - - - public ILooseArchive[] getUncachedLooseArchives() { - ILibModule[] libModules = getLibModules(); - if (libModules == null) - return null; - - LooseArchiveDeployableFactory fact = getLooseArchiveDeployableFactory(); - if (fact == null) - return null; - - List arcs = new ArrayList(libModules.length); - for (int i = 0; i < libModules.length; i++) { - ILibModule libModule = libModules[i]; - IProject proj = libModule.getProject(); - /* if (proj != null && proj.exists()) - arcs.add(getArchiveDeployable(proj, fact));*/ - } - ILooseArchive[] result = new ILooseArchive[arcs.size()]; - arcs.toArray(result); - return result; - } - - public String getURI(ILooseArchive jar) { - try { - return (String) this.uris.get(jar); - } catch (Exception e) { - // ignore - } - return null; - } - - public String getUncachedURI(ILooseArchive jar) { - if (!(jar instanceof LooseArchiveDeployable)) - return null; - - LooseArchiveDeployable dep = (LooseArchiveDeployable) jar; - IProject proj = dep.getProject(); - return getURI(proj); - } - - protected String getURI(IProject looseJARProject) { - return null; - } - - public boolean isBinary() { - return false; - } - - protected void update() { - ILooseArchive[] oldArchives = this.archives; - this.archives = getUncachedLooseArchives(); - if (this.archives == null) - this.archives = new ILooseArchive[0]; - String oldContextRoot = this.contextRoot; - this.contextRoot = getUncachedContextRoot(); - - boolean changed = false; - if (oldContextRoot == null && this.contextRoot != null) - changed = true; - else if (oldContextRoot != null && !oldContextRoot.equals(this.contextRoot)) - changed = true; - - // fire remove events - List add = new ArrayList(2); - addRemovedObjects(add, oldArchives, this.archives); - - // fire add events - List remove = new ArrayList(2); - addAddedObjects(remove, oldArchives, this.archives); - - // fire change events - int size = this.archives.length; - List change = new ArrayList(size); - for (int i = 0; i < size; i++) { - String newURI = getUncachedURI(this.archives[i]); - String oldURI = getURI(this.archives[i]); - - if (oldURI != null && !oldURI.equals(newURI)) { - change.add(this.archives[i]); - } - this.uris.put(this.archives[i], newURI); - } - - if (!add.isEmpty() || !remove.isEmpty() || !change.isEmpty() || changed) { - IModule[] added = new IModule[add.size()]; - add.toArray(added); - IModule[] changed2 = new IModule[change.size()]; - change.toArray(changed2); - IModule[] removed = new IModule[remove.size()]; - remove.toArray(removed); - fireModuleChangeEvent(changed, added, changed2, removed); - } - } - - /** - * Return the objects that have been added between array a and array b. - * Assumes that there are no null objects in the array. - */ - protected static void addAddedObjects(List list, Object[] a, Object[] b) { - if (b == null) - return; - else if (a == null) { - int size = b.length; - for (int i = 0; i < size; i++) - list.add(b[i]); - return; - } - int size = b.length; - for (int i = 0; i < size; i++) { - Object obj = b[i]; - boolean found = false; - if (a != null) { - int size2 = a.length; - for (int j = 0; !found && j < size2; j++) { - if (obj != null && obj.equals(a[j])) - found = true; - } - } - if (!found) - list.add(obj); - } - } - - /** - * Return the objects that have been removed between array a and array b. - * Assumes that there are no null objects in the array. - */ - protected static void addRemovedObjects(List list, Object[] a, Object[] b) { - if (a == null) - return; - else if (b == null) { - int size = a.length; - for (int i = 0; i < size; i++) - list.add(a[i]); - return; - } - int size = a.length; - for (int i = 0; i < size; i++) { - Object obj = a[i]; - boolean found = false; - if (b != null) { - int size2 = b.length; - for (int j = 0; !found && j < size2; j++) { - if (obj != null && obj.equals(b[j])) - found = true; - } - } - if (!found) - list.add(obj); - } - } - - public String getType() { - return "j2ee.web"; //$NON-NLS-1$ - } - - public String getVersion() { - - return "1.2"; //$NON-NLS-1$ - } - - /** - * Returns the child modules of this module. - * - * @return com.ibm.wtp.server.core.model.IModule[] - */ - public IModule[] getChildModules() { - List list = new ArrayList(); - - if (this.archives != null) { - int size = this.archives.length; - for (int i = 0; i < size; i++) - list.add(this.archives[i]); - } - - IModule[] children = new IModule[list.size()]; - list.toArray(children); - return children; - } - - - public String getModuleTypeName(){ - return getName(); - } - - public String getModuleTypeVersion(){ - return getVersion(); - } - - public IPath getRootfolder() { -// if (ModuleCoreNature.getModuleCoreNature(project) != null ) { -// if (wbModule != null ) { -// IFolder outputContainer = ModuleCore.getOutputContainerRoot(wbModule); -// IPath path = outputContainer.getProjectRelativePath(); -// } -// } - return rootfolder; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/ModuleAdapter.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/ModuleAdapter.java deleted file mode 100644 index 4286d3717..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/ModuleAdapter.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Created on Feb 8, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.deployables; - -import org.eclipse.emf.common.notify.impl.AdapterImpl; - -/** - * @author blancett - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class ModuleAdapter extends AdapterImpl { - - J2EEFlexProjWebDeployable delegate; - - public void setModuleDelegate(J2EEFlexProjWebDeployable moduleDelegate) { - delegate = moduleDelegate; - } - - public J2EEFlexProjWebDeployable getDelegate() { - return delegate; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployable.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployable.java deleted file mode 100644 index 23f4c257e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployable.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.deployables; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.util.ProjectModule; - -public abstract class WebDeployable extends ProjectModule implements IModule, IWebNatureConstants { - - public WebDeployable(IProject project) { - super(project); - //setWebNature(getWebNature()); - } - -// protected IBaseWebNature getWebNature() { -// return J2EEWebNatureRuntimeUtilities.getRuntime(this.project); -// } - - public String getFactoryId() { - return "com.ibm.wtp.web.server"; //$NON-NLS-1$ - } - - /** - * Sets the nature. - * - * @param nature - * The nature to set - */ -// protected void setWebNature(IBaseWebNature nature) { -// nature.setModule(this); -// } - - /** - * Returns true if this deployable currently exists, and false if it has been deleted or moved - * and is no longer represented by this deployable. - * - * @return boolean - */ - public boolean exists() { - if (getProject() == null || !getProject().exists()) - return false; - try { - return (this.project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)); - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - /** - * @see com.ibm.etools.server.core.util.DeployableProject#getRootFolder() - */ - public IPath getRootFolder() { - //To Do: Needs rework based on module - //return getWebNature().getRootPublishableFolder().getProjectRelativePath(); - return null; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactAdapterFactory.java deleted file mode 100644 index 3dfa57683..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactAdapterFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Created on Jan 18, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.deployables; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.debug.ui.actions.ILaunchable; -import org.eclipse.wst.server.core.IModuleArtifact; -import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate; - -public class WebDeployableArtifactAdapterFactory extends ModuleArtifactAdapterDelegate implements IAdapterFactory { - - public Object getAdapter(Object adaptableObject, Class adapterType) { - return null; - } - - public Class[] getAdapterList() { - return new Class[]{ILaunchable.class}; - } - - - public IModuleArtifact getModuleArtifact(Object obj) { - return WebDeployableArtifactUtil.getModuleObject(obj); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java deleted file mode 100644 index a8578b022..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableArtifactUtil.java +++ /dev/null @@ -1,364 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.deployables; - -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.core.runtime.Path; -import org.eclipse.emf.ecore.EObject; -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.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.web.jfaces.extension.FileURL; -import org.eclipse.jst.j2ee.internal.web.jfaces.extension.FileURLExtensionReader; -import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntime; -import org.eclipse.jst.j2ee.internal.web.operations.J2EEWebNatureRuntimeUtilities; -import org.eclipse.jst.j2ee.internal.web.operations.WebEditModel; -import org.eclipse.jst.j2ee.webapplication.JSPType; -import org.eclipse.jst.j2ee.webapplication.Servlet; -import org.eclipse.jst.j2ee.webapplication.ServletMapping; -import org.eclipse.jst.j2ee.webapplication.ServletType; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebType; -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.util.WebResource; -import org.eclipse.wst.web.internal.operation.IBaseWebNature; - -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; - -/** - * @version 1.0 - * @author - */ -public class WebDeployableArtifactUtil { - private final static String[] extensionsToExclude = new String[]{"sql", "xmi"}; //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * Constructor for WebDeployableObjectAdapter. - */ - public WebDeployableArtifactUtil() { - super(); - } - - /* - * @see IDeployableObjectAdapterDelegate#getDeployableObject(Object) - */ - public static IModuleArtifact getModuleObject(Object obj) { - IResource resource = null; - if (obj instanceof IResource) - resource = (IResource) obj; - else if (obj instanceof IAdaptable) - resource = (IResource) ((IAdaptable) obj).getAdapter(IResource.class); - else if (obj instanceof EObject) { - resource = ProjectUtilities.getProject((EObject) obj); - - /* - * ccc - this code is a pseudo-rehash of the code below. The difference is that we have - * a Servlet, instead of an IResource that might be a Servlet - */ - if (obj instanceof Servlet) { - String mapping = null; - java.util.List mappings = ((Servlet) obj).getMappings(); - if (mappings != null && !mappings.isEmpty()) { - ServletMapping map = (ServletMapping) mappings.get(0); - mapping = map.getUrlPattern(); - } - if (mapping != null) { - return new WebResource(getModule(resource.getProject()), new Path(mapping)); - } - WebType webType = ((Servlet) obj).getWebType(); - if (webType.isJspType()) { - //TODO ArtifactWebEdit - //resource = ((IProject) resource).getFile(webNature.getModuleServerRootName() + "/" + ((JSPType) webType).getJspFile()); //$NON-NLS-1$ - } else if (webType.isServletType()) { - return new WebResource(getModule(resource.getProject()), new Path("servlet/" + ((ServletType) webType).getClassName())); //$NON-NLS-1$ - } - } - } - if (resource == null) - return null; - - /* // find deployable - IBaseWebNature webNature = J2EEWebNatureRuntimeUtilities.getRuntime(resource.getProject()); - if (webNature == null) - return null;*/ - - if (resource instanceof IProject) - return new WebResource(getModule(resource.getProject()), new Path("")); //$NON-NLS-1$ - - String className = getServletClassName(resource); - if (className != null) { - String mapping = getServletMapping(resource.getProject(), true, className); - if (mapping != null) { - return new WebResource(getModule(resource.getProject()), new Path(mapping)); - } - // if there is no servlet mapping, provide direct access to the servlet - // through the fully qualified class name - return new WebResource(getModule(resource.getProject()), new Path("servlet/" + className)); //$NON-NLS-1$ - - } - - // determine path - //TODO get webcontent name from module - //String name = getWebSettings().getWebContentName(); - //getfolder() and path for now default to projectPath - IPath rootPath = resource.getProjectRelativePath(); - IPath resourcePath = resource.getProjectRelativePath(); - - // Check to make sure the resource is under the webApplication directory - if (resourcePath.matchingFirstSegments(rootPath) != rootPath.segmentCount()) - return null; - - // Do not allow resource under the web-inf directory - resourcePath = resourcePath.removeFirstSegments(rootPath.segmentCount()); - if (resourcePath.segmentCount() > 1 && resourcePath.segment(0).equals(IWebNatureConstants.INFO_DIRECTORY)) - return null; - - if (shouldExclude(resource)) - return null; - - //Extension read to get the correct URL for Java Server Faces file if - //the jsp is of type jsfaces. - FileURL jspURL = FileURLExtensionReader.getInstance().getFilesURL(); - if (jspURL != null) { - IPath correctJSPPath = jspURL.getFileURL(resource, resourcePath); - if (correctJSPPath != null && correctJSPPath.toString().length() > 0) - return new WebResource(getModule(resource.getProject()), correctJSPPath); - } - // return Web resource type - return new WebResource(getModule(resource.getProject()), resourcePath); - } - - /** - * Method shouldExclude. - * - * @param resource - * @return boolean - */ - private static boolean shouldExclude(IResource resource) { - String fileExt = resource.getFileExtension(); - - // Exclude files of certain extensions - for (int i = 0; i < extensionsToExclude.length; i++) { - String extension = extensionsToExclude[i]; - if (extension.equalsIgnoreCase(fileExt)) - return true; - } - return false; - } - - protected static IModule getModule(IProject project) { - IModule deployable = null; - Iterator iterator = Arrays.asList(ServerUtil.getModules("j2ee.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; - } - - /** - * If this resource is a servlet, return the class name. If not, return null. - * - * @param resource - * @return java.lang.String - */ - public static String getServletClassName(IResource resource) { - if (resource == null) - return null; - - try { - IProject project = resource.getProject(); - IPath path = resource.getFullPath(); - if (!project.hasNature(JavaCore.NATURE_ID) || path == null) - 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 (isServlet(types[i])) - return types[i].getFullyQualifiedName(); - } - } - return null; - } catch (Exception e) { - return null; - } - } - - /** - * Returns the types contained within this java element. - * - * @param element - * com.ibm.jdt.core.api.IJavaElement - * @return com.ibm.jdt.core.api.IType[] - */ - private static IType[] getTypes(IJavaElement element) { - try { - if (element.getElementType() != IJavaElement.COMPILATION_UNIT) - return null; - - return ((ICompilationUnit) element).getAllTypes(); - } catch (Exception e) { - return null; - } - } - - /** - * Returns true if this java type derives from javax.servlet.GenericServlet - * - * @param type - * com.ibm.jdt.core.api.IType - * @return boolean - */ - private static boolean isServlet(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 ("javax.servlet.GenericServlet".equals(superClasses[i].getFullyQualifiedName())) //$NON-NLS-1$ - return true; - } - return false; - } catch (Exception e) { - return false; - } - } - - /** - * Return the mapping of a servlet or JSP file, or null if none was available. - * - * @param project - * org.eclipse.core.resources.IProject - * @param isServlet - * boolean - * @param typeName - * java.lang.String - * @return java.lang.String - */ - public static String getServletMapping(IProject project, boolean isServlet, String typeName) { - if (typeName == null || typeName.equals("")) //$NON-NLS-1$ - return null; - - J2EEWebNatureRuntime webNature = null; - WebEditModel model = null; - Object key = new Object(); - - try { - webNature = J2EEWebNatureRuntimeUtilities.getJ2EERuntime(project); - if (webNature == null) - return null; - - model = webNature.getWebAppEditModelForRead(key); - if (model == null) - return null; - WebApp webApp = model.getWebApp(); - if (webApp == null) - return null; - - // find servlet - Iterator iterator = webApp.getServlets().iterator(); - while (iterator.hasNext()) { - Servlet servlet = (Servlet) iterator.next(); - boolean valid = false; - - WebType webType = servlet.getWebType(); - if (webType.isServletType() && isServlet) { - ServletType type = (ServletType) webType; - if (typeName.equals(type.getClassName())) - valid = true; - } else if (webType.isJspType() && !isServlet) { - JSPType type = (JSPType) webType; - if (typeName.equals(type.getJspFile())) - valid = true; - } - - if (valid) { - java.util.List mappings = servlet.getMappings(); - if (mappings != null && !mappings.isEmpty()) { - ServletMapping map = (ServletMapping) mappings.get(0); - return map.getUrlPattern(); - } - } - } - - return null; - } catch (Exception e) { - return null; - } finally { - try { - if (model != null) - model.releaseAccess(key); - } catch (Exception ex) { - // ignore - } - } - } - - public static String getJSPSpecificationVersion(IBaseWebNature baseWebNature) { - - if (baseWebNature.isJ2EE()) { - return ((J2EEWebNatureRuntime) baseWebNature).isJSP1_2() ? "1.2" : "1.1"; //$NON-NLS-1$ //$NON-NLS-2$ - } - return "1.2"; //$NON-NLS-1$ - - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java deleted file mode 100644 index 8535dcbfd..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.deployables; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.deployables.J2EEDeployableFactory; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.project.J2EENature; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.server.core.IModule; - -public class WebDeployableFactory extends J2EEDeployableFactory { - private static final String ID = "com.ibm.wtp.web.server"; //$NON-NLS-1$ - - protected static final IPath[] PATHS = new IPath[]{new Path(".j2ee") //$NON-NLS-1$ - }; - - public String getFactoryId() { - return ID; - } - - public String getNatureID() { - return IWebNatureConstants.J2EE_NATURE_ID; - } - - public IModule createModule(J2EENature nature) { - return null; - } - - protected IPath[] getListenerPaths() { - return PATHS; - } - - -protected List createModuleDelegates(EList workBenchModules, IProject project) throws CoreException { - J2EEFlexProjWebDeployable moduleDelegate = null; - IModule module = null; - List moduleList = new ArrayList(workBenchModules.size()); - // J2EENature nature = (J2EENature)project.getNature(getNatureID()); - - for (int i = 0; i < workBenchModules.size(); i++) { - try { - WorkbenchComponent wbModule = (WorkbenchComponent) workBenchModules.get(i); - if (!wbModule.getComponentType().getComponentTypeId().equals(J2EEFlexProjWebDeployable.WEB_MODULE_TYPE)) - return null; - moduleDelegate = new J2EEFlexProjWebDeployable(project, ID, wbModule); - module = createModule(wbModule.getName(), wbModule.getName(), moduleDelegate.getType(), moduleDelegate.getVersion(), moduleDelegate.getProject()); - moduleList.add(module); - moduleDelegate.initialize(module); - // adapt(moduleDelegate, (WorkbenchComponent) workBenchModules.get(i)); - } catch (Exception e) { - Logger.getLogger().write(e); - } finally { - if (module != null) { - if (getModuleDelegate(module) == null) - moduleDelegates.add(moduleDelegate); - } - } - } - return moduleList; - - } private void adapt(J2EEFlexProjWebDeployable moduleDelegate, WorkbenchComponent wbModule) { - - ModuleAdapter moduleAdapter = new ModuleAdapter() { - public void notifyChanged(Notification msg) { - super.notifyChanged(msg); - } - }; - moduleAdapter.setTarget(wbModule); - moduleAdapter.setModuleDelegate(moduleDelegate); - wbModule.eAdapters().add(moduleAdapter); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModules() - */ - public IModule[] getModules() { - cacheModules(); - ArrayList moduleList = new ArrayList(); - for (Iterator iter = projects.values().iterator(); iter.hasNext();) { - IModule[] element = (IModule[]) iter.next(); - for (int j = 0; j < element.length; j++) { - moduleList.add(element[j]); - } - } - IModule[] modules = new IModule[moduleList.size()]; - moduleList.toArray(modules); - return modules; - - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebModuleArtifact.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebModuleArtifact.java deleted file mode 100644 index 1c998db2d..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebModuleArtifact.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Created on Feb 21, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.deployables; - -/** - * Key Class for adapter manager - */ -public class WebModuleArtifact { - -} diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURL.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURL.java deleted file mode 100644 index 777e92514..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURL.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 13, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.jfaces.extension; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - - -/** - * @author vijayb - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public interface FileURL { - public IPath getFileURL(IResource resource, IPath existingURL); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURLExtension.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURLExtension.java deleted file mode 100644 index be20ed88c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURLExtension.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 13, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.jfaces.extension; - -import org.eclipse.core.internal.runtime.Assert; -import org.eclipse.core.runtime.IConfigurationElement; - -import org.eclipse.jem.util.logger.proxy.Logger; - -/** - * @author vijayb - * - * TODO To change the template for this generated type comment go to Window - Preferences - Java - - * Code Style - Code Templates - */ -public class FileURLExtension { - private String id = null; - private FileURL instance; - private boolean errorCondition = false; - private IConfigurationElement element; - public static final String FILE_URL_EXTENSION = "fileURL"; //$NON-NLS-1$ - public static final String RUN = "run"; //$NON-NLS-1$ - public static final String ATT_ID = "id"; //$NON-NLS-1$ - public static final String ATT_CLASS = "class"; //$NON-NLS-1$ - - - /** - * - */ - public FileURLExtension() { - super(); - } - - public FileURL getInstance() { - try { - if (this.instance == null && !this.errorCondition) - this.instance = (FileURL) this.element.createExecutableExtension("run"); //$NON-NLS-1$ - } catch (Throwable e) { - Logger.getLogger().logError(e); - this.errorCondition = true; - } - return this.instance; - } - - public FileURLExtension(IConfigurationElement element) { - Assert.isLegal(FILE_URL_EXTENSION.equals(element.getName()), "Extensions must be of the type \"" + FILE_URL_EXTENSION + "\"."); //$NON-NLS-1$ //$NON-NLS-2$ - this.element = element; - init(); - } - - private void init() { - this.id = this.element.getAttribute(ATT_ID); - - } - - /** - * @return Returns the id. - */ - public String getId() { - return this.id; - } - - /** - * @param id - * The id to set. - */ - public void setId(String id) { - this.id = id; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURLExtensionReader.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURLExtensionReader.java deleted file mode 100644 index acdcc7e18..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/jfaces/extension/FileURLExtensionReader.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jun 13, 2004 - */ -package org.eclipse.jst.j2ee.internal.web.jfaces.extension; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; - -/** - * @author vijayb - * - * This class loads all the extensions that define the correct URL string for the Java Server Faces - * file - * - */ -public class FileURLExtensionReader extends RegistryReader { - static FileURLExtensionReader instance = null; - protected List fileURLExtensions; - - /** - * @param registry - * @param pluginID - * @param extensionPoint - */ - public FileURLExtensionReader() { - super(WebPlugin.PLUGIN_ID, "fileURL"); //$NON-NLS-1$ - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement) - */ - public boolean readElement(IConfigurationElement element) { - if (FileURLExtension.FILE_URL_EXTENSION.equals(element.getName())) { - addExtension(element); - return true; - } - return false; - } - - /** - * Sets the extension point. - * - * @param extensions - * The extensions to set - */ - protected void addExtension(IConfigurationElement newExtension) { - getFileURLExtensions().add(new FileURLExtension(newExtension)); - } - - /** - * Sets the extension point. - * - * @param extensions - * The extensions to set - */ - protected void addExtensionPoint(FileURLExtensionReader newExtension) { - if (this.fileURLExtensions == null) - this.fileURLExtensions = new ArrayList(); - this.fileURLExtensions.add(newExtension); - } - - /** - * @return the appropriate handler for the project based on priorities of those which are - * available and enabled - */ - public FileURL getFilesURL() { - FileURLExtension fileURLExt; - for (Iterator fileURLExtItr = getFileURLExtensions().iterator(); fileURLExtItr.hasNext();) { - fileURLExt = (FileURLExtension) fileURLExtItr.next(); - return fileURLExt.getInstance(); - } - return null; - } - - /** - * Gets the instance. - * - * @return Returns a FileURLExtensionReader - */ - public static FileURLExtensionReader getInstance() { - if (instance == null) { - instance = new FileURLExtensionReader(); - instance.readRegistry(); - } - return instance; - } - - /** - * @return Returns the handlerExtensions. - */ - protected List getFileURLExtensions() { - if (this.fileURLExtensions == null) - this.fileURLExtensions = new ArrayList(); - return this.fileURLExtensions; - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/migration/WebProjectMigratorStrategy.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/migration/WebProjectMigratorStrategy.java deleted file mode 100644 index 4fdec8b60..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/migration/WebProjectMigratorStrategy.java +++ /dev/null @@ -1,227 +0,0 @@ -package org.eclipse.jst.j2ee.internal.web.migration; - -import java.util.ArrayList; - -import org.eclipse.core.internal.resources.Container; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionUtil; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.web.operations.OldWebSettingsForMigration; -import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory; -import org.eclipse.wst.common.componentcore.internal.DependencyType; -import org.eclipse.wst.common.componentcore.internal.Property; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.internal.migration.IMigratorStrategy; - - - -public class WebProjectMigratorStrategy implements IMigratorStrategy { - - protected IProject project; - protected static String JAVA_SOURCE = "JavaSource"; - protected static String CONTEXT_ROOT = "ContextRoot"; - protected static String JSP_LEVEL = "JSPLevel"; - protected static String FEATURE_ID = "FeatureID"; - protected static String JAVA_SOURCE_DEPLOY_PATH_NAME = "/WEB-INF/classes"; - protected static String WEB_DEPLOYMENT_DESCRIPTOR_PATH = "/WEB-INF/web.xml"; - - protected OldWebSettingsForMigration fWebSettings; - int fVersion; - - - - public IJavaProject getJavaProject() { - IJavaProject javaProject = JavaCore.create(project); - return javaProject; - } - - public IPackageFragmentRoot[] getPackageRoots() { - try { - return getJavaProject().getAllPackageFragmentRoots(); - } catch (JavaModelException e) { - e.printStackTrace(); - } - return null; - - } - - public IResource[] getResources(String componentName, int type) { - IResource[] resources = null; - switch (type) { - case IMigratorStrategy.SOURCE : { - IPackageFragmentRoot[] roots = getPackageRoots(); - ArrayList sourceFolders = new ArrayList(roots.length); - for (int i = 0; i < roots.length; i++) { - IResource packageResource; - try { - packageResource = (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) ? roots[i].getCorrespondingResource() : null; - if (packageResource != null && packageResource.getType() == IResource.FOLDER) - sourceFolders.add(packageResource); - } catch (JavaModelException e) { - e.printStackTrace(); - } - } - resources = new Container[sourceFolders.size()]; - sourceFolders.toArray(resources); - break; - } - case IMigratorStrategy.CONTENT : { - resources = new Container[1]; - Container webContent = (Container) project.getFolder(getBasicWebModulePath()); - if (webContent != null) - resources[0] = webContent; - break; - } - } - return resources; - } - - public OldWebSettingsForMigration getWebSettings() { - if (fWebSettings == null) { - fWebSettings = new OldWebSettingsForMigration(getProject()); - } - return fWebSettings; - } - - public IPath getRuntimeType(IResource resource, int type) { - if (resource.getName().equals(JAVA_SOURCE)) - return (new Path(JAVA_SOURCE_DEPLOY_PATH_NAME)); - return new Path("/"); - } - - public String[] getComponentNames() { - return new String[]{project.getName()}; - } - - - public void setCurrentProject(IProject aProject) { - project = aProject; - } - - public IProject getProject() { - return project; - } - - public IPath getBasicWebModulePath() { - OldWebSettingsForMigration webSettings = getWebSettings(); - String name = webSettings.getWebContentName(); - if (name == null) { - int version = getVersion(); - // If created in V5 or beyond - if (version != -1 && version >= 500) - return IWebNatureConstants.WEB_MODULE_PATH_; - return IWebNatureConstants.WEB_MODULE_PATH_V4; - } - return new Path(name); - } - - public int getVersion() { - if (fVersion == -1) { - try { - String versionString = getWebSettings().getVersion(); - if (versionString != null) - fVersion = Integer.parseInt(versionString); - } catch (NumberFormatException e) { - //Ignore - } - } - return fVersion; - } - - - public IResource[] getExcludedResources(String componentName, int type) { - return null; - } - - public String getComponentTypeName(String componentName) { - return IModuleConstants.JST_WEB_MODULE; - } - - public String getComponetTypeVersion(String componentName) { - return J2EEVersionUtil.getJ2EETextVersion(getJ2EEVersion()); - } - - public Property[] getProperties(String componentName) { - String contextRootName = getWebSettings().getContextRoot(); - String jspLevel = getWebSettings().getJSPLevel(); - String[] featureIDs = getWebSettings().getFeatureIds(); - Property[] properties = new Property[featureIDs.length + 2]; - properties[0] = createProperty(CONTEXT_ROOT, contextRootName); - properties[1] = createProperty(JSP_LEVEL, jspLevel); - for (int i = 2; i < featureIDs.length + 2; i++) { - properties[i] = createProperty(FEATURE_ID + "_" + (i - 1), featureIDs[i - 2]); - - } - return properties; - } - - public Property createProperty(String name, String value) { - Property property = ComponentcoreFactory.eINSTANCE.createProperty(); - property.setName(name); - property.setValue(value); - return property; - } - - - public int getJ2EEVersion() { - int j2eeVersion; - switch (getModuleVersion()) { - case J2EEVersionConstants.WEB_2_2_ID : - j2eeVersion = J2EEVersionConstants.J2EE_1_2_ID; - break; - case J2EEVersionConstants.WEB_2_3_ID : - j2eeVersion = J2EEVersionConstants.J2EE_1_3_ID; - break; - case J2EEVersionConstants.WEB_2_4_ID : - j2eeVersion = J2EEVersionConstants.WEB_2_4_ID; - default : - j2eeVersion = J2EEVersionConstants.J2EE_1_4_ID; - } - return j2eeVersion; - } - - - private int getModuleVersion() { - return getWebSettings().getModuleVersion(); - } - - public void postMigrateStrategy() { - //Default - } - - - public boolean hasReferencedComponent(String componentName) { - return false; - } - - - public String[] getReferencedComponentNames(String componentName) { - return null; - } - - - public DependencyType getDependancyType(String referencedComponentName, String componentName) { - return null; - } - - - public IPath getReferencedComponentHandleURI(String referencedComponentName, String componentName) { - return null; - } - - public IPath getReferencedComponentRuntimeType(String referencedComponentName, String componentName) { - return null; - } - - public IProject[] getRequiredProjectsForMigration() { - return null; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/AddServletOperation.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/AddServletOperation.java deleted file mode 100644 index 4de3a2256..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/AddServletOperation.java +++ /dev/null @@ -1,284 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.Description; -import org.eclipse.jst.j2ee.common.ParamValue; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel; -import org.eclipse.jst.j2ee.webapplication.InitParam; -import org.eclipse.jst.j2ee.webapplication.JSPType; -import org.eclipse.jst.j2ee.webapplication.Servlet; -import org.eclipse.jst.j2ee.webapplication.ServletMapping; -import org.eclipse.jst.j2ee.webapplication.ServletType; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperation; - -/** - * This class, AddServlet Operation is a WTPOperation following the WTP wizard data model and - * operation framework. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperation - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel - * - * This operation subclasses the EditModelOperation so the changes made to the deployment descriptor - * models are saved to the edit model. - * @see org.eclipse.wst.common.internal.emfworkbench.operation.EditModelOperation - * - * It is the operation which should be used when adding a new servlet to - * a web app, whether that be an annotated servlet or a non annotated servlet. This uses the - * NewServletClassDataModel to retrieve properties set by the user in order to create the custom - * servet. - * @see org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModel - * - * In the non annotated case, this operation will add the metadata necessary into the web deployment - * descriptor. In the annotated case, it will not, it will leave this up to the parsing of the - * annotations to build the deployment descriptor artifacts. To actually create the java class for - * the servlet, the operation uses the NewServletClassOperation. The NewServletClassOperation - * shares the same data model. - * @see org.eclipse.jst.j2ee.internal.web.operations.NewServletClassOperation - * - * Clients may subclass this operation to provide their own behaviour on servlet creation. The execute - * method can be extended to do so. Also, generateServletMetaData and creteServletClass are exposed. - * - * The use of this class is EXPERIMENTAL and is subject to substantial changes. - */ -public class AddServletOperation extends ArtifactEditOperation { - - /** - * This is the constructor which should be used when creating the operation. - * It will not accept null parameter. It will not return null. - * @see WTPOperation#WTPOperation(WTPOperationDataModel) - * - * @param dataModel NewServletClassDataModel - * @return AddServletOperation - */ - public AddServletOperation(NewServletClassDataModel dataModel) { - super(dataModel); - } - - /** - * Subclasses may extend this method to add their own actions during execution. - * The implementation of the execute method drives the running of the operation. This - * implementation will create the servlet class, and then if the servlet is not - * annotated, it will create the servlet metadata for the web deployment descriptor. - * This method will accept null as a parameter. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperation#execute(IProgressMonitor) - * @see AddServletOperation#createServletClass() - * @see AddServletOperation#generateServletMetaData(NewServletClassDataModel, String, boolean) - * - * @param monitor IProgressMonitor - * @throws CoreException - * @throws InterruptedException - * @throws InvocationTargetException - */ - protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - //Retrieve values set in the newservletclass data model - NewServletClassDataModel model = (NewServletClassDataModel) operationDataModel; - boolean isServletType = model.getBooleanProperty(NewServletClassDataModel.IS_SERVLET_TYPE); - String qualifiedClassName = model.getStringProperty(NewJavaClassDataModel.CLASS_NAME); - - // If it is servlet type, create the java class - if (isServletType) - qualifiedClassName = createServletClass(); - - // If the servlet is not annotated, generate the servlet metadata for the DD - if (!model.getBooleanProperty(IAnnotationsDataModel.USE_ANNOTATIONS)) - generateServletMetaData(model, qualifiedClassName, isServletType); - } - - /** - * Subclasses may extend this method to add their own creation of the actual servlet java class. - * This implementation uses the NewServletClassOperation which is a subclass of the NewJavaClassOperation. - * The NewServletClassOperation will use the same NewServletClassDataModel to retrieve the properties in - * order to create the java class accordingly. This method will not return null. - * @see NewServletClassOperation - * @see org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassOperation - * @see NewServletClassDataModel - * - * @return String qualified servlet classname - */ - protected String createServletClass() { - // Create servlet java class file using the NewServletClassOperation. The same data model is shared. - NewServletClassDataModel model = (NewServletClassDataModel) operationDataModel; - NewServletClassOperation op = new NewServletClassOperation(model); - try { - op.run(null); - } catch (InvocationTargetException e) { - Logger.getLogger().log(e); - } catch (InterruptedException e) { - Logger.getLogger().log(e); - } - // Return the qualified classname of the newly created java class for the servlet - return model.getQualifiedClassName(); - } - - /** - * Subclasses may extend this method to add their own generation steps for the creation of the - * metadata for the web deployment descriptor. This implementation uses the J2EE models to create - * the Servlet model instance, any init params specified, and any servlet mappings. It then adds - * these to the web application model. This will then be written out to the deployment descriptor - * file. This method does not accept null parameters. - * @see Servlet - * @see AddServletOperation#createServlet(String, boolean) - * @see AddServletOperation#setUpInitParams(List, Servlet) - * @see AddServletOperation#setUpURLMappings(List, Servlet) - * - * @param model - * @param qualifiedClassName - * @param isServletType - */ - protected void generateServletMetaData(NewServletClassDataModel model, String qualifiedClassName, boolean isServletType) { - // Set up the servlet modelled object - Servlet servlet = createServlet(qualifiedClassName, isServletType); - - // Set up the InitParams if any - List initParamList = (List) model.getProperty(NewServletClassDataModel.INIT_PARAM); - if (initParamList != null) - setUpInitParams(initParamList,servlet); - - // Set up the servlet URL mappings if any - List urlMappingList = (List) model.getProperty(NewServletClassDataModel.URL_MAPPINGS); - if (urlMappingList != null) - setUpURLMappings(urlMappingList, servlet); - } - - /** - * This method is intended for private use only. This method is used to create the servlet - * modelled object, to set any parameters specified in the data model, and then to add the - * servlet instance to the web application model. This method does not accpet null parameters. - * It will not return null. - * @see AddServletOperation#generateServletMetaData(NewServletClassDataModel, String, boolean) - * @see WebapplicationFactory#createServlet() - * @see Servlet - * - * @param qualifiedClassName - * @param isServletType - * @return Servlet instance - */ - private Servlet createServlet(String qualifiedClassName, boolean isServletType) { - // Get values from data model - NewServletClassDataModel model = (NewServletClassDataModel) this.operationDataModel; - String displayName = model.getStringProperty(NewServletClassDataModel.DISPLAY_NAME); - String description = model.getStringProperty(NewServletClassDataModel.DESCRIPTION); - - // Create the servlet instance and set up the parameters from data model - Servlet servlet = WebapplicationFactory.eINSTANCE.createServlet(); - servlet.setDisplayName(displayName); - servlet.setServletName(displayName); - servlet.setDescription(description); - // Handle servlet case - if (isServletType) { - ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType(); - servletType.setClassName(qualifiedClassName); - servlet.setWebType(servletType); - } - // Handle JSP case - else { - JSPType jspType = WebapplicationFactory.eINSTANCE.createJSPType(); - jspType.setJspFile(qualifiedClassName); - servlet.setWebType(jspType); - } - // Add the servlet to the web application model - WebApp webApp = (WebApp) getArtifactEdit().getContentModelRoot(); - webApp.getServlets().add(servlet); - // Return the servlet instance - return servlet; - } - - /** - * This method is intended for internal use only. This is used to create any init params - * for the new servlet metadata. It will not accept null parameters. The init params are - * set on the servlet modelled object. - * @see AddServletOperation#generateServletMetaData(NewServletClassDataModel, String, boolean) - * @see WebapplicationFactory#createInitParam() - * - * @param initParamList - * @param servlet - */ - private void setUpInitParams(List initParamList, Servlet servlet) { - // Get the web app instance from the data model - WebApp webApp = (WebApp) getArtifactEdit().getContentModelRoot(); - int nP = initParamList.size(); - // If J2EE 1.4, add the param value and description info instances to the servlet init params - if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) { - for (int iP = 0; iP < nP; iP++) { - String[] stringArray = (String[]) initParamList.get(iP); - // Create 1.4 common param value - ParamValue param = CommonFactory.eINSTANCE.createParamValue(); - param.setName(stringArray[0]); - param.setValue(stringArray[1]); - // Create 1.4 common descripton value - Description descriptionObj = CommonFactory.eINSTANCE.createDescription(); - descriptionObj.setValue(stringArray[2]); - // Set the description on the param - param.getDescriptions().add(descriptionObj); - param.setDescription(stringArray[2]); - // Add the param to the servlet model list of init params - servlet.getInitParams().add(param); - } - } - // If J2EE 1.2 or 1.3, use the servlet specific init param instances - else { - for (int iP = 0; iP < nP; iP++) { - String[] stringArray = (String[]) initParamList.get(iP); - // Create the web init param - InitParam ip = WebapplicationFactory.eINSTANCE.createInitParam(); - // Set the param name - ip.setParamName(stringArray[0]); - // Set the param value - ip.setParamValue(stringArray[1]); - // Set the param description - ip.setDescription(stringArray[2]); - // Add the init param to the servlet model list of params - servlet.getParams().add(ip); - } - } - } - - /** - * This method is intended for internal use only. This method is used to create the servlet - * mapping modelled objects so the metadata for the servlet mappings is store in the web - * deployment descriptor. This method will not accept null parameters. The servlet mappings - * are added to the web application modelled object. - * @see AddServletOperation#generateServletMetaData(NewServletClassDataModel, String, boolean) - * @see WebapplicationFactory#createServletMapping() - * - * @param urlMappingList - * @param servlet - */ - private void setUpURLMappings(List urlMappingList, Servlet servlet) { - // Get the web app modelled object from the data model - WebApp webApp = (WebApp) getArtifactEdit().getContentModelRoot(); - int nM = urlMappingList.size(); - // Create the servlet mappings if any - for (int iM = 0; iM < nM; iM++) { - String[] stringArray = (String[]) urlMappingList.get(iM); - // Create the servlet mapping instance from the web factory - ServletMapping mapping = WebapplicationFactory.eINSTANCE.createServletMapping(); - // Set the servlet and servlet name - mapping.setServlet(servlet); - mapping.setName(servlet.getServletName()); - // Set the URL pattern to map the servlet to - mapping.setUrlPattern(stringArray[0]); - // Add the servlet mapping to the web application modelled list - webApp.getServletMappings().add(mapping); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/CreateServletTemplateModel.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/CreateServletTemplateModel.java deleted file mode 100644 index ee99e6897..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/CreateServletTemplateModel.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Aug 6, 2004 - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.util.List; - -import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel; - - -/** - * @author jlanuti - */ -public class CreateServletTemplateModel { - - NewServletClassDataModel dataModel = null; - public static final String INIT = "init"; //$NON-NLS-1$ - public static final String TO_STRING = "toString"; //$NON-NLS-1$ - public static final String GET_SERVLET_INFO = "getServletInfo"; //$NON-NLS-1$ - public static final String DO_POST = "doPost"; //$NON-NLS-1$ - public static final String DO_PUT = "doPut"; //$NON-NLS-1$ - public static final String DO_DELETE = "doDelete"; //$NON-NLS-1$ - public static final String DESTROY = "destroy"; //$NON-NLS-1$ - public static final String DO_GET = "doGet"; //$NON-NLS-1$ - - public static final int NAME = 0; - public static final int VALUE = 1; - public static final int DESCRIPTION = 2; - - /** - * Constructor - */ - public CreateServletTemplateModel(NewServletClassDataModel dataModel) { - super(); - this.dataModel = dataModel; - } - - public String getServletClassName() { - return getProperty(NewJavaClassDataModel.CLASS_NAME); - } - - public String getJavaPackageName() { - return getProperty(NewJavaClassDataModel.JAVA_PACKAGE); - } - - public String getQualifiedJavaClassName() { - return getJavaPackageName() + "." + getServletClassName(); //$NON-NLS-1$ - } - - public String getSuperclassName() { - return getProperty(NewJavaClassDataModel.SUPERCLASS); - } - - public String getServletName() { - return getProperty(NewJavaClassDataModel.CLASS_NAME); - } - - public boolean isPublic() { - return this.dataModel.getBooleanProperty(NewJavaClassDataModel.MODIFIER_PUBLIC); - } - - public boolean isFinal() { - return this.dataModel.getBooleanProperty(NewJavaClassDataModel.MODIFIER_FINAL); - } - - public boolean isAbstract() { - return this.dataModel.getBooleanProperty(NewJavaClassDataModel.MODIFIER_ABSTRACT); - } - - protected String getProperty(String propertyName) { - return this.dataModel.getStringProperty(propertyName); - } - - public boolean shouldGenInit() { - return implementImplementedMethod(INIT); - } - - public boolean shouldGenToString() { - return implementImplementedMethod(TO_STRING); - } - - public boolean shouldGenGetServletInfo() { - return implementImplementedMethod(GET_SERVLET_INFO); - } - - public boolean shouldGenDoPost() { - return implementImplementedMethod(DO_POST); - } - - public boolean shouldGenDoPut() { - return implementImplementedMethod(DO_PUT); - } - - public boolean shouldGenDoDelete() { - return implementImplementedMethod(DO_DELETE); - } - - public boolean shouldGenDestroy() { - return implementImplementedMethod(DESTROY); - } - - public boolean shouldGenDoGet() { - return implementImplementedMethod(DO_GET); - } - - public List getInitParams() { - return (List) dataModel.getProperty(NewServletClassDataModel.INIT_PARAM); - } - - public String getInitParam(int index, int type) { - List params = getInitParams(); - if (index < params.size()) { - String[] stringArray = (String[]) params.get(index); - return stringArray[type]; - } - return null; - } - - public List getServletMappings() { - return (List) dataModel.getProperty(NewServletClassDataModel.URL_MAPPINGS); - } - - public String getServletMapping(int index) { - List mappings = getServletMappings(); - if (index < mappings.size()) { - String[] map = (String[]) mappings.get(index); - return map[0]; - } - return null; - } - - public String getServletDescription() { - return dataModel.getStringProperty(NewServletClassDataModel.DESCRIPTION); - } - - public List getInterfaces() { - return (List) this.dataModel.getProperty(NewJavaClassDataModel.INTERFACES); - } - - protected boolean implementImplementedMethod(String methodName) { - if (methodName.equals(INIT)) - return dataModel.getBooleanProperty(NewServletClassDataModel.INIT); - else if (methodName.equals(TO_STRING)) - return dataModel.getBooleanProperty(NewServletClassDataModel.TO_STRING); - else if (methodName.equals(GET_SERVLET_INFO)) - return dataModel.getBooleanProperty(NewServletClassDataModel.GET_SERVLET_INFO); - else if (methodName.equals(DO_POST)) - return dataModel.getBooleanProperty(NewServletClassDataModel.DO_POST); - else if (methodName.equals(DO_PUT)) - return dataModel.getBooleanProperty(NewServletClassDataModel.DO_PUT); - else if (methodName.equals(DO_DELETE)) - return dataModel.getBooleanProperty(NewServletClassDataModel.DO_DELETE); - else if (methodName.equals(DESTROY)) - return dataModel.getBooleanProperty(NewServletClassDataModel.DESTROY); - else if (methodName.equals(DO_GET)) - return dataModel.getBooleanProperty(NewServletClassDataModel.DO_GET); - else - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/NewServletClassDataModel.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/NewServletClassDataModel.java deleted file mode 100644 index 83f9ab68a..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/NewServletClassDataModel.java +++ /dev/null @@ -1,602 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.Servlet; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; - -/** - * The NewServletClassData model is a subclass of WTPOperationDataModel and follows the WTP Operation and WTP Wizard frameworks. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperation - * - * This data model is a subclass of the NewJavaClassDataModel, which stores base properties necessary in - * the creation of a default java class. - * @see org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel - * - * The NewServletClassDataModel provides more specific properties for java class creation that are required - * in creating a servlet java class. The data model is used to store these values for the NewServletClassOperation. - * That operation will create the servlet java class based on the settings defined here in the data model. - * @see org.eclipse.jst.j2ee.internal.web.operations.NewServletClassOperation - * - * This data model implements the IAnnotationsDataModel to get the USE_ANNOTATIONS property for determining - * whether or not to generate an annotated java class. - * @see org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel - * - * Clients can subclass this data model to cache and provide their own specific attributes. They should also provide their - * own validation methods and default values for the properties they add. - * - * The use of this class is EXPERIMENTAL and is subject to substantial changes. - */ -public class NewServletClassDataModel extends NewJavaClassDataModel implements IAnnotationsDataModel { - - /** - * Optional, boolean property used to specify whether to generate the init method. - * The default is false. - */ - public static final String INIT = "NewServletClassDataModel.INIT"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the doPost method. - * The default is true. - */ - public static final String DO_POST = "NewServletClassDataModel.DO_POST"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the destroy method. - * The default is false. - */ - public static final String DESTROY = "NewServletClassDataModel.DESTROY"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the toString method. - * The default is false. - */ - public static final String TO_STRING = "NewServletClassDataModel.TO_STRING"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the doPut method. - * The default is false. - */ - public static final String DO_PUT = "NewServletClassDataModel.DO_PUT"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the doGet method. - * The default is true. - */ - public static final String DO_GET = "NewServletClassDataModel.DO_GET"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the getServletInfo method. - * The default is false. - */ - public static final String GET_SERVLET_INFO = "NewServletClassDataModel.GET_SERVLET_INFO"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to specify whether to generate the doDelete method. - * The default is false. - */ - public static final String DO_DELETE = "NewServletClassDataModel.DO_DELETE"; //$NON-NLS-1$ - - /** - * Optional, boolean property used to determine if building JSP or servlet. - * The default is true. - */ - public static final String IS_SERVLET_TYPE = "NewServletClassDataModel.IS_SERVLET_TYPE"; //$NON-NLS-1$ - - /** - * Optional, List property used to cache all the init params defined on the servlet. - */ - public static final String INIT_PARAM = "NewServletClassDataModel.INIT_PARAM"; //$NON-NLS-1$ - - /** - * Optional, List propety used to cache all the servlet mappings for this servlet on the web application. - */ - public static final String URL_MAPPINGS = "NewServletClassDataModel.URL_MAPPINGS"; //$NON-NLS-1$ - - /** - * Required, String property of the display name for the servlet - */ - public static final String DISPLAY_NAME = "NewServletClassDataModel.DISPLAY_NAME"; //$NON-NLS-1$ - - /** - * Optional, String property of the description info for the servlet - */ - public static final String DESCRIPTION = "NewServletClassDataModel.DESCRIPTION"; //$NON-NLS-1$ - - /** - * The fully qualified default servlet superclass: HttpServlet. - */ - public final static String SERVLET_SUPERCLASS = "javax.servlet.http.HttpServlet"; //$NON-NLS-1$ - - /** - * String array of the default, minimum required fully qualified Servlet interfaces - */ - public final static String[] SERVLET_INTERFACES = {"javax.servlet.Servlet"}; //$NON-NLS-1$ - - /** - * The javajet template file used in creating the servlet template class - */ - public static final String TEMPLATE_FILE = "servletXDoclet.javajet"; //$NON-NLS-1$ - - public static final String NON_ANNOTATED_TEMPLATE_FILE = "servletXDocletNonAnnotated.javajet"; //$NON-NLS-1$ - /** - * The cache of all the interfaces the servlet java class will implement. - */ - private List interfaceList; - - private static boolean useAnnotations = true; - - /** - * Subclasses may extend this method to provide their own default operation for this - * data model. This implementation uses the AddServletOperation to drive the servlet - * creation. It will not return null. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel#getDefaultOperation() - * - * @return WTPOperation AddServletOperation - */ - public WTPOperation getDefaultOperation() { - return new AddServletOperation(this); - } - - /** - * Subclasses may extend this method to provide their own determination of whether or not - * certain properties should be disabled or enabled. This method does not accept null parameter. - * It will not return null. This implementation makes sure annotation support is only allowed - * on web projects of J2EE version 1.3 or higher. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel#basicIsEnabled(String) - * @see IAnnotationsDataModel#USE_ANNOTATIONS - * - * @param propertyName - * @return Boolean should property be enabled? - */ - protected Boolean basicIsEnabled(String propertyName) { - // Annotations should only be enabled on a valid j2ee project of version 1.3 or higher - if (USE_ANNOTATIONS.equals(propertyName)) { - if (!isAnnotationsSupported()) - return Boolean.FALSE; - return Boolean.TRUE; - } - // Otherwise return super implementation - return super.basicIsEnabled(propertyName); - } - - /** - * Subclasses may extend this method to add their own specific data model properties as valid - * base properties. This implementation adds the servlet specific properties to those added - * by the NewJavaClassDataModel. - * @see NewJavaClassDataModel#initValidBaseProperties() - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel#initValidBaseProperties() - */ - protected void initValidBaseProperties() { - super.initValidBaseProperties(); - // Add servlet specific properties defined in this data model - addValidBaseProperty(INIT); - addValidBaseProperty(DO_POST); - addValidBaseProperty(DESTROY); - addValidBaseProperty(TO_STRING); - addValidBaseProperty(DO_PUT); - addValidBaseProperty(DO_GET); - addValidBaseProperty(GET_SERVLET_INFO); - addValidBaseProperty(DO_DELETE); - addValidBaseProperty(IS_SERVLET_TYPE); - addValidBaseProperty(INIT_PARAM); - addValidBaseProperty(URL_MAPPINGS); - addValidBaseProperty(USE_ANNOTATIONS); - addValidBaseProperty(DISPLAY_NAME); - addValidBaseProperty(DESCRIPTION); - } - - /** - * Subclasses may extend this method to provide their own default values for - * any of the properties in the data model hierarchy. This method does not - * accept a null parameter. It may return null. This implementation sets - * annotation use to be true, and to generate a servlet with doGet and doPost. - * @see NewJavaClassDataModel#getDefaultProperty(String) - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel#getDefaultProperty(String) - * - * @param propertyName - * @return Object default value of property - */ - protected Object getDefaultProperty(String propertyName) { - // Generate a doPost method by default - if (propertyName.equals(DO_POST)) - return new Boolean(true); - // Generate a doGet method by default - else if (propertyName.equals(DO_GET)) - return new Boolean(true); - // Use servlet by default - else if (propertyName.equals(IS_SERVLET_TYPE)) - return new Boolean(true); - // Create an annotated servlet java class by default - else if (propertyName.equals(USE_ANNOTATIONS)) - return shouldDefaultAnnotations(); - else if (propertyName.equals(DISPLAY_NAME)) - return getProperty(CLASS_NAME); - // Otherwise check super for default value for property - return super.getDefaultProperty(propertyName); - } - - /** - * Subclasses may extend this method to add their own specific behaviour when a certain - * property in the data model heirarchy is set. This method does not accept null for - * the property name, but it will for propertyValue. It will not return null. It will return - * false if the set fails. This implementation verifies the display name is set to the - * classname, that the annotations is disabled/enabled properly, and that the target project - * name is determined from the source folder setting. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel#doSetProperty(String, Object) - * - * @param propertyName - * @param propertyValue - * @return boolean was property set? - */ - protected boolean doSetProperty(String propertyName, Object propertyValue) { - - // If annotations is changed, notify an enablement change - if (propertyName.equals(USE_ANNOTATIONS)) { - useAnnotations = ((Boolean) propertyValue).booleanValue(); - if (useAnnotations && !isAnnotationsSupported()) - return true; - notifyEnablementChange(USE_ANNOTATIONS); - } - // If the source folder is changed, ensure we have the correct project name - if (propertyName.equals(SOURCE_FOLDER)) { - // Get the project name from the source folder name - String sourceFolder = (String) propertyValue; - int index = sourceFolder.indexOf(File.separator); - String projectName = sourceFolder; - if (index == 0) - projectName = sourceFolder.substring(1); - index = projectName.indexOf(File.separator); - if (index != -1) { - projectName = projectName.substring(0, index); - setProperty(PROJECT_NAME, projectName); - } - } - // Call super to set the property on the data model - boolean result = super.doSetProperty(propertyName, propertyValue); - // If class name is changed, update the display name to be the same - if (propertyName.equals(CLASS_NAME) && !isSet(DISPLAY_NAME)) { - notifyDefaultChange(DISPLAY_NAME); - } - // After the property is set, if project changed, update the nature and the annotations enablement - if (propertyName.equals(MODULE_NAME)) { - notifyEnablementChange(USE_ANNOTATIONS); - } - // After property is set, if annotations is set to true, update its value based on the new level of the project - if (getBooleanProperty(USE_ANNOTATIONS)) { - if (!isAnnotationsSupported()) - setBooleanProperty(USE_ANNOTATIONS, false); - } - // Return whether property was set - return result; - } - - protected boolean isAnnotationsSupported() { - if (getTargetProject()==null || getWorkbenchModule()==null) return true; - WebArtifactEdit webEdit = null; - try { - webEdit = WebArtifactEdit.getWebArtifactEditForRead(getWorkbenchModule()); - if (webEdit == null) - return false; - return webEdit.getJ2EEVersion() > J2EEVersionConstants.VERSION_1_2; - } catch (Exception e) { - e.printStackTrace(); - return false; - } finally { - if (webEdit != null) - webEdit.dispose(); - } - } - - /** - * Subclasses may extend this method to provide their own validation on any of the valid - * data model properties in the hierarchy. This implementation adds validation for - * the init params, servlet mappings, display name, and existing class - * fields specific to the servlet java class creation. It does not accept a null - * parameter. This method will not return null. - * @see NewJavaClassDataModel#doValidateProperty(String) - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel#doValidateProperty(String) - * - * @param propertyName - * @return IStatus is property value valid? - */ - protected IStatus doValidateProperty(String propertyName) { - // If our default is the superclass, we know it is ok - if (propertyName.equals(SUPERCLASS) && getStringProperty(propertyName).equals(SERVLET_SUPERCLASS)) - return WTPCommonPlugin.OK_STATUS; - IStatus result = super.doValidateProperty(propertyName); - if (!result.isOK()) - return result; - // Validate init params - if (propertyName.equals(INIT_PARAM)) - return validateInitParamList((List) getProperty(propertyName)); - // Validate servlet mappings - if (propertyName.equals(URL_MAPPINGS)) - return validateURLMappingList((List) getProperty(propertyName)); - // Validate the servlet name in DD - if (propertyName.equals(DISPLAY_NAME)) - return validateDisplayName(getStringProperty(propertyName)); - - // Otherwise defer to super to validate the property - return result; - } - - /** - * Subclasses may extend this method to provide their own validation of the specified - * java classname. This implementation will ensure the class name is not set to Servlet - * and then will forward on to the NewJavaClassDataModel to validate the class name as - * valid java. This method does not accept null as a parameter. It will not return null. - * @see NewServletClassDataModel#validateExistingClass(boolean) - * @see NewJavaClassDataModel#validateJavaClassName(String) - * - * @param className - * @return IStatus is java classname valid? - */ - protected IStatus validateJavaClassName(String className) { - // First use the NewJavaClassDataModel to validate the classname as proper java syntax - IStatus status = super.validateJavaClassName(className); - if (status.isOK()) { - // Do not allow the name to be "Servlet" - if (className.equals("Servlet")) { //$NON-NLS-1$ - String msg = WebMessages.getResourceString(WebMessages.ERR_SERVLET_JAVA_CLASS_NAME_INVALID); - return WTPCommonPlugin.createErrorStatus(msg); - } - return WTPCommonPlugin.OK_STATUS; - } - // Return the status - return status; - } - - /** - * This method is intended for internal use only. It will be used to validate the init params list - * to ensure there are not any duplicates. This method will accept a null paramter. It will - * not return null. - * @see NewServletClassDataModel#doValidateProperty(String) - * - * @param prop - * @return IStatus is init params list valid? - */ - private IStatus validateInitParamList(List prop) { - if (prop != null && !prop.isEmpty()) { - // Ensure there are not duplicate entries in the list - boolean dup = hasDuplicatesInStringArrayList(prop); - if (dup) { - String msg = WebMessages.getResourceString(WebMessages.ERR_DUPLICATED_INIT_PARAMETER); - return WTPCommonPlugin.createErrorStatus(msg); - } - } - // Return OK - return WTPCommonPlugin.OK_STATUS; - } - - /** - * This method is intended for internal use only. This will validate the servlet mappings - * list and ensure there are not duplicate entries. It will accept a null parameter. - * It will not return null. - * @see NewServletClassDataModel#doValidateProperty(String) - * - * @param prop - * @return IStatus is servlet mapping list valid? - */ - private IStatus validateURLMappingList(List prop) { - if (prop != null && !prop.isEmpty()) { - // Ensure there are not duplicates in the mapping list - boolean dup = hasDuplicatesInStringArrayList(prop); - if (dup) { - String msg = WebMessages.getResourceString(WebMessages.ERR_DUPLICATED_URL_MAPPING); - return WTPCommonPlugin.createErrorStatus(msg); - } - } - // Return OK - return WTPCommonPlugin.OK_STATUS; - } - - /** - * This method is intended for internal use only. It provides a simple - * algorithm for detecting if there are duplicate entries in a list. It will - * accept a null paramter. It will not return null. - * @see NewServletClassDataModel#validateInitParamList(List) - * @see NewServletClassDataModel#validateURLMappingList(List) - * - * @param input - * @return boolean are there dups in the list? - */ - private boolean hasDuplicatesInStringArrayList(List input) { - // If list is null or empty return false - if (input == null) - return false; - int n = input.size(); - boolean dup = false; - // nested for loops to check each element to see if other elements are the same - for (int i = 0; i < n; i++) { - String[] sArray1 = (String[]) input.get(i); - for (int j = i + 1; j < n; j++) { - String[] sArray2 = (String[]) input.get(j); - if (isTwoStringArraysEqual(sArray1, sArray2)) { - dup = true; - break; - } - } - if (dup) - break; - } - // Return boolean status for duplicates - return dup; - } - - /** - * This method is intended for internal use only. This checks to see if the two string - * arrays are equal. If either of the arrays are null or empty, it returns false. - * @see NewServletClassDataModel#hasDuplicatesInStringArrayList(List) - * - * @param sArray1 - * @param sArray2 - * @return boolean are Arrays equal? - */ - private boolean isTwoStringArraysEqual(String[] sArray1, String[] sArray2) { - // If either array is null, return false - if (sArray1 == null || sArray2 == null) - return false; - int n1 = sArray1.length; - int n2 = sArray1.length; - // If either array is empty, return false - if (n1 == 0 || n2 == 0) - return false; - // If they don't have the same length, return false - if (n1 != n2) - return false; - // If their first elements do not match, return false - if (!sArray1[0].equals(sArray2[0])) - return false; - // Otherwise return true - return true; - } - - /** - * This method will return the list of servlet interfaces to be implemented for the - * new servlet java class. It will intialize the list using lazy initialization to - * the minimum interfaces required by the data model SERVLET_INTERFACES. This method - * will not return null. - * @see NewServletClassDataModel#SERVLET_INTERFACES - * - * @return List of servlet interfaces to be implemented - */ - public final List getServletInterfaces() { - if (interfaceList == null) { - interfaceList = new ArrayList(); - // Add minimum required list of servlet interfaces to be implemented - for (int i = 0; i < SERVLET_INTERFACES.length; i++) { - interfaceList.add(SERVLET_INTERFACES[i]); - } - } - // Return interface list - return interfaceList; - } - - /** - * This method is intended for internal use only. This will validate whether the display name - * selected is a valid display name for the servlet in the specified web application. It will - * make sure the name is not empty and that it doesn't already exist in the web app. This - * method will accept null as a parameter. It will not return null. - * @see NewServletClassDataModel#doValidateProperty(String) - * - * @param prop - * @return IStatus is servlet display name valid? - */ - private IStatus validateDisplayName(String prop) { - // Ensure the servlet display name is not null or empty - if (prop == null || prop.trim().length() == 0) { - String msg = WebMessages.getResourceString(WebMessages.ERR_DISPLAY_NAME_EMPTY); - return WTPCommonPlugin.createErrorStatus(msg); - } - if (getTargetProject()==null || getWorkbenchModule()==null) - return WTPCommonPlugin.OK_STATUS; - ArtifactEdit edit = null; - try { - edit = getArtifactEditForRead(); - WebApp webApp = (WebApp) edit.getContentModelRoot(); - if (webApp == null) - return WTPCommonPlugin.OK_STATUS; - List servlets = webApp.getServlets(); - boolean exists = false; - // Ensure the display does not already exist in the web application - if (servlets != null && !servlets.isEmpty()) { - for (int i = 0; i < servlets.size(); i++) { - String name = ((Servlet) servlets.get(i)).getServletName(); - if (prop.equals(name)) - exists = true; - } - } - // If the servlet name already exists, throw an error - if (exists) { - String msg = WebMessages.getResourceString(WebMessages.ERR_SERVLET_DISPLAY_NAME_EXIST, new String[]{prop}); - return WTPCommonPlugin.createErrorStatus(msg); - } - } finally { - if (edit!=null) - edit.dispose(); - } - - //Otherwise, return OK - return WTPCommonPlugin.OK_STATUS; - } - - /** - * Subclasses may extend this method to perform their own retrieval mechanism. - * This implementation simply returns the JDT package fragment root for the selected source - * folder. This method may return null. - * @see IJavaProject#getPackageFragmentRoot(org.eclipse.core.resources.IResource) - * - * @return IPackageFragmentRoot - */ - public IPackageFragmentRoot getJavaPackageFragmentRoot() { - // Ensure project is not null - IProject project = getTargetProject(); - if (project == null) - return null; - - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - if (javaProject != null) { - // Ensure source folder exists - IFolder sourcefolder = getJavaSourceFolder(); - // Get the java package for the selected folder - if (sourcefolder != null) - return javaProject.getPackageFragmentRoot(sourcefolder); - } - return null; - } - - /** - * Subclasses may extend this method to perform their own retrieval of a default java source folder. - * This implementation returns the JavaSource folder as default since we are in a - * web project. This method may return null. - * @see NewJavaClassDataModel#getDefaultJavaSourceFolder() - * - * @return IFolder default java source folder - */ - protected IFolder getDefaultJavaSourceFolder() { - // Ensure project is not null - IProject project = getTargetProject(); - if (project == null) - return null; - - return (IFolder) WebPropertiesUtil.getJavaSourceFolder(project); - } - - /** - * @return boolean should the default annotations be true? - */ - private static Boolean shouldDefaultAnnotations() { - if (useAnnotations) - return Boolean.TRUE; - return Boolean.FALSE; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/NewServletClassOperation.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/NewServletClassOperation.java deleted file mode 100644 index f1f58238f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/NewServletClassOperation.java +++ /dev/null @@ -1,325 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.codegen.jet.JETException; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.common.internal.annotations.controller.AnnotationsController; -import org.eclipse.jst.common.internal.annotations.controller.AnnotationsControllerManager; -import org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel; -import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModel; -import org.eclipse.jst.j2ee.internal.project.WTPJETEmitter; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperation; -import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperationDataModel; -import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException; - -/** - * The NewServletClassOperation is a WTPOperation following the WTP wizard data model and - * operation framework. - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperation - * @see org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel - * - * It extends EditModelOperation to provide servlet specific java class generation. - * @see org.eclipse.wst.common.internal.emfworkbench.operation.EditModelOperation - * - * This operation is used by the AddServletOperation to generate either an annotated or - * non annotated java class for an added servlet. It shares the NewServletClassDataModel - * with the AddServletOperation to store the appropriate properties required to generate - * the new servlet. - * @see org.eclipse.jst.j2ee.internal.web.operations.AddServletOperation - * @see org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModel - * - * In the annotated case, a WTPJetEmitter servlet template is created and used to generate the - * servlet java class with the embedded annotated tags. - * @see org.eclipse.jst.j2ee.internal.project.WTPJETEmitter - * @see org.eclipse.jst.j2ee.internal.web.operations.CreateServletTemplateModel - * - * In the non annotated case, the same emitter is used to create the class with the non annotated - * servlet template so the annotated tags are omitted. - * - * Subclasses may extend this operation to provide their own specific servlet java class generation. - * The execute method may be extended to do so. Also, generateUsingTemplates is exposed. - * - * The use of this class is EXPERIMENTAL and is subject to substantial changes. - */ -public class NewServletClassOperation extends ArtifactEditOperation { - - /** - * The extension name for a java class - */ - private static final String DOT_JAVA = ".java"; //$NON-NLS-1$ - /** - * platform plugin beginning for URI string - */ - private static final String PLATFORM_PLUGIN = "platform:/plugin/"; //$NON-NLS-1$ - - /** - * variable for the web plugin - */ - protected static final String WEB_PLUGIN = "WEB_PLUGIN"; //$NON-NLS-1$ - /** - * folder location of the servlet creation templates diretory - */ - protected static final String TEMPLATE_DIR = "/templates/"; //$NON-NLS-1$ - /** - * name of the template emitter to be used to generate the deployment descriptor from the tags - */ - protected static final String TEMPLATE_EMITTER = "org.eclipse.jst.j2ee.ejb.annotations.emitter.template"; //$NON-NLS-1$ - /** - * id of the builder used to kick off generation of web metadata based on parsing of annotations - */ - protected static final String BUILDER_ID = "builderId"; //$NON-NLS-1$ - - /** - * This is the constructor which should be used when creating a NewServletClassOperation. An instance of - * the NewServletClassDataModel should be passed in. This does not accept null parameter. It will - * not return null. - * @see EditModelOperation#EditModelOperation(EditModelOperationDataModel) - * @see NewServletClassDataModel - * - * @param dataModel - * @return NewServletClassOperation - */ - public NewServletClassOperation(ArtifactEditOperationDataModel dataModel) { - super(dataModel); - } - - /** - * Subclasses may extend this method to add their own actions during execution. - * The implementation of the execute method drives the running of the operation. - * This implemenatation will create the java source folder, create the java package, - * and then if using annotations, will use templates to generate an annotated servlet - * java class, or if it is not annotated, the servlet java class file will be created - * without the annotated tags using templates. - * Optionally, subclasses may extend the generateUsingTemplates or createJavaFile method - * rather than extend the execute method. This method will accept a null paramter. - * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperation#execute(org.eclipse.core.runtime.IProgressMonitor) - * @see NewServletClassOperation#generateUsingTemplates(IProgressMonitor, IPackageFragment) - * - * @param monitor - * @throws CoreException - * @throws InterruptedException - * @throws InvocationTargetException - */ - protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - // Create source folder if it does not exist - createJavaSourceFolder(); - // Create java package if it does not exist - IPackageFragment pack = createJavaPackage(); - // Generate using templates - generateUsingTemplates(monitor, pack); - } - - /** - * This method will return the java package as specified by the new java class data model. - * If the package does not exist, it will create the package. This method should not return - * null. - * @see NewJavaClassDataModel#JAVA_PACKAGE - * @see IPackageFragmentRoot#createPackageFragment(java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor) - * - * @return IPackageFragment the java package - */ - protected final IPackageFragment createJavaPackage() { - NewJavaClassDataModel model = (NewJavaClassDataModel) operationDataModel; - // Retrieve the package name from the java class data model - String packageName = model.getStringProperty(NewJavaClassDataModel.JAVA_PACKAGE); - IPackageFragmentRoot packRoot = model.getJavaPackageFragmentRoot(); - IPackageFragment pack = packRoot.getPackageFragment(packageName); - // Handle default package - if (pack == null) { - pack = packRoot.getPackageFragment(""); //$NON-NLS-1$ - } - // Create the package fragment if it does not exist - if (!pack.exists()) { - String packName = pack.getElementName(); - try { - pack = packRoot.createPackageFragment(packName, true, null); - } catch (JavaModelException e) { - Logger.getLogger().log(e); - } - } - // Return the package - return pack; - } - - /** - * Subclasses may extend this method to provide their own template based creation - * of an annotated servlet java class file. This implementation uses the creation of - * a CreateServletTemplateModel and the WTPJetEmitter to create the java class with the - * annotated tags. This method accepts null for monitor, it does not accept null for - * fragment. If annotations are not being used the tags will be omitted from the class. - * @see CreateServletTemplateModel - * @see NewServletClassOperation#generateTemplateSource(CreateServletTemplateModel, IProgressMonitor) - * - * @param monitor - * @param fragment - * @throws CoreException - * @throws WFTWrappedException - */ - protected void generateUsingTemplates(IProgressMonitor monitor, IPackageFragment fragment) throws WFTWrappedException, CoreException { - // Create the servlet template model - CreateServletTemplateModel tempModel = createTemplateModel(); - IProject project = ((ArtifactEditOperationDataModel)getOperationDataModel()).getTargetProject(); - String source; - // Using the WTPJetEmitter, generate the java source based on the servlet template model - try { - source = generateTemplateSource(tempModel, monitor); - } catch (JETException e) { - throw new WFTWrappedException(e); - } - if (fragment != null) { - // Create the java file - String javaFileName = tempModel.getServletClassName() + DOT_JAVA; - ICompilationUnit cu = fragment.getCompilationUnit(javaFileName); - // Add the compilation unit to the java file - if (cu == null || !cu.exists()) - cu = fragment.createCompilationUnit(javaFileName, source, true, monitor); - IFile aFile = (IFile) cu.getResource(); - // Let the annotations controller process the annotated resource - AnnotationsController controller = AnnotationsControllerManager.INSTANCE.getAnnotationsController(project); - if (controller != null) - controller.process(aFile); - //((J2EEEditModel)model.getEditModel()).getWorkingCopy(cu, true); //Track CU. - } - // Add the annotations builder to the java project so metadata can be generated. - //TODO for M4 cannot add builder directly here, needs to be set up more extensibly - addAnnotationsBuilder(); - } - - /** - * This method is intended for internal use only. This method will add the annotations builder - * for Xdoclet to the targetted project. This needs to be removed from the operation and set - * up to be more extensible throughout the workbench. - * @see NewServletClassOperation#generateUsingTemplates(IProgressMonitor, IPackageFragment) - * - * @deprecated - */ - private void addAnnotationsBuilder() { - try { - NewServletClassDataModel dataModel = (NewServletClassDataModel) operationDataModel; - // Find the xdoclet builder from the extension registry - IConfigurationElement[] configurationElements = Platform.getExtensionRegistry().getConfigurationElementsFor(TEMPLATE_EMITTER); - String builderID = configurationElements[0].getNamespace() + "."+ configurationElements[0].getAttribute(BUILDER_ID); //$NON-NLS-1$ - IProject project = dataModel.getTargetProject(); - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - boolean found = false; - // Check if the builder is already set on the project - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(builderID)) { - found = true; - break; - } - } - // If the builder is not on the project, add it - if (!found) { - ICommand command = description.newCommand(); - command.setBuilderName(builderID); - ICommand[] newCommands = new ICommand[commands.length + 1]; - System.arraycopy(commands, 0, newCommands, 0, commands.length); - newCommands[commands.length] = command; - IProjectDescription desc = project.getDescription(); - desc.setBuildSpec(newCommands); - project.setDescription(desc, null); - } - } catch (Exception e) { - //Ignore - } - } - - /** - * This method is intended for internal use only. This will use the WTPJETEmitter to create - * an annotated java file based on the passed in servlet class template model. This method - * does not accept null parameters. It will not return null. If annotations are not used, - * it will use the non annotated template to omit the annotated tags. - * @see NewServletClassOperation#generateUsingTemplates(IProgressMonitor, IPackageFragment) - * @see JETEmitter#generate(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object[]) - * @see CreateServletTemplateModel - * - * @param tempModel - * @param monitor - * @return String the source for the java file - * @throws JETException - */ - private String generateTemplateSource(CreateServletTemplateModel tempModel, IProgressMonitor monitor) throws JETException { - String templateURI; - // If annotated, use annotated template - if (((NewServletClassDataModel) getOperationDataModel()).getBooleanProperty(IAnnotationsDataModel.USE_ANNOTATIONS)) - templateURI = PLATFORM_PLUGIN + WebPlugin.PLUGIN_ID + TEMPLATE_DIR + NewServletClassDataModel.TEMPLATE_FILE; - // Otherwise use non annotated template - else - templateURI = PLATFORM_PLUGIN + WebPlugin.PLUGIN_ID + TEMPLATE_DIR + NewServletClassDataModel.NON_ANNOTATED_TEMPLATE_FILE; - WTPJETEmitter emitter = new WTPJETEmitter(templateURI, this.getClass().getClassLoader()); - emitter.setIntelligentLinkingEnabled(true); - emitter.addVariable(WEB_PLUGIN, WebPlugin.PLUGIN_ID); - return emitter.generate(monitor, new Object[]{tempModel}); - } - - /** - * This method is intended for internal use only. This method will create an instance of the - * CreateServletTemplate model to be used in conjunction with the WTPJETEmitter. This method - * will not return null. - * @see CreateServletTemplateModel - * @see NewServletClassOperation#generateUsingTemplates(IProgressMonitor, IPackageFragment) - * - * @return CreateServletTemplateModel - */ - private CreateServletTemplateModel createTemplateModel() { - // Create the CreateServletTemplateModel instance with the new servlet class data model - CreateServletTemplateModel model = new CreateServletTemplateModel((NewServletClassDataModel) getOperationDataModel()); - return model; - } - - /** - * This method will return the java source folder as specified in the java class data model. - * It will create the java source folder if it does not exist. This method may return null. - * @see NewJavaClassDataModel#SOURCE_FOLDER - * @see IFolder#create(boolean, boolean, org.eclipse.core.runtime.IProgressMonitor) - * - * @return IFolder the java source folder - */ - protected final IFolder createJavaSourceFolder() { - NewJavaClassDataModel model = (NewJavaClassDataModel) operationDataModel; - // Get the source folder name from the data model - String folderFullPath = model.getStringProperty(NewJavaClassDataModel.SOURCE_FOLDER); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IFolder folder = root.getFolder(new Path(folderFullPath)); - // If folder does not exist, create the folder with the specified path - if (!folder.exists()) { - try { - folder.create(true, true, null); - } catch (CoreException e) { - Logger.getLogger().log(e); - } - } - // Return the source folder - return folder; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/OldJ2EESettingsForMigration.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/OldJ2EESettingsForMigration.java deleted file mode 100644 index e90fed71f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/OldJ2EESettingsForMigration.java +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Created on Aug 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.core.util.Util; -import org.eclipse.jst.j2ee.internal.project.J2EENature; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -public class OldJ2EESettingsForMigration { - - protected IFile fSettingsFile; - protected IProject fProject; - protected Document fDomDocument; - protected J2EENature nature = null; - // Version number may not change with every release, - // only when changes necessitate a new version number - public static String CURRENT_VERSION = "600"; //$NON-NLS-1$ - public static String VERSION_V4 = "400"; //$NON-NLS-1$ - public static final String ELEMENT_WORKSPACE_VERSION = "version"; //$NON-NLS-1$ - - public static String J2EE_SETTINGS_FILE_NAME = ".j2ee"; //$NON-NLS-1$ - - static final String ELEMENT_J2EESETTINGS = "j2eesettings"; //$NON-NLS-1$ - static final String ELEMENT_J2EE_MODULE_VERSION = "moduleversion"; //$NON-NLS-1$ - - public OldJ2EESettingsForMigration(IProject project, J2EENature nature) { - fProject = project; - this.nature = nature; - if (getDOMDocument() == null) { - try { - createNewDocument(); - } catch (CoreException e) { - //Ignore - } catch (IOException e) { - //Ignore - } - } - } - - public OldJ2EESettingsForMigration(IProject project, J2EENature nature, IFile webSettings) { - fProject = project; - this.nature = nature; - } - - protected void createNewDocument() throws CoreException, IOException { - StringWriter writer = new StringWriter(); - writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$ - writer.write("\n"); //$NON-NLS-1$ - writer.write("<j2eesettings version=\""); //$NON-NLS-1$ - writer.write(getCurrentVersion()); - writer.write("\">");//$NON-NLS-1$ - writer.write("\n"); //$NON-NLS-1$ - writer.write("</j2eesettings>"); //$NON-NLS-1$ - writer.write("\n"); //$NON-NLS-1$ - - InputStream sourceStream = new ByteArrayInputStream(writer.toString().getBytes("UTF8")); //$NON-NLS-1$ - IFile settingsFile = getSettingsFile(); - if (settingsFile.exists()) - settingsFile.setContents(sourceStream, true, true, null); - else - settingsFile.create(sourceStream, true, null); - read(); - } - - public OldJ2EESettingsForMigration(IProject project) { - fProject = project; - if (getDOMDocument() == null) { - try { - createNewDocument(); - } catch (CoreException e) { - //Ignore - } catch (IOException e) { - //Ignore - } - } - } - - protected Document getDOMDocument() { - if (fDomDocument == null) { - try { - read(); - } catch (IOException e) { - //Ignore - } - } - return fDomDocument; - } - - // Version of getDomDocument for use by import - protected Document getDOMDocument(IFile webSettings) { - if (fDomDocument == null) { - try { - read(webSettings); - } catch (IOException e) { - //Ignore - } - } - return fDomDocument; - } - - public String getCurrentVersion() { - // The following change is needed when the websettings file is - // deleted from a version 4 workspace Checking for webapplication - // folder - Otherwise, new projects will not work. - return CURRENT_VERSION; - } - - protected IFile getSettingsFile() { - if (fSettingsFile == null) { - fSettingsFile = fProject.getFile(J2EE_SETTINGS_FILE_NAME); - } - return fSettingsFile; - } - - protected void read() throws IOException { - // This following was changed for Defect 212723 The Util StringReader - // was changed to the InputStreamReader MAY - IFile settingsFile = getSettingsFile(); - InputStream inputStream = null; - InputStreamReader fileStream = null; - if (settingsFile.exists()) { - try { - ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - - // JZ: fix to defect 240171 - inputStream = settingsFile.getContents(true); - fileStream = new InputStreamReader(inputStream, "utf-8"); //$NON-NLS-1$ - - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - fDomDocument = parser.parse(new InputSource(fileStream)); - } finally { - Thread.currentThread().setContextClassLoader(prevClassLoader); - } - } catch (JavaModelException e) { - throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$ - } catch (CoreException e) { - throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$ - } catch (SAXException e) { - throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$ - } catch (ParserConfigurationException e) { - throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$ - } finally { - if (fileStream != null) - fileStream.close(); - } - } - } - - - // Version of read for use by import - protected void read(IFile settings) throws IOException { - // This following was changed for Defect 212723 The Util StringReader - // was changed to the InputStreamReader MAY - IFile settingsFile = settings; - - InputStream inputStream = null; - InputStreamReader fileStream = null; - if (settingsFile != null) { - try { - ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); - inputStream = settingsFile.getContents(); - fileStream = new InputStreamReader(inputStream, "utf-8"); //$NON-NLS-1$ - - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - fDomDocument = parser.parse(new InputSource(fileStream)); - } finally { - Thread.currentThread().setContextClassLoader(prevClassLoader); - } - - } catch (SAXException e) { - throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$ - } catch (ParserConfigurationException e) { - throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$ - } catch (CoreException ce) { - ce.printStackTrace(); - } finally { - if (fileStream != null) - fileStream.close(); - } - } - } - - public void write() throws CoreException { - if (fDomDocument == null) - return; - - ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - - try { - TransformerFactory factory = TransformerFactory.newInstance(); - Transformer transformer = factory.newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ - transformer.transform(new DOMSource(fDomDocument.getDocumentElement()), new StreamResult(outStream)); - } catch (TransformerConfigurationException e) { - e.printStackTrace(); - } catch (TransformerFactoryConfigurationError e) { - e.printStackTrace(); - } catch (TransformerException e) { - e.printStackTrace(); - } - - InputStream sourceStream = new ByteArrayInputStream(outStream.toByteArray()); - - IFile settingsFile = getSettingsFile(); - if (settingsFile.exists()) - settingsFile.setContents(sourceStream, true, true, null); - else - settingsFile.create(sourceStream, true, null); - } - - public String getVersion() { - Document doc = getDOMDocument(); - if (doc == null) - return null; - - Element root = doc.getDocumentElement(); - if (root == null) - return null; - if (!root.getNodeName().equalsIgnoreCase(getRootNodeName())) - return null; - - return root.getAttribute(ELEMENT_WORKSPACE_VERSION); //$NON-NLS-1$ - } - - - public void setVersion(String version) { - Document doc = getDOMDocument(); - if (doc == null) - return; - - Element root = doc.getDocumentElement(); - if (root == null) - return; - - if (!root.getNodeName().equalsIgnoreCase(getRootNodeName())) - return; - - root.setAttribute(ELEMENT_WORKSPACE_VERSION, version); //$NON-NLS-1$ - } - - protected void setValue(Element root, String nodeName, String value) { - Node node = findOrCreateChildNode(root, nodeName); - - NodeList childNodes = node.getChildNodes(); - - if (childNodes.getLength() == 0) { - Text newText = getDOMDocument().createTextNode(value); - node.appendChild(newText); - root.appendChild(node); - } else { - for (int i = 0; i < childNodes.getLength(); i++) { - Node curNode = childNodes.item(i); - if (curNode.getNodeType() == Node.TEXT_NODE) - curNode.setNodeValue(value); - } - } - } - - protected Node findOrCreateChildNode(Element root, String nodeName) { - Node node = findChildNode(root, nodeName); - if (node == null) { - // If the element does not exist yet, create one. - node = getDOMDocument().createElement(nodeName); - root.appendChild(node); - } - return node; - } - - protected Element findChildNode(Element parent, String nodeName) { - NodeList list = parent.getChildNodes(); - int length = list.getLength(); - for (int i = 0; i < length; ++i) { - Node curNode = list.item(i); - if (curNode.getNodeType() == Node.ELEMENT_NODE) { - Element curElement = (Element) curNode; - if (curElement.getNodeName().equalsIgnoreCase(nodeName)) - return curElement; - } - } - return null; - } - - protected Document getOrCreateDocument() { - Document doc = getDOMDocument(); - if (doc == null) { - try { - createNewDocument(); - doc = getDOMDocument(); - } catch (CoreException e) { - //Ignore - } catch (IOException e) { - //Ignore - } - } - return doc; - } - - protected Element getRootElement() { - Document doc = getDOMDocument(); - if (doc == null) - return null; - - Element root = doc.getDocumentElement(); - if (root == null) - return null; - if (!root.getNodeName().equalsIgnoreCase(getRootNodeName())) - return null; - return root; - } - - protected String getValue(String settingName) { - Element root = getRootElement(); - if (root == null) - return null; - return getNodeValue(root, settingName); - } - - protected String getNodeValue(Element parent, String nodeName) { - if (parent != null) { - Element node = findChildNode(parent, nodeName); - if (node != null) - return getChildText(node); - } - return null; - } - - protected String getChildText(Element node) { - NodeList list = node.getChildNodes(); - int length = list.getLength(); - for (int i = 0; i < length; ++i) { - Node curNode = list.item(i); - if (curNode.getNodeType() == Node.TEXT_NODE) { - return curNode.getNodeValue(); - } - } - return null; - } - - protected void setValue(String nodeName, String value) { - Document doc = getOrCreateDocument(); - setValue(doc.getDocumentElement(), nodeName, value); - } - - public int getModuleVersion() { - int version = 0; - String moduleVer = getValue(ELEMENT_J2EE_MODULE_VERSION); - if (moduleVer != null) - version = Integer.valueOf(moduleVer).intValue(); - return version; - } - - public void setModuleVersion(int moduleVersion) { - Integer holder = new Integer(moduleVersion); - setValue(ELEMENT_J2EE_MODULE_VERSION, holder.toString()); - } - - public String getRootNodeName() { - return ELEMENT_J2EESETTINGS; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/OldWebSettingsForMigration.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/OldWebSettingsForMigration.java deleted file mode 100644 index 0408b87e0..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/OldWebSettingsForMigration.java +++ /dev/null @@ -1,331 +0,0 @@ -package org.eclipse.jst.j2ee.internal.web.operations; -/* - * Licensed Material - Property of IBM - * (C) Copyright IBM Corp. 2002 - All Rights Reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure - * restricted by GSA ADP Schedule Contract with IBM Corp. - */ - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringWriter; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.FactoryConfigurationError; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.wst.web.internal.operation.ILibModule; -import org.eclipse.wst.web.internal.operation.LibModule; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -public class OldWebSettingsForMigration extends OldJ2EESettingsForMigration { - - static final String ELEMENT_WEBSETTINGS = "websettings"; //$NON-NLS-1$ - static final String ELEMENT_PROJECTTYPE = "project-type"; //$NON-NLS-1$ - static final String ELEMENT_CONTEXTROOT = "context-root"; //$NON-NLS-1$ - static final String ELEMENT_WEBCONTENT = "webcontent"; //$NON-NLS-1$ - static final String ELEMENT_JSPLEVEL = "jsp-level"; //$NON-NLS-1$ - static final String ELEMENT_LIBMODULES = "lib-modules"; //$NON-NLS-1$ - static final String ELEMENT_LIBMODULE = "lib-module"; //$NON-NLS-1$ - static final String ELEMENT_LIBMODULE_JAR = "jar"; //$NON-NLS-1$ - static final String ELEMENT_LIBMODULE_PROJECT = "project"; //$NON-NLS-1$ - static final String ELEMENT_FEATURES = "features"; //$NON-NLS-1$ - static final String ELEMENT_FEATURE = "feature"; //$NON-NLS-1$ - static final String ELEMENT_FEATUREID = "feature-id"; //$NON-NLS-1$ - - static final ILibModule[] EMPTY_LIBMODULES = new ILibModule[0]; - static final String[] EMPTY_FEATURES = new String[0]; - static boolean validWebSettings = true; - - public OldWebSettingsForMigration(IProject project) { - super(project, null); - } - - public OldWebSettingsForMigration(IProject project, IFile webSettings) { - super(project, null, webSettings); - if (getDOMDocument(webSettings) == null) { - validWebSettings = false; - } - } - - protected IFile getSettingsFile() { - if (fSettingsFile == null) { - fSettingsFile = fProject.getFile(IWebNatureConstants.WEBSETTINGS_MIGRATION_FILE_NAME); - } - return fSettingsFile; - } - - public String getContextRoot() { - return getValue(ELEMENT_CONTEXTROOT); - } - - public String getJSPLevel() { - return getValue(ELEMENT_JSPLEVEL); - } - - public String getWebContentName() { - return getValue(ELEMENT_WEBCONTENT); - } - - public ILibModule[] getLibModules() { - Element root = getRootElement(); - if (root == null) return EMPTY_LIBMODULES; - - Element libModuleNode = findChildNode(root, ELEMENT_LIBMODULES); - if (libModuleNode == null) return EMPTY_LIBMODULES; - - NodeList children = libModuleNode.getChildNodes(); - ArrayList results = new ArrayList(); - for (int i=0; i<children.getLength(); i++) { - Node node = children.item(i); - ILibModule libModule = getLibModule(node); - if (libModule != null) { - results.add(libModule); - } - } - - return (ILibModule[]) results.toArray(new ILibModule[results.size()]); - } - - protected ILibModule getLibModule(Node node) { - if (!node.getNodeName().equalsIgnoreCase(ELEMENT_LIBMODULE)) return null; - String jarName = getNodeValue((Element) node, ELEMENT_LIBMODULE_JAR); - String projectName = getNodeValue((Element) node, ELEMENT_LIBMODULE_PROJECT); - - ILibModule libModule = new LibModule(jarName, projectName); - return libModule; - } - - public String[] getFeatureIds() { - Element root = getRootElement(); - if (root == null) return EMPTY_FEATURES; - - Element featuresNode = findChildNode(root, ELEMENT_FEATURES); - if (featuresNode == null) return EMPTY_FEATURES; - - NodeList children = featuresNode.getChildNodes(); - ArrayList results = new ArrayList(); - for (int i=0; i<children.getLength(); i++) { - Node node = children.item(i); - String featureId = getFeatureId(node); - if (featureId != null) { - results.add(featureId); - } - } - - return (String[]) results.toArray(new String[results.size()]); - } - - protected String getFeatureId(Node node) { - if (!node.getNodeName().equalsIgnoreCase(ELEMENT_FEATURE)) return null; - String id = getNodeValue((Element) node, ELEMENT_FEATUREID); - - return id; - } - - public String getProjectType() { - return getValue(ELEMENT_PROJECTTYPE); - } - - public String getCurrentVersion() { - // The following change is needed when the websettings file is - // deleted from a version 4 workspace Checking for webapplication - // folder - Otherwise, new projects will not work. - IContainer webmoduleFolder = fProject.getFolder(IWebNatureConstants.WEB_MODULE_DIRECTORY_V4); - IFolder webinfFolder = ((IFolder) webmoduleFolder).getFolder(IWebNatureConstants.INFO_DIRECTORY); - if (webinfFolder.exists()) { - return VERSION_V4; - } - return CURRENT_VERSION; - } - - protected String getValue(String settingName) { - Element root = getRootElement(); - if (root == null) return null; - return getNodeValue(root, settingName); - } - - protected void createNewDocument() throws CoreException, IOException{ - StringWriter writer = new StringWriter(); - writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$ - writer.write("\n"); //$NON-NLS-1$ - writer.write("<websettings version=\""); //$NON-NLS-1$ - writer.write(getCurrentVersion()); - writer.write("\">");//$NON-NLS-1$ - writer.write("\n"); //$NON-NLS-1$ - writer.write("</websettings>"); //$NON-NLS-1$ - writer.write("\n"); //$NON-NLS-1$ - - InputStream sourceStream = new ByteArrayInputStream(writer.toString().getBytes("UTF8")); //$NON-NLS-1$ - IFile webSettingsFile = getSettingsFile(); - if (webSettingsFile.exists()) - webSettingsFile.setContents(sourceStream, true, true, null); - else - webSettingsFile.create(sourceStream, true, null); - read(); - } - - public void setContextRoot(String contextRoot) { - setValue(ELEMENT_CONTEXTROOT, contextRoot); - } - - public void setJSPLevel(String jspLevel) { - setValue(ELEMENT_JSPLEVEL, jspLevel); - } - - public void setWebContentName(String name) { - String defaultName= getWebContentName(); - if (defaultName == null || defaultName.length() == 0 || !name.equals(defaultName)) - setValue(ELEMENT_WEBCONTENT, name); - } - - public void setProjectType(String projectType) { - setValue(ELEMENT_PROJECTTYPE, projectType); - } - - public void setLibModules(ILibModule[] libModules) { - Document doc = getOrCreateDocument(); - Node libModulesNode = findOrCreateChildNode(doc.getDocumentElement(),ELEMENT_LIBMODULES); - Node firstChild = null; - - // Remove all of the children. - while ((firstChild = libModulesNode.getFirstChild()) != null) - libModulesNode.removeChild(firstChild); - - // Add new children. - for (int i = 0; i < libModules.length; i++) { - ILibModule iLibModule = libModules[i]; - if (iLibModule != null) - addLibModule(libModulesNode, iLibModule); - } - } - - protected void addLibModule(Node libModulesNode, ILibModule libModule) { - Document doc = getDOMDocument(); - Element libModuleNode = doc.createElement(ELEMENT_LIBMODULE); - libModulesNode.appendChild(libModuleNode); - setValue(libModuleNode, ELEMENT_LIBMODULE_JAR, libModule.getJarName()); - setValue(libModuleNode, ELEMENT_LIBMODULE_PROJECT, libModule.getProjectName()); - } - - public void setFeatureIds(String[] featureIds) { - Document doc = getOrCreateDocument(); - Node featuresNode = findOrCreateChildNode(doc.getDocumentElement(),ELEMENT_FEATURES); - - // Add new children. - for (int i = 0; i < featureIds.length; i++) { - String sFeatureId = featureIds[i]; - if (sFeatureId != null) - addFeatureId(featuresNode, sFeatureId); - } - } - - protected void addFeatureId(Node featuresNode, String featureId) { - Document doc = getDOMDocument(); - Element featureNode = doc.createElement(ELEMENT_FEATURE); - featuresNode.appendChild(featureNode); - setValue(featureNode,ELEMENT_FEATUREID, featureId); - } - - public boolean isValidWebSettings() { - return validWebSettings; - } - public void removeFeatureId(String removeId) { - Element root = getRootElement(); - if (root != null) { - Element featuresNode = findChildNode(root, ELEMENT_FEATURES); - if (featuresNode != null) { - NodeList children = featuresNode.getChildNodes(); - ArrayList results = new ArrayList(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - String featureId = getFeatureId(node); - if (featureId != null) { - // determine if in the list to remove - if (!(featureId.equals(removeId))) - results.add(featureId); - } - } - // Remove all of the children. - Node firstChild = null; - while ((firstChild = featuresNode.getFirstChild()) != null) - featuresNode.removeChild(firstChild); - if (results.size() > 0) { - String[] updateFeatureIds = (String[]) results.toArray(new String[results.size()]); - // Add new children. - for (int i = 0; i < results.size(); i++) { - String sFeatureId = updateFeatureIds[i]; - if (sFeatureId != null) - addFeatureId(featuresNode, sFeatureId); - } - } - } - } - } - public String getRootNodeName() { - return ELEMENT_WEBSETTINGS; - } - - public static String getWebContentDirectory(InputStream inputStream){ - InputStreamReader fileStream = null; - try { - fileStream = new InputStreamReader(inputStream, "utf-8"); //$NON-NLS-1$ - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document fDomDocument = parser.parse(new InputSource(fileStream)); - Element root = fDomDocument.getDocumentElement(); - if(root.getNodeName().equalsIgnoreCase(ELEMENT_WEBSETTINGS)){ - NodeList list = root.getChildNodes(); - for(int i=0, length = list.getLength();i<length; i++){ - Node node = list.item(i); - if(node.getNodeName().equals(ELEMENT_WEBCONTENT)){ - NodeList childNodes = node.getChildNodes(); - for (int j = 0, childLength = childNodes.getLength(); j < childLength; j++) { - Node curNode = childNodes.item(j); - if (curNode.getNodeType() == Node.TEXT_NODE) { - return curNode.getNodeValue(); - } - } - return null; - } - } - } - } catch (UnsupportedEncodingException e) { - //Ignore - } catch (ParserConfigurationException e) { - //Ignore - } catch (FactoryConfigurationError e) { - //Ignore - } catch (SAXException e) { - //Ignore - } catch (IOException e) { - //Ignore - } catch(Exception e){ - //Ignore - }finally { - if (fileStream != null) - try { - fileStream.close(); - } catch (IOException e1) { - //Ignore - } - } - return null; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/WebMessages.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/WebMessages.java deleted file mode 100644 index 22af7632e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/operations/WebMessages.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Jan 13, 2004 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages; - - -/** - * @author jialin - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class WebMessages extends J2EECommonMessages { - public static final String ERR_JAR_NAME_EMPTY = "ERR_JAR_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_JAR_NAME_EXIST = "ERR_JAR_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_JAVA_PROJECT_NAME_EMPTY = "ERR_JAVA_PROJECT_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_JAVA_PROJECT_NAME_EXIST = "ERR_JAVA_PROJECT_NAME_EXIST"; //$NON-NLS-1$ - - public static final String ERR_DUPLICATED_INIT_PARAMETER = "ERR_DUPLICATED_INIT_PARAMETER"; //$NON-NLS-1$ - public static final String ERR_DUPLICATED_URL_MAPPING = "ERR_DUPLICATED_URL_MAPPING"; //$NON-NLS-1$ - - public static final String ERR_DISPLAY_NAME_EMPTY = "ERR_DISPLAY_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_SERVLET_NAME_EXIST = "ERR_SERVLET_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_SERVLET_DISPLAY_NAME_EXIST = "ERR_SERVLET_DISPLAY_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_SERVLET_CLASS_NAME_USED = "ERR_SERVLET_CLASS_NAME_USED"; //$NON-NLS-1$ - public static final String ERR_SERVLET_JAVA_CLASS_NAME_INVALID = "ERR_SERVLET_JAVA_CLASS_NAME_INVALID"; //$NON-NLS-1$ - public static final String ERR_SERVLET_MAPPING_SERVLET_NOT_EXIST = "ERR_SERVLET_MAPPING_SERVLET_NOT_EXIST"; //$NON-NLS-1$ - public static final String ERR_SERVLET_MAPPING_URL_PATTERN_EMPTY = "ERR_SERVLET_MAPPING_URL_PATTERN_EMPTY"; //$NON-NLS-1$ - public static final String ERR_SERVLET_MAPPING_URL_PATTERN_EXIST = "ERR_SERVLET_MAPPING_URL_PATTERN_EXIST"; //$NON-NLS-1$ - public static final String ERR_SERVLET_PARAMETER_NAME_EMPTY = "ERR_SERVLET_PARAMETER_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_SERVLET_PARAMETER_NAME_EXIST = "ERR_SERVLET_PARAMETER_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_SERVLET_PARAMETER_VALUE_EMPTY = "ERR_SERVLET_PARAMETER_VALUE_EMPTY"; //$NON-NLS-1$ - public static final String ERR_SERVLET_PARAMETER_VALUE_EXIST = "ERR_SERVLET_PARAMETER_VALUE_EXIST"; //$NON-NLS-1$ - - - public static final String ERR_PAGE_ENCODING_EMPTY = "ERR_PAGE_ENCODING_EMPTY"; //$NON-NLS-1$ - public static final String ERR_PAGE_ENCODING_EXIST = "ERR_PAGE_ENCODING_EXIST"; //$NON-NLS-1$ - public static final String ERR_URL_PATTERN_EXIST = "ERR_URL_PATTERN_EXIST"; //$NON-NLS-1$ - public static final String ERR_INCLUDE_PRELUDES_EXIST = "ERR_INCLUDE_PRELUDES_EXIST"; //$NON-NLS-1$ - public static final String ERR_INCLUDE_CODAS_EXIST = "ERR_INCLUDE_CODAS_EXIST"; //$NON-NLS-1$ - - public static final String ERR_SECURITY_CONSTRAINT_NAME_EMPTY = "ERR_SECURITY_CONSTRAINT_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_SECURITY_CONSTRAINT_NAME_EXIST = "ERR_SECURITY_CONSTRAINT_NAME_EXIST"; //$NON-NLS-1$ - - public static final String ERR_SERVLET_ROLE_REF_NAME_EMPTY = "ERR_SERVLET_ROLE_REF_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_SERVLET_ROLE_REF_NAME_EXIST = "ERR_SERVLET_ROLE_REF_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_SERVLET_ROLE_LINK_EMPTY = "ERR_SERVLET_ROLE_LINK_EMPTY"; //$NON-NLS-1$ - - public static final String ERR_CONTEXT_PARAMETER_NAME_EMPTY = "ERR_CONTEXT_PARAMETER_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_CONTEXT_PARAMETER_NAME_EXIST = "ERR_CONTEXT_PARAMETER_NAME_EXIST"; //$NON-NLS-1$ - - public static final String ERR_RESOURCE_NAME_EMPTY = "ERR_RESOURCE_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_RESOURCE_NAME_EXIST = "ERR_RESOURCE_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_URL_PATTERNS_EMPTY = "ERR_URL_PATTERNS_EMPTY"; //$NON-NLS-1$ - - public static final String ERR_MIME_MAPPING_EXTENSION_EMPTY = "ERR_MIME_MAPPING_EXTENSION_EMPTY"; //$NON-NLS-1$ - public static final String ERR_MIME_MAPPING_EXTENSION_EXIST = "ERR_MIME_MAPPING_EXTENSION_EXIST"; //$NON-NLS-1$ - - public static final String ERR_FILTER_DISPLAY_NAME_EXIST = "ERR_FILTER_DISPLAY_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_FILTER_CLASS_NAME_USED = "ERR_FILTER_CLASS_NAME_USED"; //$NON-NLS-1$ - public static final String ERR_FILTER_CLASS_NAME_INVALID = "ERR_FILTER_CLASS_NAME_INVALID"; //$NON-NLS-1$ - public static final String ERR_FILTER_MAPPING_URL_PATTERN_EMPTY = "3"; //$NON-NLS-1$ - public static final String ERR_FILTER_MAPPING_URL_PATTERN_EXIST = "4"; //$NON-NLS-1$ - public static final String ERR_FILTER_MAPPING_SERVLET_EMPTY = "5"; //$NON-NLS-1$ - public static final String ERR_FILTER_MAPPING_SERVLET_EXIST = "ERR_FILTER_MAPPING_SERVLET_EXIST"; //$NON-NLS-1$ - public static final String ERR_FILTER_MAPPING_SERVLET_DISPATCHER_TYPES_EMPTY = "ERR_FILTER_MAPPING_SERVLET_DISPATCHER_TYPES_EMPTY"; //$NON-NLS-1$ - public static final String ERR_FILTER_PARAM_NAME_EMPTY = "6"; //$NON-NLS-1$ - public static final String ERR_FILTER_PARAM_NAME_EXISTS = "ERR_FILTER_PARAMETER_NAME_EXIST"; //$NON-NLS-1$ - - public static final String ERR_LISTENER_DISPLAY_NAME_EXIST = "ERR_LISTENER_DISPLAY_NAME_EXIST"; //$NON-NLS-1$ - public static final String ERR_LISTENER_CLASS_NAME_USED = "ERR_LISTENER_CLASS_NAME_USED"; //$NON-NLS-1$ - public static final String ERR_LISTENER_CLASS_NAME_INVALID = "ERR_LISTENER_CLASS_NAME_INVALID"; //$NON-NLS-1$ - - public static final String ERR_ENV_ENTRY_NAME_EMPTY = "ERR_ENV_ENTRY_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_ENV_ENTRY_NAME_EXIST = "ERR_ENV_ENTRY_NAME_EXIST"; //$NON-NLS-1$ - - public static final String ERR_WELCOME_PAGE_EMPTY = "ERR_WELCOME_PAGE_EMPTY"; //$NON-NLS-1$ - public static final String ERR_WELCOME_PAGE_EXIST = "ERR_WELCOME_PAGE_EXIST"; //$NON-NLS-1$ - - public static final String ERR_ERROR_CODE_EMPTY = "ERR_ERROR_CODE_EMPTY"; //$NON-NLS-1$ - public static final String ERR_ERROR_CODE_MUST_BE_3_DIGITS = "ERR_ERROR_CODE_MUST_BE_3_DIGITS"; //$NON-NLS-1$ - - public static final String ERR_ERROR_PAGE_LOCATION_EMPTY = "ERR_ERROR_PAGE_LOCATION_EMPTY"; //$NON-NLS-1$ - public static final String ERR_ERROR_PAGE_LOCATION_EXIST = "ERR_ERROR_PAGE_LOCATION_EXIST"; //$NON-NLS-1$ - public static final String ERR_ERROR_PAGE_LOCATION_MUST_START_WITH_SLASH = "ERR_ERROR_PAGE_LOCATION_MUST_START_WITH_SLASH"; //$NON-NLS-1$ - - public static final String ERR_EXCEPTION_TYPE_EMPTY = "ERR_EXCEPTION_TYPE_EMPTY"; //$NON-NLS-1$ - - public static final String ERR_LOCALE_NAME_EMPTY = "ERR_LOCALE_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_LOCALE_NAME_EXIST = "ERR_LOCALE_NAME_EXIST"; //$NON-NLS-1$ - - public static final String ERR_TAGLIBREF_URL_EMPTY = "ERR_TAGLIBREF_URL_EMPTY"; //$NON-NLS-1$ - public static final String ERR_TAGLIBREF_URL_EXIST = "ERR_TAGLIBREF_URL_EXIST"; //$NON-NLS-1$ - - public static final String ERR_MESSAGE_DESTINATION_NAME_EMPTY = "ERR_MESSAGE_DESTINATION_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_MESSAGE_DESTINATION_NAME_EXIST = "ERR_MESSAGE_DESTINATION_NAME_EXIST"; //$NON-NLS-1$ - - // Security Identity Wizard, EJB EDITOR - public static final String ERR_EXCEPTION_SECURITY_ID_EMPTY_ROLE_NAME = "ERR_EXCEPTION_ROLE_NAME_EMPTY"; //$NON-NLS-1$ - public static final String ERR_EXCEPTION_SECURITY_ID_NO_BEANS = "ERR_EXCEPTION_SECURITY_ID_NO_BEANS"; //$NON-NLS-1$ - - //Method Permission Wizard, EJB EDITOR - public static final String ERR_EXCEPTION_SECURITY_ROLES_EMPTY = ERR_EXCEPTION_SECURITY_ID_EMPTY_ROLE_NAME; - public static final String ERR_EXCEPTION_METHOD_ELEMENTS_EMPTY = "ERR_EXCEPTION_METHOD_ELEMENT_EMPTY"; //$NON-NLS-1$ - - //Method Transaction Wizard, EJB EDITOR - public static final String ERR_EXCEPTION_METHOD_TRANSACTION_EMPTY = "ERR_EXCEPTION_METHOD_TRANSACTION_ATTRIBUTES_EMPTY"; //$NON-NLS-1$ - - public static final String ERR_SERVLET_LIST_EMPTY = "ERR_SERVLET_LIST_EMPTY"; //$NON-NLS-1$ - public static final String ERR_FILTER_LIST_EMPTY = "ERR_FILTER_LIST_EMPTY"; //$NON-NLS-1$ - public static final String ERR_LISTENER_LIST_EMPTY = "ERR_LISTENER_LIST_EMPTY"; //$NON-NLS-1$ - - private static final WebMessages INSTANCE = new WebMessages(); - - /** - * Returns the string from the resource bundle, or 'key' if not found. - */ - public static String getResourceString(String key) { - return INSTANCE.doGetResourceString(key); - } - - public static String getResourceString(String key, Object[] args) { - return INSTANCE.doGetResourceString(key, args); - } - - protected WebMessages() { - super(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.Messages#initializeBundle() - */ - protected void initializeBundle() { - try { - this.resourceBundle = ResourceBundle.getBundle("web"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - //Do nothing - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebModuleExtensionImpl.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebModuleExtensionImpl.java deleted file mode 100644 index e31b4510f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebModuleExtensionImpl.java +++ /dev/null @@ -1,251 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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 - **************************************************************************************************/ -/* - * Created on Sep 29, 2003 - * - * To change the template for this generated file go to Window>Preferences>Java>Code - * Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.plugin; - -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationOperation; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEModuleImportDataModel; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.internal.earcreation.UpdateModuleReferencesInEARProjectCommand; -import org.eclipse.jst.j2ee.internal.moduleextension.EarModuleExtensionImpl; -import org.eclipse.jst.j2ee.internal.moduleextension.WebModuleExtension; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEJavaProjectInfo; -import org.eclipse.jst.j2ee.internal.project.J2EENature; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationDataModel; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationOperation; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebModuleImportDataModel; -import org.eclipse.jst.j2ee.internal.web.operations.WebProjectInfo; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.wst.common.componentcore.StructureEdit; - - - -public class WebModuleExtensionImpl extends EarModuleExtensionImpl implements WebModuleExtension { - - /** - * - */ - public WebModuleExtensionImpl() { - super(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#createProjectInfo() - */ - public J2EEJavaProjectInfo createProjectInfo() { - // TODO Auto-generated method stub - return null; - } - - public void initializeEjbReferencesToModule(J2EENature moduleNature, UpdateModuleReferencesInEARProjectCommand command) { -// WebEditModel editModel; -// try { -// editModel = ((J2EEWebNatureRuntime) moduleNature).getWebAppEditModelForWrite(this); -// } catch (Exception e) { -// return; -// } - WebArtifactEdit webEdit = null; - WebApp webApp = null; - try{ - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead( moduleNature.getProject()); - if(webEdit != null) - webApp = (WebApp) webEdit.getDeploymentDescriptorRoot(); - if (webApp != null) { - command.initializeEjbReferencesToModule(webApp.getEjbRefs()); - command.initializeEjbReferencesToModule(webApp.getEjbLocalRefs()); - } - } finally{ - if( webEdit != null ) - webEdit.dispose(); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#addWLPProjects(org.eclipse.core.resources.IProject, - * java.util.Set) - */ - public void addWLPProjects(IProject aProject, Set projectsToBuild) { -// J2EEWebNatureRuntime nature = J2EEWebNatureRuntime.getRuntime(aProject); -// if (nature == null) -// return; -// ILibModule[] libModules = nature.getLibModules(); -// for (int i = 0; i < libModules.length; i++) { -// IProject p = libModules[i].getProject(); -// if (p.isAccessible()) -// projectsToBuild.add(libModules[i].getProject()); -// } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#createWebProjectInfo(org.eclipse.jst.j2ee.internal.internal.commonarchivecore.Archive) - */ - public J2EEJavaProjectInfo createWebProjectInfo(Archive anArchive) { - WebProjectInfo info = new WebProjectInfo(); - //Moved this code below to EARProjectSaveStrategyImpl, to defer the - // work - //and avoid hangs in the wizard right after finish pressed - /* - * boolean isVersion2_2 = !ArchiveUtil.isJ2EE13FastCheck((WARFile)anArchive); if - * (isVersion2_2) { info.setJSPLevel(IJ2EEWebNature.JSPLEVEL_1_1); - * info.setServletLevel(IJ2EEWebNature.SERVLETLEVEL_2_2); - */ - return info; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#setContextRootForModuleMapping(org.eclipse.jst.j2ee.internal.internal.application.WebModule, - * org.eclipse.core.resources.IProject) - */ - public void setContextRootForModuleMapping(WebModule webModule, IProject nestedProject) throws CoreException { - WebArtifactEdit webEdit = null; - try{ - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead( nestedProject ); - if(webEdit != null) { - webEdit.setServerContextRoot(webModule.getContextRoot()); - } - } finally{ - if( webEdit != null ) - webEdit.dispose(); - } -// if (wnr != null) { -// wnr.setContextRoot(webModule.getContextRoot()); -// } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#hasRuntime(org.eclipse.core.resources.IProject) - */ - public boolean hasRuntime(IProject project) { - //return J2EEWebNatureRuntimeUtilities.hasJ2EERuntime(project); - //To do: work based on module - return false; - } - - // public J2EEImportOperationOLD createImportOperation(IProject - // nestedProject, WARFile warFile, EARImportConfiguration importConfig){ - // WarImportOperation op = new WarImportOperation(nestedProject, warFile); - // //op.setServerTarget(info.getServerTarget()); - // HashMap opMap = importConfig.createProjectOption; - // if(opMap != null && !opMap.isEmpty()) - // op.createWLProjectOptions = opMap; - // return op; - // } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#getContentFolder(org.eclipse.core.resources.IProject, - * org.eclipse.jst.j2ee.internal.internal.commonarchivecore.File) - */ - - public String getContentFolder(IProject project, IFile webSettingsFile) { - String contentFolder = null; - -// WebSettings webSettings = new WebSettings(project, webSettingsFile); -// if (webSettings != null) { -// contentFolder = webSettings.getWebContentName(); -// } - //To do: Needs work here, no content folder exists now - WebArtifactEdit webEdit = null; - try{ - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if(webEdit != null) { - - } - } finally { - if( webEdit != null ) - webEdit.dispose(); - } - - return contentFolder; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.WebModuleExtension#compareWebContextRoot(org.eclipse.jst.j2ee.internal.internal.application.Module, - * org.eclipse.core.resources.IProject) - */ - public boolean compareWebContextRoot(Module module, IProject project) throws CoreException { - String contextRoot = ((WebModule) module).getContextRoot(); - if (contextRoot != null) - return ((contextRoot).equals(getServerContextRoot(project))); - return false; - } - - protected String getServerContextRoot(IProject project) { - WebArtifactEdit webEdit = null; - try{ - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if(webEdit != null) { - return webEdit.getServerContextRoot(); - } - } finally { - if( webEdit != null ) - webEdit.dispose(); - } - return ""; //$NON-NLS-1$ - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.EarModuleExtension#createProjectCreationOperation(org.eclipse.jst.j2ee.internal.internal.application.operations.J2EEModuleCreationDataModel) - */ - public J2EEComponentCreationOperation createProjectCreationOperation(J2EEComponentCreationDataModel dataModel) { - return new WebComponentCreationOperation((WebComponentCreationDataModel) dataModel); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.EarModuleExtension#createProjectDataModel() - */ - public J2EEComponentCreationDataModel createProjectDataModel() { - return new WebComponentCreationDataModel(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.moduleextension.EarModuleExtension#createImportDataModel() - */ - public J2EEModuleImportDataModel createImportDataModel() { - return new WebModuleImportDataModel(); - } - - public String getNatureID() { - return IWebNatureConstants.J2EE_NATURE_ID; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java deleted file mode 100644 index 30af35514..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java +++ /dev/null @@ -1,328 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.plugin; - -import java.io.IOException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.List; -import java.util.Vector; - -import org.eclipse.core.internal.boot.PlatformURLConnection; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdapterManager; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPluginResourceHandler; -import org.eclipse.jst.j2ee.internal.web.operations.WebContentResourceChangeListener; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibRegistryManager; -import org.eclipse.jst.j2ee.internal.web.taglib.TaglibRegistryManager; -import org.eclipse.jst.j2ee.internal.web.util.WebEditAdapterFactory; -import org.eclipse.jst.j2ee.internal.webapplication.impl.WebAppResourceFactory; -import org.eclipse.wst.common.componentcore.ArtifactEditModel; -import org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry; -import org.eclipse.wst.common.frameworks.internal.WTPPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - - -/** - * This is a top-level class of the j2ee plugin. - * - */ - -public class WebPlugin extends WTPPlugin implements ResourceLocator { - // Default instance of the receiver - private static WebPlugin inst; - protected final IPath iconsFolder = new Path(Platform.getBundle(PLUGIN_ID).getEntry("icons").getPath()); //$NON-NLS-1$ - // Links View part of the plugin - //public static final String LINKS_BUILDER_ID = - // "com.ibm.etools.links.management.linksbuilder";//$NON-NLS-1$ - public static final String LINKS_BUILDER_ID = "com.ibm.etools.webtools.additions.linksbuilder"; //$NON-NLS-1$ - // LibDir Change Listener - public static final String LIBDIRCHANGE_BUILDER_ID = "com.ibm.etools.webtools.LibDirBuilder"; //$NON-NLS-1$ - public static final String PLUGIN_ID = "org.eclipse.jst.j2ee.web"; //$NON-NLS-1$ - // LibCopy builder ID - public static final String LIBCOPY_BUILDER_ID = "org.eclipse.jst.j2ee.LibCopyBuilder"; //$NON-NLS-1$ - // Validation part of the plugin - //Global ResourceSet (somewhat global) - protected ITaglibRegistryManager taglibRegistryManager; - private static IPath location; - private IResourceChangeListener fWebContentListener; - - public static final String[] ICON_DIRS = new String[]{"icons/full/obj16", //$NON-NLS-1$ - "icons/full/cview16", //$NON-NLS-1$ - "icons/full/ctool16", //$NON-NLS-1$ - "icons/full/clcl16", //$NON-NLS-1$ - "icons/full/ovr16", //$NON-NLS-1$ - "icons/full/extra", //$NON-NLS-1$ - "icons/full/wizban", //$NON-NLS-1$ - "icons", //$NON-NLS-1$ - ""}; //$NON-NLS-1$ - - /** - * Create the J2EE plugin and cache its default instance - */ - public WebPlugin() { - super(); - if (inst == null) - inst = this; - } - - /** - * Get the plugin singleton. - */ - static public WebPlugin getDefault() { - return inst; - } - - /* - * Javadoc copied from interface. - */ - public URL getBaseURL() { - return getBundle().getEntry("/"); //$NON-NLS-1$ - } - - public Object[] getJ2EEWebProjectMigrationExtensions() { - - IExtensionRegistry registry = Platform.getExtensionRegistry(); - IExtensionPoint pct = registry.getExtensionPoint(getBundle().getSymbolicName(), "J2EEWebProjectMigrationExtension"); //$NON-NLS-1$ - - IExtension[] extension = pct.getExtensions(); - List ret = new Vector(); - for (int l = 0; l < extension.length; ++l) { - IExtension config = extension[l]; - - IConfigurationElement[] cElems = config.getConfigurationElements(); - for (int i = 0; i < cElems.length; i++) { - IConfigurationElement d = cElems[i]; - if (d.getName().equals("migration")) { //$NON-NLS-1$ - try { - Object me = d.createExecutableExtension("run"); //$NON-NLS-1$ - - ret.add(me); - } catch (Exception ex) { - // ignore this extension, keep going - } - } - } - } - - return ret.toArray(); - } - - /** - * This gets a .gif from the icons folder. - */ - public Object getImage(String key) { - return J2EEPlugin.getImageURL(key, getBundle()); - } - - public static IPath getInstallLocation() { - if (location == null) { - URL url = getInstallURL(); - try { - String installLocation = ((PlatformURLConnection) url.openConnection()).getURLAsLocal().getFile(); - location = new Path(installLocation); - } catch (IOException e) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logWarning(J2EEPluginResourceHandler.getString("Install_Location_Error_", new Object[]{url}) + e); //$NON-NLS-1$ - } - } - return location; - } - - public static URL getInstallURL() { - return getDefault().getBundle().getEntry("/"); //$NON-NLS-1$ - } - - /** - * Get the singleton instance. - */ - public static WebPlugin getPlugin() { - return inst; - } - - /** - * Return the plugin directory location- the directory that all the plugins are located in (i.e. - * d:\installdir\plugin) - */ - public static IPath getPluginLocation(String pluginId) { - IExtensionRegistry registry = Platform.getExtensionRegistry(); - Bundle bundle = Platform.getBundle(pluginId); - if (bundle != null) { - try { - IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); //$NON-NLS-1$ - String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); - return new Path(installStr); - } catch (IOException e) { - //Do nothing - } - } - return null; - } - - /** - * Return the Servlets Jar file path preference. - * - * @return String the file path to the servlets jar, or null if never specified. - * @deprecated - the preference store is no longer on this plugin because of the UI dependency. - */ - public String getPreferenceServletsJar() { - // return getPreferenceStore().getString(IWebToolingCoreConstants.PROP_SERVLET_JAR); - return "THIS IS THE WRONG PATH - NEED TO CHANGE IMPLEMENTATION!!!!!"; //$NON-NLS-1$ - } - - /** - * Return the Servlets Jar file path preference. - * - * @return String the file path to the servlets jar, or null if never specified. - * @deprecated - the preference store is no longer on this plugin because of the UI dependency. - */ - public String getPreferenceWebASJar() { - //return getPreferenceStore().getString(IWebToolingCoreConstants.PROP_WEBAS_JAR); - return "THIS IS THE WRONG PATH - NEED TO CHANGE IMPLEMENTATION!!!!!"; //$NON-NLS-1$ - } - - public ITaglibRegistryManager getTaglibRegistryManager() { - if (this.taglibRegistryManager == null) - this.taglibRegistryManager = createTaglibRegistryManager(); - return this.taglibRegistryManager; - } - - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - /** - * If this is called from an operation, in response to some other exception that was caught, - * then the client code should throw {@link com.ibm.etools.wft.util.WFTWrappedException}; - * otherwise this can still be used to signal some other error condition within the operation, - * or to throw a core exception in a context other than executing an operation - * - * Create a new IStatus of type ERROR using the J2EEPlugin ID. aCode is just an internal code. - */ - public static IStatus newErrorStatus(int aCode, String aMessage, Throwable exception) { - return newStatus(IStatus.ERROR, aCode, aMessage, exception); - } - - /** - * If this is called from an operation, in response to some other exception that was caught, - * then the client code should throw {@link com.ibm.etools.wft.util.WFTWrappedException}; - * otherwise this can still be used to signal some other error condition within the operation, - * or to throw a core exception in a context other than executing an operation - * - * Create a new IStatus of type ERROR, code OPERATION_FAILED, using the J2EEPlugin ID - */ - public static IStatus newErrorStatus(String aMessage, Throwable exception) { - return newErrorStatus(0, aMessage, exception); - } - - /** - * If this is called from an operation, in response to some other exception that was caught, - * then the client code should throw {@link com.ibm.etools.wft.util.WFTWrappedException}; - * otherwise this can still be used to signal some other error condition within the operation. - * - * Create a new IStatus of type ERROR, code OPERATION_FAILED, using the J2EEPlugin ID - */ - public static IStatus newOperationFailedStatus(String aMessage, Throwable exception) { - return newStatus(IStatus.ERROR, IResourceStatus.OPERATION_FAILED, aMessage, exception); - } - - /** - * Create a new IStatus with a severity using the J2EEPlugin ID. aCode is just an internal code. - */ - public static IStatus newStatus(int severity, int aCode, String aMessage, Throwable exception) { - return new Status(severity, PLUGIN_ID, aCode, aMessage, exception); - } - - /* - * Javadoc copied from interface. - */ - public String getString(String key) { - return Platform.getResourceString(getBundle(), key); - } - - /* - * Javadoc copied from interface. - */ - public String getString(String key, Object[] substitutions) { - return MessageFormat.format(getString(key), substitutions); - } - - /* - * Add the web content listener. This listener is used to detect when a web project's web - * content folder has been renamed. - */ - private void addWebContentListener() { - this.fWebContentListener = new WebContentResourceChangeListener(); - getWorkspace().addResourceChangeListener(this.fWebContentListener, IResourceChangeEvent.PRE_BUILD); - } - - /* - * Remove the web content listener. - */ - private void removeWebContentListener() { - if (this.fWebContentListener != null) { - if (getWorkspace() == null) - return; - getWorkspace().removeResourceChangeListener(this.fWebContentListener); - this.fWebContentListener = null; - } - } - - - - public void stop(BundleContext context) throws Exception { - super.stop(context); - if (this.taglibRegistryManager != null) - this.taglibRegistryManager.dispose(); - - // remove listener for web content changes - removeWebContentListener(); - } - - protected ITaglibRegistryManager createTaglibRegistryManager() { - return new TaglibRegistryManager(); - } - - public void start(BundleContext context) throws Exception { - super.start(context); - // register the listener for link refactoring of moved/renamed files - // add listener for web content changes - addWebContentListener(); - WebAppResourceFactory.register(WTPResourceFactoryRegistry.INSTANCE); - IAdapterManager manager = Platform.getAdapterManager(); - manager.registerAdapters(new WebEditAdapterFactory(), ArtifactEditModel.class); - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.WTPPlugin#getPluginID() - */ - public String getPluginID() { - return PLUGIN_ID; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/AuthConstraintItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/AuthConstraintItemProvider.java deleted file mode 100644 index f1ee77847..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/AuthConstraintItemProvider.java +++ /dev/null @@ -1,225 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.Description; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.AuthConstraint; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.AuthConstraint} - * object. - */ -public class AuthConstraintItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public AuthConstraintItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns authority_constraint.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("authority_constraint");//$NON-NLS-1$ - } - - /** - * This returns the secConstraint of the AuthConstraint. - */ - public Object getParent(Object object) { - return ((AuthConstraint) object).getSecConstraint(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Description_UI__UI_"), //$NON-NLS-1$ = "Description" - WebAppEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ = "The description property" - pkg.getAuthConstraint_Description())); - // This is for the roles feature. - // - WebToolingItemPropertyDescriptor propertyDescriptor = new WebToolingItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Roles_UI_"), //$NON-NLS-1$ = "Roles" - WebAppEditResourceHandler.getString("The_roles_property_UI_"), //$NON-NLS-1$ = "The roles property" - pkg.getAuthConstraint_Roles(), WebToolingItemPropertyDescriptor.AUTH_CONSTRAINT_ROLES_EDITOR); - itemPropertyDescriptors.add(propertyDescriptor); - // This is for the secConstraint feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("SecConstraint_UI_"), //$NON-NLS-1$ = "SecConstraint" - WebAppEditResourceHandler.getString("The_secConstraint_property_UI_"), //$NON-NLS-1$ = "The secConstraint property" - pkg.getAuthConstraint_SecConstraint())); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_AuthConstraint_description_feature"), getString( //$NON-NLS-1$ - "_UI_PropertyDescriptor_description", "_UI_AuthConstraint_description_feature", //$NON-NLS-1$ //$NON-NLS-2$ - "_UI_AuthConstraint_type"), WebapplicationPackage.eINSTANCE.getAuthConstraint_Description(), true, //$NON-NLS-1$ - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Roles feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addRolesPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_AuthConstraint_roles_feature"), getString( //$NON-NLS-1$ - "_UI_PropertyDescriptor_description", "_UI_AuthConstraint_roles_feature", "_UI_AuthConstraint_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getAuthConstraint_Roles(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getAuthConstraint_Descriptions()); - } - return childrenReferences; - } - - public String getText(Object object) { - String description = ((AuthConstraint) object).getDescription(); - if (description == null) { - List descList = ((AuthConstraint) object).getDescriptions(); - if (descList != null && descList.size() > 0) - description = ((Description) descList.get(0)).getValue(); - } - if (description == null) - description = ""; //$NON-NLS-1$ - // return WebAppEditResourceHandler.getString("11concat_UI_", (new - // Object[]{description})); //$NON-NLS-1$ = "AuthConstraint {0}" - return description; - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(AuthConstraint.class)) { - case WebapplicationPackage.AUTH_CONSTRAINT__DESCRIPTION : - case WebapplicationPackage.AUTH_CONSTRAINT__ROLES : - case WebapplicationPackage.AUTH_CONSTRAINT__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getAuthConstraint_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getAuthConstraint_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.edit.provider.IEditingDomainItemProvider#createCommand(java.lang.Object, - * org.eclipse.emf.edit.domain.EditingDomain, java.lang.Class, - * org.eclipse.emf.edit.command.CommandParameter) - */ - public Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter) { - EStructuralFeature sf = commandParameter.getEReference(); - if (sf == null) { - sf = commandParameter.getEAttribute(); - if (sf != null && !sf.isMany()) - sf = null; - } - if (sf != null) { - EObject owner = commandParameter.getEOwner(); - Collection collection = commandParameter.getCollection(); - if (commandClass == AddCommand.class) { - return createAddCommand(editingDomain, owner, sf, collection, commandParameter.getIndex()); - } else if (commandClass == RemoveCommand.class) { - return createRemoveCommand(editingDomain, owner, sf, collection); - } - } - return super.createCommand(object, editingDomain, commandClass, commandParameter); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ContextParamItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ContextParamItemProvider.java deleted file mode 100644 index 7e9fdd802..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ContextParamItemProvider.java +++ /dev/null @@ -1,190 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.ContextParam; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ContextParam} - * object. - */ -public class ContextParamItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ContextParamItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns initializ_parameter_context.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("initializ_parameter_context");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the ContextParam. - */ - public Object getParent(Object object) { - return ((ContextParam) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the paramName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ParamName_UI_"), //$NON-NLS-1$ = "ParamName" - WebAppEditResourceHandler.getString("The_paramName_property_UI_"), //$NON-NLS-1$ = "The paramName property" - pkg.getContextParam_ParamName())); - - // This is for the paramValue feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ParamValue_UI_"), //$NON-NLS-1$ = "ParamValue" - WebAppEditResourceHandler.getString("The_paramValue_property_UI_"), //$NON-NLS-1$ = "The paramValue property" - pkg.getContextParam_ParamValue())); - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Description_UI__UI_"), //$NON-NLS-1$ = "Description" - WebAppEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ = "The description property" - pkg.getContextParam_Description())); - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * WebAppEditResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ = "WebApp" - * WebAppEditResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ = "The - * webApp property" pkg.getContextParam_WebApp())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Param Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addParamNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ContextParam_paramName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ContextParam_paramName_feature", "_UI_ContextParam_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getContextParam_ParamName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Param Value feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addParamValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ContextParam_paramValue_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ContextParam_paramValue_feature", "_UI_ContextParam_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getContextParam_ParamValue(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ContextParam_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ContextParam_description_feature", "_UI_ContextParam_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getContextParam_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("12concat_UI_", (new Object[]{((ContextParam) object).getParamName()})); //$NON-NLS-1$ = "ContextParam {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ContextParam.class)) { - case WebapplicationPackage.CONTEXT_PARAM__PARAM_NAME : - case WebapplicationPackage.CONTEXT_PARAM__PARAM_VALUE : - case WebapplicationPackage.CONTEXT_PARAM__DESCRIPTION : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ErrorCodeErrorPageItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ErrorCodeErrorPageItemProvider.java deleted file mode 100644 index 9946ef2c7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ErrorCodeErrorPageItemProvider.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.ErrorCodeErrorPage; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ErrorCodeErrorPage} - * object. - */ -public class ErrorCodeErrorPageItemProvider extends ErrorPageItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ErrorCodeErrorPageItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns errorcode_errorpage.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("errorcode_errorpage"); //$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the errorCode feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ErrorCode_UI_"), //$NON-NLS-1$ = "ErrorCode" - WebAppEditResourceHandler.getString("The_errorCode_property_UI_"), //$NON-NLS-1$ = "The errorCode property" - pkg.getErrorCodeErrorPage_ErrorCode())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Error Code feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addErrorCodePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ErrorCodeErrorPage_errorCode_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ErrorCodeErrorPage_errorCode_feature", "_UI_ErrorCodeErrorPage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getErrorCodeErrorPage_ErrorCode(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("14concat_UI_", (new Object[]{((ErrorCodeErrorPage) object).getErrorCode()})); //$NON-NLS-1$ = "ErrorCodeErrorPage {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ErrorCodeErrorPage.class)) { - case WebapplicationPackage.ERROR_CODE_ERROR_PAGE__ERROR_CODE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ErrorPageItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ErrorPageItemProvider.java deleted file mode 100644 index e2565194c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ErrorPageItemProvider.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.ErrorPage; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ErrorPage}object. - */ -public class ErrorPageItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ErrorPageItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns error_page.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("error_page"); //$NON-NLS-1$ - } - - /** - * This returns the webApp of the ErrorPage. - */ - public Object getParent(Object object) { - return ((ErrorPage) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the location feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Location_UI_"), //$NON-NLS-1$ = "Location" - WebAppEditResourceHandler.getString("The_location_property_UI_"), //$NON-NLS-1$ = "The location property" - pkg.getErrorPage_Location())); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Location feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLocationPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ErrorPage_location_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ErrorPage_location_feature", "_UI_ErrorPage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getErrorPage_Location(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("13concat_UI_", (new Object[]{((ErrorPage) object).getLocation()})); //$NON-NLS-1$ = "ErrorPage {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ErrorPage.class)) { - case WebapplicationPackage.ERROR_PAGE__LOCATION : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ExceptionTypeErrorPageItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ExceptionTypeErrorPageItemProvider.java deleted file mode 100644 index c5fe72faf..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ExceptionTypeErrorPageItemProvider.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.ExceptionTypeErrorPage; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ExceptionTypeErrorPage}object. - */ -public class ExceptionTypeErrorPageItemProvider extends ErrorPageItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ExceptionTypeErrorPageItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns exception_type_errorpage.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("exception_type_errorpage"); //$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the exceptionType feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ExceptionType_UI_"), //$NON-NLS-1$ = "ExceptionType" - WebAppEditResourceHandler.getString("The_exceptionType_property_UI_"), //$NON-NLS-1$ = "The exceptionType property" - pkg.getExceptionTypeErrorPage_ExceptionType())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Exception Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addExceptionTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ExceptionTypeErrorPage_exceptionType_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ExceptionTypeErrorPage_exceptionType_feature", "_UI_ExceptionTypeErrorPage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getExceptionTypeErrorPage_ExceptionType(), true)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("15concat_UI_", (new Object[]{((ExceptionTypeErrorPage) object).getExceptionTypeName()})); //$NON-NLS-1$ = "ExceptionTypeErrorPage {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FilterItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FilterItemProvider.java deleted file mode 100644 index 002bf21c4..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FilterItemProvider.java +++ /dev/null @@ -1,261 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.Filter; -import org.eclipse.jst.j2ee.webapplication.InitParam; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; - -public class FilterItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public FilterItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - InitParam child = WebapplicationFactory.eINSTANCE.createInitParam(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - WebApp webApp = (WebApp) ((Filter) object).eContainer(); - if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) - result.add(pkg.getFilter_InitParamValues()); - else - result.add(pkg.getFilter_InitParams()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "CreateInitParam"); //$NON-NLS-1$ - } - - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return "Create InitParam"; //$NON-NLS-1$ - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("26concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type InitParam for the selected {0}." - } - - /** - * This returns Filter.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("filter"); //$NON-NLS-1$ - } - - /** - * This returns the webApp of the Filter. - */ - public Object getParent(Object object) { - return WebapplicationPackage.eINSTANCE.getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - WebapplicationPackage wap = WebapplicationPackage.eINSTANCE; - - // This is for the filterName feature. - - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("FilterItemProvider_UI_0"), //$NON-NLS-1$ - WebAppEditResourceHandler.getString("The_filterName_property_3"), wap.getFilter_Name())); //$NON-NLS-1$ //$NON-NLS-2$ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Filter_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Filter_name_feature", "_UI_Filter_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFilter_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Filter Class feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addFilterClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Filter_filterClass_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Filter_filterClass_feature", "_UI_Filter_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFilter_FilterClass(), true)); - } - - /** - * This implements - * {@link IItemPropertySource#getPropertyValue IItemPropertySource.getPropertyValue}by - * delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public Object getPropertyValue(Object object, String property) { - Object ret = null; - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ret = ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).getPropertyValue(object); - } else - ret = super.getPropertyValue(object, property); - return ret; - } - - public String getText(Object object) { - Filter filter = (Filter) object; - String name = filter.getName(); - if (name == null) - name = "<filter>"; //$NON-NLS-1$ - return name; - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Filter.class)) { - case WebapplicationPackage.FILTER__NAME : - case WebapplicationPackage.FILTER__INIT_PARAMS : - case WebapplicationPackage.FILTER__INIT_PARAM_VALUES : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getFilter_InitParams(), WebapplicationFactory.eINSTANCE.createInitParam())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getFilter_InitParamValues(), CommonFactory.eINSTANCE.createParamValue())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This implements {@link IItemPropertySource#isPropertySet IItemPropertySource.isPropertySet} - * by delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public boolean isPropertySet(Object object, String property) { - boolean ret = false; - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ret = ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).isPropertySet(object); - } else - ret = super.isPropertySet(object, property); - return ret; - } - - /** - * This implements - * {@link IItemPropertySource#setPropertyValue IItemPropertySource.setPropertyValue}by - * delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public void setPropertyValue(Object object, String property, Object value) { - - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).setPropertyValue(object, value); - } else - super.setPropertyValue(object, property, value); - - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FilterMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FilterMappingItemProvider.java deleted file mode 100644 index 7c549cc7f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FilterMappingItemProvider.java +++ /dev/null @@ -1,196 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.Filter; -import org.eclipse.jst.j2ee.webapplication.FilterMapping; -import org.eclipse.jst.j2ee.webapplication.Servlet; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.FilterMapping} - * object. - */ -public class FilterMappingItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public FilterMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns filter_mapping.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("filter_mapping"); //$NON-NLS-1$ - } - - /** - * This returns the webApp of the FilterMapping. - */ - public Object getParent(Object object) { - return WebapplicationPackage.eINSTANCE.getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - WebapplicationPackage wap = WebapplicationPackage.eINSTANCE; - - // This is for the urlPattern feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("UrlPattern_UI_"), //$NON-NLS-1$ = "UrlPattern" - WebAppEditResourceHandler.getString("The_urlPattern_property_UI_"), //$NON-NLS-1$ = "The urlPattern property" - wap.getFilterMapping_UrlPattern())); - - // This is for the filter feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), "Filter", WebAppEditResourceHandler.getString("The_filter_property_2"), wap.getFilterMapping_Filter(), false)); //$NON-NLS-1$ //$NON-NLS-2$ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Url Pattern feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUrlPatternPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_FilterMapping_urlPattern_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FilterMapping_urlPattern_feature", "_UI_FilterMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFilterMapping_UrlPattern(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Dispatcher Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDispatcherTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_FilterMapping_dispatcherType_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FilterMapping_dispatcherType_feature", "_UI_FilterMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFilterMapping_DispatcherType(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Filter feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addFilterPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_FilterMapping_filter_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FilterMapping_filter_feature", "_UI_FilterMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFilterMapping_Filter(), true)); - } - - /** - * This adds a property descriptor for the Servlet feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addServletPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_FilterMapping_servlet_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FilterMapping_servlet_feature", "_UI_FilterMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFilterMapping_Servlet(), true)); - } - - - public String getText(Object object) { - FilterMapping filterMapping = (FilterMapping) object; - Filter filter = filterMapping.getFilter(); - String filterStr = (filter == null) ? WebAppEditResourceHandler.getString("?_UI_") : filter.getName(); //$NON-NLS-1$ = "?" - - String mapText = ((FilterMapping) object).getUrlPattern(); - if (mapText == null) { - Servlet servlet = filterMapping.getServlet(); - if (servlet != null) - mapText = servlet.getServletName(); - } - if (mapText == null) - mapText = "?"; //$NON-NLS-1$ - return WebAppEditResourceHandler.getString("Filter_mapping_text", new Object[]{filterStr, mapText}); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(FilterMapping.class)) { - case WebapplicationPackage.FILTER_MAPPING__URL_PATTERN : - case WebapplicationPackage.FILTER_MAPPING__FILTER : - case WebapplicationPackage.FILTER_MAPPING__SERVLET : - case WebapplicationPackage.FILTER_MAPPING__DISPATCHER_TYPE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FormLoginConfigItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FormLoginConfigItemProvider.java deleted file mode 100644 index 2c911731f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/FormLoginConfigItemProvider.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.FormLoginConfig; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.FormLoginConfig} - * object. - */ -public class FormLoginConfigItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public FormLoginConfigItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns form_login_config.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("form_login_config");//$NON-NLS-1$ - } - - /** - * This returns form_login_config.gif. - */ - //TODO Removing the UI dependency by commenting out this method - /* - * public Image getLabelImage(Object object) { return (Image) - * WEBUIPlugin.getDefault().getImageFromRegistry("form_login_config");//$NON-NLS-1$ } - */ - public String getLabelText(Object object) { - return WebAppEditResourceHandler.getString("52concat_UI_", (new Object[]{((FormLoginConfig) object).getFormLoginPage()})); //$NON-NLS-1$ = "FormLoginConfig {0}" - } - - /** - * This returns the loginConfig of the FormLoginConfig. - */ - public Object getParent(Object object) { - return ((FormLoginConfig) object).getLoginConfig(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the formLoginPage feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("FormLoginPage_UI_"), //$NON-NLS-1$ = "FormLoginPage" - WebAppEditResourceHandler.getString("The_formLoginPage_property_UI_"), //$NON-NLS-1$ = "The formLoginPage property" - pkg.getFormLoginConfig_FormLoginPage())); - - // This is for the formErrorPage feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("FormErrorPage_UI_"), //$NON-NLS-1$ = "FormErrorPage" - WebAppEditResourceHandler.getString("The_formErrorPage_property_UI_"), //$NON-NLS-1$ = "The formErrorPage property" - pkg.getFormLoginConfig_FormErrorPage())); - - // This is for the loginConfig feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("LoginConfig_UI_"), //$NON-NLS-1$ = "LoginConfig" - WebAppEditResourceHandler.getString("The_loginConfig_property_UI_"), //$NON-NLS-1$ = "The loginConfig property" - pkg.getFormLoginConfig_LoginConfig())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Form Login Page feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addFormLoginPagePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_FormLoginConfig_formLoginPage_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FormLoginConfig_formLoginPage_feature", "_UI_FormLoginConfig_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFormLoginConfig_FormLoginPage(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Form Error Page feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addFormErrorPagePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_FormLoginConfig_formErrorPage_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_FormLoginConfig_formErrorPage_feature", "_UI_FormLoginConfig_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getFormLoginConfig_FormErrorPage(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("16concat_UI_", (new Object[]{((FormLoginConfig) object).getFormLoginPage()})); //$NON-NLS-1$ = "FormLoginConfig {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(FormLoginConfig.class)) { - case WebapplicationPackage.FORM_LOGIN_CONFIG__FORM_LOGIN_PAGE : - case WebapplicationPackage.FORM_LOGIN_CONFIG__FORM_ERROR_PAGE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/HTTPMethodTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/HTTPMethodTypeItemProvider.java deleted file mode 100644 index 73e835693..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/HTTPMethodTypeItemProvider.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.HTTPMethodType; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.HTTPMethodType} - * object. - */ -public class HTTPMethodTypeItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public HTTPMethodTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns http_type.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("http_type");//$NON-NLS-1$ - } - - /** - * This returns the resCollection of the HTTPMethodType. - */ - public Object getParent(Object object) { - return ((HTTPMethodType) object).getHttpMethod(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the httpMethod feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("HttpMethod_UI_"), //$NON-NLS-1$ = "HttpMethod" - WebAppEditResourceHandler.getString("The_httpMethod_property_UI_"), //$NON-NLS-1$ = "The httpMethod property" - pkg.getHTTPMethodType_HttpMethod())); - - // This is for the resCollection feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ResCollection_UI_"), //$NON-NLS-1$ = "ResCollection" - WebAppEditResourceHandler.getString("The_resCollection_property_UI_"), //$NON-NLS-1$ = "The resCollection property" - pkg.getHTTPMethodType_HttpMethod())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Http Method feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addHttpMethodPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_HTTPMethodType_httpMethod_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_HTTPMethodType_httpMethod_feature", "_UI_HTTPMethodType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getHTTPMethodType_HttpMethod(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("17concat_UI_", (new Object[]{((HTTPMethodType) object).getHttpMethod()})); //$NON-NLS-1$ = "HTTPMethodType {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(HTTPMethodType.class)) { - case WebapplicationPackage.HTTP_METHOD_TYPE__HTTP_METHOD : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/InitParamItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/InitParamItemProvider.java deleted file mode 100644 index 24f748566..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/InitParamItemProvider.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.InitParam; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.InitParam}object. - */ -public class InitParamItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public InitParamItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns initializ_parameter.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("initializ_parameter"); //$NON-NLS-1$ - } - - /** - * This returns the servlet of the InitParam. - */ - public Object getParent(Object object) { - return ((InitParam) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the paramName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ParamName_UI_"), //$NON-NLS-1$ = "ParamName" - WebAppEditResourceHandler.getString("The_paramName_property_UI_"), //$NON-NLS-1$ = "The paramName property" - pkg.getInitParam_ParamName())); - - // This is for the paramValue feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ParamValue_UI_"), //$NON-NLS-1$ = "ParamValue" - WebAppEditResourceHandler.getString("The_paramValue_property_UI_"), //$NON-NLS-1$ = "The paramValue property" - pkg.getInitParam_ParamValue())); - - // This is for the description feature. - // - WebToolingItemPropertyDescriptor propertyDescriptor = new WebToolingItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Description_UI__UI_"), //$NON-NLS-1$ = "Description" - WebAppEditResourceHandler.getString("Description_UI__UI_"), //$NON-NLS-1$ = "Description" - pkg.getInitParam_Description(), WebToolingItemPropertyDescriptor.MULTILINE_TEXT_EDITOR); - itemPropertyDescriptors.add(propertyDescriptor); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Param Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addParamNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_InitParam_paramName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_InitParam_paramName_feature", "_UI_InitParam_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getInitParam_ParamName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Param Value feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addParamValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_InitParam_paramValue_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_InitParam_paramValue_feature", "_UI_InitParam_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getInitParam_ParamValue(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_InitParam_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_InitParam_description_feature", "_UI_InitParam_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getInitParam_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This implements - * {@link IItemPropertySource#getPropertyValue IItemPropertySource.getPropertyValue}by - * delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public Object getPropertyValue(Object object, String property) { - Object ret = null; - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ret = ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).getPropertyValue(object); - } else - ret = super.getPropertyValue(object, property); - return ret; - } - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("18concat_UI_", (new Object[]{((InitParam) object).getParamName(), ((InitParam) object).getParamValue()})); //$NON-NLS-1$ = "{0} = {1}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(InitParam.class)) { - case WebapplicationPackage.INIT_PARAM__PARAM_NAME : - case WebapplicationPackage.INIT_PARAM__PARAM_VALUE : - case WebapplicationPackage.INIT_PARAM__DESCRIPTION : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - - /** - * This implements {@link IItemPropertySource#isPropertySet IItemPropertySource.isPropertySet} - * by delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public boolean isPropertySet(Object object, String property) { - boolean ret = false; - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ret = ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).isPropertySet(object); - } else - ret = super.isPropertySet(object, property); - return ret; - } - - /** - * This implements - * {@link IItemPropertySource#setPropertyValue IItemPropertySource.setPropertyValue}by - * delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public void setPropertyValue(Object object, String property, Object value) { - - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).setPropertyValue(object, value); - } else - super.setPropertyValue(object, property, value); - - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ItemHolder.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ItemHolder.java deleted file mode 100644 index 2639c1842..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ItemHolder.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.Vector; - -import org.eclipse.emf.edit.provider.ItemProvider; -import org.eclipse.jst.j2ee.internal.web.operations.WebEditModel; -import org.eclipse.jst.j2ee.webapplication.WebApp; - - -/** - * Insert the type's description here. Creation date: (6/18/2001 5:53:02 PM) - * - * @author: Administrator - */ -public class ItemHolder extends ItemProvider { - protected WebApp webApp; - protected WebEditModel editModel; - - public ItemHolder() { - super(); - } - - /** - * Jarholder constructor comment. - */ - public ItemHolder(WebApp webApp) { - super(); - setWebApp(webApp); - } - - public ItemHolder(WebEditModel anEditModel) { - super(); - setEditModel(anEditModel); - } - - public Collection getChildren(Object element) { - WebApp testElement; - Vector v = new Vector(); - if (element instanceof ItemHolder) { - testElement = ((ItemHolder) element).getWebApp(); - v.add(testElement); - } - return v; - } - - /** - * Insert the method's description here. Creation date: (6/18/2001 6:00:43 PM) - * - * @return org.eclipse.jst.j2ee.internal.internal.ejb.EJBJar - */ - public WebApp getWebApp() { - return webApp; - } - - /** - * Insert the method's description here. Creation date: (6/18/2001 6:00:43 PM) - * - * @param newJar - * org.eclipse.jst.j2ee.internal.internal.ejb.EJBJar - */ - public void setWebApp(WebApp aWebApp) { - webApp = aWebApp; - } - - /** - * Gets the editModel. - * - * @return Returns a EJBEditModel - */ - public WebEditModel getEditModel() { - return editModel; - } - - /** - * Sets the editModel. - * - * @param editModel - * The editModel to set - */ - public void setEditModel(WebEditModel editModel) { - this.editModel = editModel; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPConfigItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPConfigItemProvider.java deleted file mode 100644 index 375c3d1e7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPConfigItemProvider.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.jsp.JspPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.jsp.JSPConfig; -import org.eclipse.jst.j2ee.jsp.JspFactory; - - -/** - * This is the item provider adpater for a {@link com.ibm.etools.jsp.JSPConfig}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class JSPConfigItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public JSPConfigItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(JspPackage.eINSTANCE.getJSPConfig_TagLibs()); - childrenReferences.add(JspPackage.eINSTANCE.getJSPConfig_PropertyGroups()); - } - return childrenReferences; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns JSPConfig.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("full/obj16/JSPConfig"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - return WebAppEditResourceHandler.getString("_UI_JSPConfig_type"); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(JSPConfig.class)) { - case JspPackage.JSP_CONFIG__TAG_LIBS : - case JspPackage.JSP_CONFIG__PROPERTY_GROUPS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(JspPackage.eINSTANCE.getJSPConfig_TagLibs(), JspFactory.eINSTANCE.createTagLibRefType())); - - newChildDescriptors.add(createChildParameter(JspPackage.eINSTANCE.getJSPConfig_PropertyGroups(), JspFactory.eINSTANCE.createJSPPropertyGroup())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPPropertyGroupItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPPropertyGroupItemProvider.java deleted file mode 100644 index b01219173..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPPropertyGroupItemProvider.java +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.jsp.JspPackage; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.jsp.JSPPropertyGroup; - -/** - * This is the item provider adpater for a {@link com.ibm.etools.jsp.JSPPropertyGroup}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class JSPPropertyGroupItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public JSPPropertyGroupItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addUrlPatternPropertyDescriptor(object); - addElIgnoredPropertyDescriptor(object); - addPageEncodingPropertyDescriptor(object); - addScriptingInvalidPropertyDescriptor(object); - addIsXMLPropertyDescriptor(object); - addIncludePreludesPropertyDescriptor(object); - addIncludeCodasPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Url Pattern feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUrlPatternPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_urlPattern_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_urlPattern_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_UrlPattern(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the El Ignored feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addElIgnoredPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_elIgnored_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_elIgnored_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_ElIgnored(), true, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Page Encoding feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addPageEncodingPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_pageEncoding_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_pageEncoding_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_PageEncoding(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Scripting Invalid feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addScriptingInvalidPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_scriptingInvalid_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_scriptingInvalid_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_ScriptingInvalid(), true, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Is XML feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addIsXMLPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_isXML_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_isXML_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_IsXML(), true, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Include Preludes feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addIncludePreludesPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_includePreludes_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_includePreludes_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_IncludePreludes(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Include Codas feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addIncludeCodasPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPPropertyGroup_includeCodas_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPPropertyGroup_includeCodas_feature", "_UI_JSPPropertyGroup_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - JspPackage.eINSTANCE.getJSPPropertyGroup_IncludeCodas(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns JSPPropertyGroup.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("full/obj16/JSPPropertyGroup"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((JSPPropertyGroup) object).getDisplayName(); - return label == null || label.length() == 0 ? getString("_UI_JSPPropertyGroup_type") : //$NON-NLS-1$ - getString("_UI_JSPPropertyGroup_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(JSPPropertyGroup.class)) { - case JspPackage.JSP_PROPERTY_GROUP__URL_PATTERN : - case JspPackage.JSP_PROPERTY_GROUP__EL_IGNORED : - case JspPackage.JSP_PROPERTY_GROUP__PAGE_ENCODING : - case JspPackage.JSP_PROPERTY_GROUP__SCRIPTING_INVALID : - case JspPackage.JSP_PROPERTY_GROUP__IS_XML : - case JspPackage.JSP_PROPERTY_GROUP__INCLUDE_PRELUDES : - case JspPackage.JSP_PROPERTY_GROUP__INCLUDE_CODAS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - // return J2EEPlugin.getDefault(); - return WebAppEditResourceHandler.RESOURCE_LOCATOR; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPTypeItemProvider.java deleted file mode 100644 index dece7866d..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JSPTypeItemProvider.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.JSPType; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.JSPType}object. - */ -public class JSPTypeItemProvider extends WebTypeItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public JSPTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns jsp_type.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("jsp_type");//$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the jspFile feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("JspFile_UI_"), //$NON-NLS-1$ = "JspFile" - WebAppEditResourceHandler.getString("The_jspFile_property_UI_"), //$NON-NLS-1$ = "The jspFile property" - pkg.getJSPType_JspFile())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Jsp File feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addJspFilePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_JSPType_jspFile_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_JSPType_jspFile_feature", "_UI_JSPType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getJSPType_JspFile(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("40concat_UI_", (new Object[]{((JSPType) object).getJspFile()})); //$NON-NLS-1$ = "JSPType {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(JSPType.class)) { - case WebapplicationPackage.JSP_TYPE__JSP_FILE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JspItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JspItemProviderAdapterFactory.java deleted file mode 100644 index a32048f30..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/JspItemProviderAdapterFactory.java +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.jsp.util.JspAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support Viewers. The - * adapters generated by this factory convert EMF adapter notifications into calls to - * {@link #fireNotifyChanged fireNotifyChanged}. The adapters also support Eclipse property sheets. - * Note that most of the adapters are shared among multiple instances. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ -public class JspItemProviderAdapterFactory extends JspAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public JspItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - } - - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.jsp.JSPConfig} - * instances. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected JSPConfigItemProvider jspConfigItemProvider; - - /** - * This creates an adapter for a {@link com.ibm.etools.jsp.JSPConfig}. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public Adapter createJSPConfigAdapter() { - if (jspConfigItemProvider == null) { - jspConfigItemProvider = new JSPConfigItemProvider(this); - } - - return jspConfigItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.jsp.JSPPropertyGroup} - * instances. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected JSPPropertyGroupItemProvider jspPropertyGroupItemProvider; - - /** - * This creates an adapter for a {@link com.ibm.etools.jsp.JSPPropertyGroup}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createJSPPropertyGroupAdapter() { - if (jspPropertyGroupItemProvider == null) { - jspPropertyGroupItemProvider = new JSPPropertyGroupItemProvider(this); - } - - return jspPropertyGroupItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link com.ibm.etools.jsp.TagLibRefType} - * instances. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected TagLibRefTypeItemProvider tagLibRefTypeItemProvider; - - /** - * This creates an adapter for a {@link com.ibm.etools.jsp.TagLibRefType}. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createTagLibRefTypeAdapter() { - if (tagLibRefTypeItemProvider == null) { - tagLibRefTypeItemProvider = new TagLibRefTypeItemProvider(this); - } - - return tagLibRefTypeItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LocalEncodingMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LocalEncodingMappingItemProvider.java deleted file mode 100644 index 6fb8f0d1b..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LocalEncodingMappingItemProvider.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.LocalEncodingMapping; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LocalEncodingMapping}object. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ -public class LocalEncodingMappingItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public LocalEncodingMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addLocalePropertyDescriptor(object); - addEncodingPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Locale feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLocalePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_LocalEncodingMapping_locale_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LocalEncodingMapping_locale_feature", "_UI_LocalEncodingMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getLocalEncodingMapping_Locale(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Encoding feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addEncodingPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_LocalEncodingMapping_encoding_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LocalEncodingMapping_encoding_feature", "_UI_LocalEncodingMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getLocalEncodingMapping_Encoding(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns LocalEncodingMapping.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - // return getResourceLocator().getImage("full/obj16/LocalEncodingMapping"); - return WebPlugin.getDefault().getImage("local_encoding_mapping");//$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - */ - public String getText(Object object) { - String lem = WebAppEditResourceHandler.getString("local_encoding_mapping_UI_"); //$NON-NLS-1$ - String label = ((LocalEncodingMapping) object).getLocale(); - return label == null || label.length() == 0 ? lem : lem + " " + label; //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(LocalEncodingMapping.class)) { - case WebapplicationPackage.LOCAL_ENCODING_MAPPING__LOCALE : - case WebapplicationPackage.LOCAL_ENCODING_MAPPING__ENCODING : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LocalEncodingMappingListItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LocalEncodingMappingListItemProvider.java deleted file mode 100644 index c49a2e601..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LocalEncodingMappingListItemProvider.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.LocalEncodingMappingList; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LocalEncodingMappingList}object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ -public class LocalEncodingMappingListItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public LocalEncodingMappingListItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getLocalEncodingMappingList_LocalEncodingMappings()); - } - return childrenReferences; - } - - - /** - * This returns LocalEncodingMappingList.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - */ - public Object getImage(Object object) { - // return getResourceLocator().getImage("full/obj16/LocalEncodingMappingList"); - return WebPlugin.getDefault().getImage("local_encoding_mapping_list");//$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - */ - public String getText(Object object) { - return WebAppEditResourceHandler.getString("Local_encoding_mapping_list_UI_"); //$NON-NLS-1$ = "Welcome File List" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(LocalEncodingMappingList.class)) { - case WebapplicationPackage.LOCAL_ENCODING_MAPPING_LIST__LOCAL_ENCODING_MAPPINGS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getLocalEncodingMappingList_LocalEncodingMappings(), WebapplicationFactory.eINSTANCE.createLocalEncodingMapping())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LoginConfigItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LoginConfigItemProvider.java deleted file mode 100644 index fdde13d18..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/LoginConfigItemProvider.java +++ /dev/null @@ -1,224 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.LoginConfig; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LoginConfig}object. - */ -public class LoginConfigItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public LoginConfigItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: create some child object. - return null; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getLoginConfig_FormLoginConfig()); - return result; - } - - //TODO Removing UI dependency by commenting out method - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - /* - * public ImageDescriptor getCreateChildImageDescriptor(Object object) { EObject refObject = - * (EObject)object; return - * WEBUIPlugin.getDefault().getImageDescriptor(refObject.eClass().getName() + - * "Create#CHILD_CLASS_NAME#");//$NON-NLS-1$ } - */ - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return WebAppEditResourceHandler.getString("Create_#CHILD_CLASS_NAME#_UI_"); //$NON-NLS-1$ = "Create #CHILD_CLASS_NAME#" - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("1concat", (new Object[]{refObject.eClass().getName()}));//$NON-NLS-1$ = "Create a child of type #CHILD_CLASS_NAME# for the selected {0}." - } - - /** - * This returns form_login_config.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("form_login_config");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the LoginConfig. - */ - public Object getParent(Object object) { - return ((LoginConfig) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the authMethod feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("AuthMethod_UI_"), //$NON-NLS-1$ = "AuthMethod" - WebAppEditResourceHandler.getString("The_authMethod_property_UI_"), //$NON-NLS-1$ = "The authMethod property" - pkg.getLoginConfig_AuthMethod())); - - // This is for the realmName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("RealmName_UI_"), //$NON-NLS-1$ = "RealmName" - WebAppEditResourceHandler.getString("The_realmName_property_UI_"), //$NON-NLS-1$ = "The realmName property" - pkg.getLoginConfig_RealmName())); - - // This is for the webApp feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ = "WebApp" - WebAppEditResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ = "The webApp property" - pkg.getLoginConfig_WebApp())); - - // This is for the formLoginConfig feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("FormLoginConfig_UI_"), //$NON-NLS-1$ = "FormLoginConfig" - WebAppEditResourceHandler.getString("The_formLoginConfig_proper_UI_"), //$NON-NLS-1$ = "The formLoginConfig property" - pkg.getLoginConfig_FormLoginConfig())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Auth Method feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addAuthMethodPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_LoginConfig_authMethod_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LoginConfig_authMethod_feature", "_UI_LoginConfig_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getLoginConfig_AuthMethod(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Realm Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addRealmNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_LoginConfig_realmName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LoginConfig_realmName_feature", "_UI_LoginConfig_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getLoginConfig_RealmName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Authorization Method feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addAuthorizationMethodPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_LoginConfig_authorizationMethod_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LoginConfig_authorizationMethod_feature", "_UI_LoginConfig_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getLoginConfig_AuthorizationMethod(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("21concat_UI_", (new Object[]{((LoginConfig) object).getRealmName()})); //$NON-NLS-1$ = "LoginConfig {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(LoginConfig.class)) { - case WebapplicationPackage.LOGIN_CONFIG__AUTH_METHOD : - case WebapplicationPackage.LOGIN_CONFIG__REALM_NAME : - case WebapplicationPackage.LOGIN_CONFIG__AUTHORIZATION_METHOD : - case WebapplicationPackage.LOGIN_CONFIG__FORM_LOGIN_CONFIG : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getLoginConfig_FormLoginConfig(), WebapplicationFactory.eINSTANCE.createFormLoginConfig())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/MimeMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/MimeMappingItemProvider.java deleted file mode 100644 index 6031d5402..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/MimeMappingItemProvider.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.MimeMapping; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.MimeMapping}object. - */ -public class MimeMappingItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public MimeMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns mime_mapping.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("mime_mapping");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the MimeMapping. - */ - public Object getParent(Object object) { - return ((MimeMapping) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the extension feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Extension_UI_"), //$NON-NLS-1$ = "Extension" - WebAppEditResourceHandler.getString("The_extension_property_UI_"), //$NON-NLS-1$ = "The extension property" - pkg.getMimeMapping_Extension())); - - // This is for the mimeType feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("MimeType_UI_"), //$NON-NLS-1$ = "MimeType" - WebAppEditResourceHandler.getString("The_mimeType_property_UI_"), //$NON-NLS-1$ = "The mimeType property" - pkg.getMimeMapping_MimeType())); - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * WebAppEditResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ = "WebApp" - * WebAppEditResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ = "The - * webApp property" pkg.getMimeMapping_WebApp())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Extension feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addExtensionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_MimeMapping_extension_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_MimeMapping_extension_feature", "_UI_MimeMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getMimeMapping_Extension(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Mime Type feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addMimeTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_MimeMapping_mimeType_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_MimeMapping_mimeType_feature", "_UI_MimeMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getMimeMapping_MimeType(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("22concat_UI_", (new Object[]{((MimeMapping) object).getExtension()})); //$NON-NLS-1$ = "MimeMapping {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(MimeMapping.class)) { - case WebapplicationPackage.MIME_MAPPING__EXTENSION : - case WebapplicationPackage.MIME_MAPPING__MIME_TYPE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/RoleNameTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/RoleNameTypeItemProvider.java deleted file mode 100644 index da7258a61..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/RoleNameTypeItemProvider.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.RoleNameType; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.RoleNameType} - * object. - */ -public class RoleNameTypeItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public RoleNameTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns security_role_nametype.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("security_role_nametype");//$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the roleName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("RoleName_UI_"), //$NON-NLS-1$ = "RoleName" - WebAppEditResourceHandler.getString("The_roleName_property_UI_"), //$NON-NLS-1$ = "The roleName property" - pkg.getRoleNameType_RoleName())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Role Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addRoleNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_RoleNameType_roleName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_RoleNameType_roleName_feature", "_UI_RoleNameType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getRoleNameType_RoleName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("23concat_UI_", (new Object[]{((RoleNameType) object).getRoleName()})); //$NON-NLS-1$ = "RoleNameType {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(RoleNameType.class)) { - case WebapplicationPackage.ROLE_NAME_TYPE__ROLE_NAME : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/SecurityConstraintItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/SecurityConstraintItemProvider.java deleted file mode 100644 index 5ebc2617e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/SecurityConstraintItemProvider.java +++ /dev/null @@ -1,242 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.DisplayName; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.SecurityConstraint; -import org.eclipse.jst.j2ee.webapplication.WebResourceCollection; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.SecurityConstraint} - * object. - */ -public class SecurityConstraintItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public SecurityConstraintItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - WebResourceCollection child = WebapplicationFactory.eINSTANCE.createWebResourceCollection(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getSecurityConstraint_WebResourceCollections()); - result.add(pkg.getSecurityConstraint_AuthConstraint()); - result.add(pkg.getSecurityConstraint_UserDataConstraint()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "CreateWebResourceCollection"); //$NON-NLS-1$ - } - - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return WebAppEditResourceHandler.getString("Create_WebResourceCollecti_UI_"); //$NON-NLS-1$ = "Create WebResourceCollection" - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("24concat", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type WebResourceCollection for the selected {0}." - } - - /** - * This returns security_constraint.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("security_constraint"); //$NON-NLS-1$ - } - - /** - * This returns the webApp of the SecurityConstraint. - */ - public Object getParent(Object object) { - return ((SecurityConstraint) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * WebAppEditResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ = "WebApp" - * WebAppEditResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ = "The - * webApp property" pkg.getSecurityConstraint_WebApp())); - */ - - // This is for the displayName feature. - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("DisplayName_UI_"), //$NON-NLS-1$ = "DisplayName" - WebAppEditResourceHandler.getString("The_displayName_property_UI_"), //$NON-NLS-1$ = "The displayName property" - pkg.getSecurityConstraint_DisplayName())); - - // This is for the authConstraint feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("AuthConstraint_UI_"), //$NON-NLS-1$ = "AuthConstraint" - WebAppEditResourceHandler.getString("The_authConstraint_propert_UI_"), //$NON-NLS-1$ = "The authConstraint property" - pkg.getSecurityConstraint_AuthConstraint())); - - // This is for the userDataConstraint feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("UserDataConstraint_UI_"), //$NON-NLS-1$ = "UserDataConstraint" - WebAppEditResourceHandler.getString("The_userDataConstraint_pro_UI_"), //$NON-NLS-1$ = "The userDataConstraint property" - pkg.getSecurityConstraint_UserDataConstraint())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Display Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDisplayNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SecurityConstraint_displayName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SecurityConstraint_displayName_feature", "_UI_SecurityConstraint_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getSecurityConstraint_DisplayName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - public String getText(Object object) { - String displayName = ((SecurityConstraint) object).getDisplayName(); - if (displayName == null) { - List displayNameList = ((SecurityConstraint) object).getDisplayNames(); - if (displayNameList != null && displayNameList.size() > 0) - displayName = ((DisplayName) displayNameList.get(0)).getValue(); - } - if (displayName == null) - displayName = ""; //$NON-NLS-1$ - return " " + displayName; //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(SecurityConstraint.class)) { - case WebapplicationPackage.SECURITY_CONSTRAINT__DISPLAY_NAME : - case WebapplicationPackage.SECURITY_CONSTRAINT__WEB_RESOURCE_COLLECTIONS : - case WebapplicationPackage.SECURITY_CONSTRAINT__AUTH_CONSTRAINT : - case WebapplicationPackage.SECURITY_CONSTRAINT__USER_DATA_CONSTRAINT : - case WebapplicationPackage.SECURITY_CONSTRAINT__DISPLAY_NAMES : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getSecurityConstraint_WebResourceCollections(), WebapplicationFactory.eINSTANCE.createWebResourceCollection())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getSecurityConstraint_AuthConstraint(), WebapplicationFactory.eINSTANCE.createAuthConstraint())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getSecurityConstraint_UserDataConstraint(), WebapplicationFactory.eINSTANCE.createUserDataConstraint())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getSecurityConstraint_DisplayNames(), CommonFactory.eINSTANCE.createDisplayName())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getSecurityConstraint_DisplayNames(), WscommonFactory.eINSTANCE.createDisplayNameType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletItemProvider.java deleted file mode 100644 index bae0326d7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletItemProvider.java +++ /dev/null @@ -1,295 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.InitParam; -import org.eclipse.jst.j2ee.webapplication.Servlet; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebType; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; - -public class ServletItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - - /** - * This constructs an instance from a factory and a notifier. - */ - public ServletItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - InitParam child = WebapplicationFactory.eINSTANCE.createInitParam(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - //result.add(pkg.getServlet_WebType()); - WebApp webApp = (WebApp) ((Servlet) object).eContainer(); - if (webApp == null) - return result; - if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) - result.add(pkg.getServlet_InitParams()); - else - result.add(pkg.getServlet_Params()); - result.add(pkg.getServlet_SecurityRoleRefs()); - result.add(pkg.getServlet_RunAs()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "CreateInitParam"); //$NON-NLS-1$ - } - - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return WebAppEditResourceHandler.getString("Create_InitParam_UI_"); //$NON-NLS-1$ = "Create InitParam" - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("26concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type InitParam for the selected {0}." - } - - /** - * This returns Servlet.gif. - */ - public Object getImage(Object object) { - WebType wt = ((Servlet) object).getWebType(); - if (wt != null && wt.isJspType()) - return WebPlugin.getDefault().getImage("jsp_type"); //$NON-NLS-1$ - - return WebPlugin.getDefault().getImage("servlet"); //$NON-NLS-1$ - } - - /** - * This returns the webApp of the Servlet. - */ - public Object getParent(Object object) { - return ((Servlet) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the servletName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ServletName_UI_"), //$NON-NLS-1$ - //$NON-NLS-1$ = "ServletName" - WebAppEditResourceHandler.getString("The_servletName_property_UI_"), //$NON-NLS-1$ = "The servletName property" - pkg.getServlet_ServletName())); - - - // This is for the loadOnStartup feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("LoadOnStartup_UI_"), //$NON-NLS-1$ - //$NON-NLS-1$ = "LoadOnStartup" - WebAppEditResourceHandler.getString("The_loadOnStartup_property_UI_"), //$NON-NLS-1$ = "The loadOnStartup property" - pkg.getServlet_LoadOnStartup(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Servlet Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addServletNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Servlet_servletName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Servlet_servletName_feature", "_UI_Servlet_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getServlet_ServletName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Load On Startup feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addLoadOnStartupPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Servlet_loadOnStartup_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Servlet_loadOnStartup_feature", "_UI_Servlet_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getServlet_LoadOnStartup(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This implements - * {@link IItemPropertySource#getPropertyValue IItemPropertySource.getPropertyValue}by - * delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public Object getPropertyValue(Object object, String property) { - Object ret = null; - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ret = ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).getPropertyValue(object); - } else - ret = super.getPropertyValue(object, property); - return ret; - } - - public String getText(Object object) { - Servlet servlet = (Servlet) object; - String name = servlet.getServletName(); - if (name == null) - name = WebAppEditResourceHandler.getString("<servlet>_UI_"); //$NON-NLS-1$ = "<servlet>" - return name; - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Servlet.class)) { - case WebapplicationPackage.SERVLET__SERVLET_NAME : - case WebapplicationPackage.SERVLET__LOAD_ON_STARTUP : - case WebapplicationPackage.SERVLET__WEB_TYPE : - case WebapplicationPackage.SERVLET__PARAMS : - case WebapplicationPackage.SERVLET__SECURITY_ROLE_REFS : - case WebapplicationPackage.SERVLET__RUN_AS : - case WebapplicationPackage.SERVLET__INIT_PARAMS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getServlet_WebType(), WebapplicationFactory.eINSTANCE.createServletType())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getServlet_WebType(), WebapplicationFactory.eINSTANCE.createJSPType())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getServlet_Params(), WebapplicationFactory.eINSTANCE.createInitParam())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getServlet_SecurityRoleRefs(), CommonFactory.eINSTANCE.createSecurityRoleRef())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getServlet_RunAs(), CommonFactory.eINSTANCE.createRunAsSpecifiedIdentity())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getServlet_InitParams(), CommonFactory.eINSTANCE.createParamValue())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This implements {@link IItemPropertySource#isPropertySet IItemPropertySource.isPropertySet} - * by delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public boolean isPropertySet(Object object, String property) { - boolean ret = false; - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ret = ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).isPropertySet(object); - } else - ret = super.isPropertySet(object, property); - return ret; - } - - - /** - * This implements - * {@link IItemPropertySource#setPropertyValue IItemPropertySource.setPropertyValue}by - * delegating to the descriptor, which is assumed to support the IItemPropertyDescriptor - * interface - */ - public void setPropertyValue(Object object, String property, Object value) { - - if (getPropertyDescriptor(object, property) instanceof WebToolingItemPropertyDescriptor) { - ((WebToolingItemPropertyDescriptor) getPropertyDescriptor(object, property)).setPropertyValue(object, value); - } else - super.setPropertyValue(object, property, value); - - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletMappingItemProvider.java deleted file mode 100644 index c764d05d3..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletMappingItemProvider.java +++ /dev/null @@ -1,177 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.Servlet; -import org.eclipse.jst.j2ee.webapplication.ServletMapping; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ServletMapping} - * object. - */ -public class ServletMappingItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ServletMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns servlet_mapping.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("servlet_mapping");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the ServletMapping. - */ - public Object getParent(Object object) { - return ((ServletMapping) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the urlPattern feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("UrlPattern_UI_"), //$NON-NLS-1$ = "UrlPattern" - WebAppEditResourceHandler.getString("The_urlPattern_property_UI_"), //$NON-NLS-1$ = "The urlPattern property" - pkg.getServletMapping_UrlPattern())); - - - // This is for the servlet feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Servlet_UI_"), //$NON-NLS-1$ = "Servlet" - WebAppEditResourceHandler.getString("The_servlet_property_UI_"), //$NON-NLS-1$ = "The servlet property" - pkg.getServletMapping_Servlet(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Url Pattern feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUrlPatternPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ServletMapping_urlPattern_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ServletMapping_urlPattern_feature", "_UI_ServletMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getServletMapping_UrlPattern(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ServletMapping_name_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ServletMapping_name_feature", "_UI_ServletMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getServletMapping_Name(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Servlet feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addServletPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ServletMapping_servlet_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ServletMapping_servlet_feature", "_UI_ServletMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getServletMapping_Servlet(), false)); - } - - - public String getText(Object object) { - String urlStr = ((ServletMapping) object).getUrlPattern(); - Servlet servlet = ((ServletMapping) object).getServlet(); - String servletStr = (servlet == null) ? WebAppEditResourceHandler.getString("?_UI_") : servlet.getServletName(); //$NON-NLS-1$ = "?" - return WebAppEditResourceHandler.getString("28concat_UI_", (new Object[]{urlStr, servletStr})); //$NON-NLS-1$ = "Servlet mapping ({0} -> {1})" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ServletMapping.class)) { - case WebapplicationPackage.SERVLET_MAPPING__URL_PATTERN : - case WebapplicationPackage.SERVLET_MAPPING__NAME : - case WebapplicationPackage.SERVLET_MAPPING__SERVLET : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletTypeItemProvider.java deleted file mode 100644 index f07e9bfff..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/ServletTypeItemProvider.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.ServletType; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ServletType}object. - */ -public class ServletTypeItemProvider extends WebTypeItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public ServletTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns servlet_type.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("servlet_type"); //$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the className feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ClassName_UI_"), //$NON-NLS-1$ = "ClassName" - WebAppEditResourceHandler.getString("The_className_property_UI_"), //$NON-NLS-1$ = "The className property" - pkg.getServletType_ClassName())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Class Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addClassNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ServletType_className_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ServletType_className_feature", "_UI_ServletType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getServletType_ClassName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("41concat_UI_", (new Object[]{((ServletType) object).getClassName()})); //$NON-NLS-1$ = "ServletType {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ServletType.class)) { - case WebapplicationPackage.SERVLET_TYPE__CLASS_NAME : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/SessionConfigItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/SessionConfigItemProvider.java deleted file mode 100644 index 1033903a9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/SessionConfigItemProvider.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.SessionConfig; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.SessionConfig} - * object. - */ -public class SessionConfigItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public SessionConfigItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns session_config.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("session_config");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the SessionConfig. - */ - public Object getParent(Object object) { - return ((SessionConfig) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the sessionTimeout feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("SessionTimeout_UI_"), //$NON-NLS-1$ = "SessionTimeout" - WebAppEditResourceHandler.getString("The_sessionTimeout_propert_UI_"), //$NON-NLS-1$ = "The sessionTimeout property" - pkg.getSessionConfig_SessionTimeout())); - - // This is for the webApp feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ = "WebApp" - WebAppEditResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ = "The webApp property" - pkg.getSessionConfig_WebApp())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Session Timeout feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addSessionTimeoutPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_SessionConfig_sessionTimeout_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_SessionConfig_sessionTimeout_feature", "_UI_SessionConfig_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getSessionConfig_SessionTimeout(), true, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("31concat_UI_", (new Object[]{new Integer(((SessionConfig) object).getSessionTimeout())})); //$NON-NLS-1$ = "SessionConfig {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(SessionConfig.class)) { - case WebapplicationPackage.SESSION_CONFIG__SESSION_TIMEOUT : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/TagLibRefItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/TagLibRefItemProvider.java deleted file mode 100644 index ea8bb8ca6..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/TagLibRefItemProvider.java +++ /dev/null @@ -1,170 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.TagLibRef; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.TagLibRef}object. - */ -public class TagLibRefItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public TagLibRefItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns jsp_library_reference.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("jsp_library_reference");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the TagLibRef. - */ - public Object getParent(Object object) { - return ((TagLibRef) object).getWebApp(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the taglibURI feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("URI_UI_"), //$NON-NLS-1$ = "TaglibURI" - WebAppEditResourceHandler.getString("The_taglibURI_property_UI_"), //$NON-NLS-1$ = "The taglibURI property" - pkg.getTagLibRef_TaglibURI())); - - // This is for the taglibLocation feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Location_UI_"), //$NON-NLS-1$ = "TaglibLocation" - WebAppEditResourceHandler.getString("The_taglibLocation_propert_UI_"), //$NON-NLS-1$ = "The taglibLocation property" - pkg.getTagLibRef_TaglibLocation())); - - // This is for the webApp feature. - // - /* - * itemPropertyDescriptors.add (new ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * WebAppEditResourceHandler.getString("WebApp_UI_"), //$NON-NLS-1$ = "WebApp" - * WebAppEditResourceHandler.getString("The_webApp_property_UI_"), //$NON-NLS-1$ = "The - * webApp property" pkg.getTagLibRef_WebApp())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Taglib URI feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTaglibURIPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_TagLibRef_taglibURI_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_TagLibRef_taglibURI_feature", "_UI_TagLibRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getTagLibRef_TaglibURI(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Taglib Location feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTaglibLocationPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_TagLibRef_taglibLocation_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_TagLibRef_taglibLocation_feature", "_UI_TagLibRef_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getTagLibRef_TaglibLocation(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("32concat_UI_", (new Object[]{((TagLibRef) object).getTaglibURI()})); //$NON-NLS-1$ = "TagLibRef {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(TagLibRef.class)) { - case WebapplicationPackage.TAG_LIB_REF__TAGLIB_URI : - case WebapplicationPackage.TAG_LIB_REF__TAGLIB_LOCATION : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/TagLibRefTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/TagLibRefTypeItemProvider.java deleted file mode 100644 index 019abf85f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/TagLibRefTypeItemProvider.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.jsp.JspPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.jsp.TagLibRefType; - -/** - * This is the item provider adpater for a {@link com.ibm.etools.jsp.TagLibRefType}object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class TagLibRefTypeItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public TagLibRefTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addTaglibURIPropertyDescriptor(object); - addTaglibLocationPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Taglib URI feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTaglibURIPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("URI_UI_"), //$NON-NLS-1$ - WebAppEditResourceHandler.getString("URI_UI_"), //$NON-NLS-1$ - JspPackage.eINSTANCE.getTagLibRefType_TaglibURI(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Taglib Location feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addTaglibLocationPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Location_UI_"), //$NON-NLS-1$ - WebAppEditResourceHandler.getString("Location_UI_"), //$NON-NLS-1$ - JspPackage.eINSTANCE.getTagLibRefType_TaglibLocation(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns TagLibRefType.gif. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("full/obj16/TagLibRefType"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((TagLibRefType) object).getTaglibURI(); - String tlrt = WebAppEditResourceHandler.getString("_UI_TagLibRefType_type"); //$NON-NLS-1$ - return label == null || label.length() == 0 ? tlrt : tlrt + " " + label; //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(TagLibRefType.class)) { - case JspPackage.TAG_LIB_REF_TYPE__TAGLIB_URI : - case JspPackage.TAG_LIB_REF_TYPE__TAGLIB_LOCATION : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/URLPatternTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/URLPatternTypeItemProvider.java deleted file mode 100644 index a39f82593..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/URLPatternTypeItemProvider.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.URLPatternType; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.URLPatternType} - * object. - */ -public class URLPatternTypeItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public URLPatternTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns url_type.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("url_type");//$NON-NLS-1$ - } - - /** - * This returns the resCollection of the URLPatternType. - */ - public Object getParent(Object object) { - return ((URLPatternType) object).getResCollection(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the urlPattern feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("UrlPattern_UI_"), //$NON-NLS-1$ = "UrlPattern" - WebAppEditResourceHandler.getString("The_urlPattern_property_UI_"), //$NON-NLS-1$ = "The urlPattern property" - pkg.getURLPatternType_UrlPattern())); - - // This is for the resCollection feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("ResCollection_UI_"), //$NON-NLS-1$ = "ResCollection" - WebAppEditResourceHandler.getString("The_resCollection_property_UI_"), //$NON-NLS-1$ = "The resCollection property" - pkg.getURLPatternType_ResCollection())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Url Pattern feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUrlPatternPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_URLPatternType_urlPattern_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_URLPatternType_urlPattern_feature", "_UI_URLPatternType_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getURLPatternType_UrlPattern(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("33concat_UI_", (new Object[]{((URLPatternType) object).getUrlPattern()})); //$NON-NLS-1$ = "URLPatternType {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(URLPatternType.class)) { - case WebapplicationPackage.URL_PATTERN_TYPE__URL_PATTERN : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/UserDataConstraintItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/UserDataConstraintItemProvider.java deleted file mode 100644 index 93325d66c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/UserDataConstraintItemProvider.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.UserDataConstraint; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.UserDataConstraint} - * object. - */ -public class UserDataConstraintItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public UserDataConstraintItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns user_data_constraint.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("user_data_constraint"); //$NON-NLS-1$ - } - - /** - * This returns the secConstraint of the UserDataConstraint. - */ - public Object getParent(Object object) { - return ((UserDataConstraint) object).getSecConstraint(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Description_UI__UI_"), //$NON-NLS-1$ = "Description" - WebAppEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ = "The description property" - pkg.getUserDataConstraint_Description())); - - // This is for the transportGuarantee feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("TransportGuarantee_UI_"), //$NON-NLS-1$ = "TransportGuarantee" - WebAppEditResourceHandler.getString("The_transportGuarantee_pro_UI_"), //$NON-NLS-1$ = "The transportGuarantee property" - pkg.getUserDataConstraint_TransportGuarantee())); - - // This is for the secConstraint feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("SecConstraint_UI_"), //$NON-NLS-1$ = "SecConstraint" - WebAppEditResourceHandler.getString("The_secConstraint_property_UI_"), //$NON-NLS-1$ = "The secConstraint property" - pkg.getUserDataConstraint_SecConstraint())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_UserDataConstraint_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_UserDataConstraint_description_feature", "_UI_UserDataConstraint_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getUserDataConstraint_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Transport Guarantee feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addTransportGuaranteePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_UserDataConstraint_transportGuarantee_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_UserDataConstraint_transportGuarantee_feature", "_UI_UserDataConstraint_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getUserDataConstraint_TransportGuarantee(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This specifies how to implement {@link #getChildren}and - * {@link org.eclipse.emf.edit.command.AddCommand}and - * {@link org.eclipse.emf.edit.command.RemoveCommand}support in {@link #createCommand}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getUserDataConstraint_Descriptions()); - } - return childrenReferences; - } - - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("34concat_UI_", (new Object[]{((UserDataConstraint) object).getTransportGuarantee().getName()})); //$NON-NLS-1$ = "UserDataConstraint {0}" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(UserDataConstraint.class)) { - case WebapplicationPackage.USER_DATA_CONSTRAINT__DESCRIPTION : - case WebapplicationPackage.USER_DATA_CONSTRAINT__TRANSPORT_GUARANTEE : - case WebapplicationPackage.USER_DATA_CONSTRAINT__DESCRIPTIONS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getUserDataConstraint_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getUserDataConstraint_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebAppEditResourceHandler.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebAppEditResourceHandler.java deleted file mode 100644 index 372def481..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebAppEditResourceHandler.java +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.net.URL; -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; - - -public class WebAppEditResourceHandler { - - private static ResourceBundle fgResourceBundle; - - public static ResourceLocator RESOURCE_LOCATOR = new ResourceLocator() { - public URL getBaseURL() { - return null; - } - - public Object getImage(String arg0) { - return WebPlugin.getDefault().getImage(arg0); - } - - public String getString(String arg0) { - return WebAppEditResourceHandler.getString(arg0); - } - - public String getString(String arg0, Object[] arg1) { - return WebAppEditResourceHandler.getString(arg0, arg1); - } - }; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("webedit");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } - - public static String getString(String key, Object[] args, int x) { - - return getString(key); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebAppItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebAppItemProvider.java deleted file mode 100644 index c04ddbcbc..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebAppItemProvider.java +++ /dev/null @@ -1,344 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.JNDIEnvRefsGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.CommonPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.internal.webservices.WebServicesManager; -import org.eclipse.jst.j2ee.jsp.JspFactory; -import org.eclipse.jst.j2ee.webapplication.ContextParam; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebApp}object. - */ -public class WebAppItemProvider extends JNDIEnvRefsGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public WebAppItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - ContextParam child = WebapplicationFactory.eINSTANCE.createContextParam(); - - // TODO: initialize child here... - - return child; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) - */ - public Collection getChildren(Object object) { - WebApp webApp = (WebApp) object; - Collection myChildren = super.getChildren(object); - if (webApp.getVersionID() <= J2EEVersionConstants.WEB_2_3_ID) - myChildren.addAll(WebServicesManager.getInstance().get13ServiceRefs(webApp)); - return myChildren; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - - - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_Contexts()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_ErrorPages()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_FileList()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_TagLibs()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_Constraints()); - //childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_LoginConfig()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_MimeMappings()); - //childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_SessionConfig()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_ServletMappings()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_Servlets()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_SecurityRoles()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_Filters()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_FilterMappings()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_Listeners()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_ContextParams()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_JspConfig()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_MessageDestinations()); - childrenReferences.add(WebapplicationPackage.eINSTANCE.getWebApp_LocalEncodingMappingList()); - } - return childrenReferences; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "CreateContextParam"); //$NON-NLS-1$ - } - - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return WebAppEditResourceHandler.getString("Create_ContextParam_UI_"); //$NON-NLS-1$ = "Create ContextParam" - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("35concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type ContextParam for the selected {0}." - } - - public Object getImage(Object object) { - String key = null; - switch (((WebApp) object).getVersionID()) { - case J2EEVersionConstants.WEB_2_2_ID : - key = "webapp_22"; //$NON-NLS-1$ - break; - - case J2EEVersionConstants.WEB_2_3_ID : - key = "webapp_23"; //$NON-NLS-1$ - break; - - case J2EEVersionConstants.WEB_2_4_ID : - default : - key = "webapp_24"; //$NON-NLS-1$ - break; - } - return WebPlugin.getDefault().getImage(key); //$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the distributable feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Distributable_UI_"), //$NON-NLS-1$ - //$NON-NLS-1$ = "Distributable" - WebAppEditResourceHandler.getString("The_distributable_property_UI_"), //$NON-NLS-1$ = "The distributable property" - pkg.getWebApp_Distributable())); - - - // This is for the fileList feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("FileList_UI_"), //$NON-NLS-1$ = "FileList" - WebAppEditResourceHandler.getString("The_fileList_property_UI_"), //$NON-NLS-1$ = "The fileList property" - pkg.getWebApp_FileList())); - - /* - * // ccc - for usability reasons, these descriptors are removed from the property - * sheet. // This is for the loginConfig feature. // itemPropertyDescriptors.add (new - * ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), "LoginConfig", - * "The loginConfig property", pkg.getWebApp_LoginConfig())); - * // This is for the sessionConfig feature. // itemPropertyDescriptors.add (new - * ItemPropertyDescriptor - * (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - * "SessionConfig", "The sessionConfig property", pkg.getWebApp_SessionConfig())); - */ - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Distributable feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDistributablePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebApp_distributable_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebApp_distributable_feature", "_UI_WebApp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWebApp_Distributable(), true, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Version feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebApp_version_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebApp_version_feature", "_UI_WebApp_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWebApp_Version(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - public String getText(Object object) { - WebApp webApp = (WebApp) object; - String name = webApp.getDisplayName(); - if (name == null) - name = WebAppEditResourceHandler.getString("<web_app>_UI_"); //$NON-NLS-1$ = "<web app>" - return name; - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(WebApp.class)) { - case WebapplicationPackage.WEB_APP__DISTRIBUTABLE : - case WebapplicationPackage.WEB_APP__VERSION : - case WebapplicationPackage.WEB_APP__CONTEXTS : - case WebapplicationPackage.WEB_APP__ERROR_PAGES : - case WebapplicationPackage.WEB_APP__FILE_LIST : - case WebapplicationPackage.WEB_APP__TAG_LIBS : - case WebapplicationPackage.WEB_APP__CONSTRAINTS : - case WebapplicationPackage.WEB_APP__LOGIN_CONFIG : - case WebapplicationPackage.WEB_APP__MIME_MAPPINGS : - case WebapplicationPackage.WEB_APP__SESSION_CONFIG : - case WebapplicationPackage.WEB_APP__SERVLET_MAPPINGS : - case WebapplicationPackage.WEB_APP__SERVLETS : - case WebapplicationPackage.WEB_APP__SECURITY_ROLES : - case WebapplicationPackage.WEB_APP__FILTERS : - case WebapplicationPackage.WEB_APP__FILTER_MAPPINGS : - case WebapplicationPackage.WEB_APP__LISTENERS : - case WebapplicationPackage.WEB_APP__CONTEXT_PARAMS : - case WebapplicationPackage.WEB_APP__JSP_CONFIG : - case WebapplicationPackage.WEB_APP__MESSAGE_DESTINATIONS : - case WebapplicationPackage.WEB_APP__LOCAL_ENCODING_MAPPING_LIST : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_Contexts(), WebapplicationFactory.eINSTANCE.createContextParam())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_ErrorPages(), WebapplicationFactory.eINSTANCE.createErrorPage())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_ErrorPages(), WebapplicationFactory.eINSTANCE.createExceptionTypeErrorPage())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_ErrorPages(), WebapplicationFactory.eINSTANCE.createErrorCodeErrorPage())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_FileList(), WebapplicationFactory.eINSTANCE.createWelcomeFileList())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_TagLibs(), WebapplicationFactory.eINSTANCE.createTagLibRef())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_Constraints(), WebapplicationFactory.eINSTANCE.createSecurityConstraint())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_LoginConfig(), WebapplicationFactory.eINSTANCE.createLoginConfig())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_MimeMappings(), WebapplicationFactory.eINSTANCE.createMimeMapping())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_SessionConfig(), WebapplicationFactory.eINSTANCE.createSessionConfig())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_ServletMappings(), WebapplicationFactory.eINSTANCE.createServletMapping())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_Servlets(), WebapplicationFactory.eINSTANCE.createServlet())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_SecurityRoles(), CommonFactory.eINSTANCE.createSecurityRole())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_Filters(), WebapplicationFactory.eINSTANCE.createFilter())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_FilterMappings(), WebapplicationFactory.eINSTANCE.createFilterMapping())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_Listeners(), CommonFactory.eINSTANCE.createListener())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_ContextParams(), CommonFactory.eINSTANCE.createParamValue())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_JspConfig(), JspFactory.eINSTANCE.createJSPConfig())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_MessageDestinations(), CommonFactory.eINSTANCE.createMessageDestination())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebApp_LocalEncodingMappingList(), WebapplicationFactory.eINSTANCE.createLocalEncodingMappingList())); - } - - /** - * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { - boolean qualify = feature == CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbRefs() || feature == CommonPackage.eINSTANCE.getJNDIEnvRefsGroup_EjbLocalRefs(); - return getString(qualify ? "_UI_CreateChild_text2" : "_UI_CreateChild_text", //$NON-NLS-1$ //$NON-NLS-2$ - new Object[]{getTypeText(child), getFeatureText(feature), getTypeText(owner)}); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebResourceCollectionItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebResourceCollectionItemProvider.java deleted file mode 100644 index 8962d1dc8..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebResourceCollectionItemProvider.java +++ /dev/null @@ -1,294 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.URLPatternType; -import org.eclipse.jst.j2ee.webapplication.WebResourceCollection; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webservice.wscommon.WscommonFactory; - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebResourceCollection}object. - */ -public class WebResourceCollectionItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public WebResourceCollectionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - URLPatternType child = WebapplicationFactory.eINSTANCE.createURLPatternType(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getWebResourceCollection_UrlPattern()); - result.add(pkg.getWebResourceCollection_HttpMethod()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "CreateURLPatternType");//$NON-NLS-1$ - } - - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return WebAppEditResourceHandler.getString("Create_URLPatternType_UI_"); //$NON-NLS-1$ = "Create URLPatternType" - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("37concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type URLPatternType for the selected {0}." - } - - /** - * This returns web_resource_collection.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("web_resource_collection");//$NON-NLS-1$ - } - - /** - * This returns the secConstraint of the WebResourceCollection. - */ - public Object getParent(Object object) { - return ((WebResourceCollection) object).getSecConstraint(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the webResourceName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("WebResourceName_UI_"), //$NON-NLS-1$ = "WebResourceName" - WebAppEditResourceHandler.getString("The_webResourceName_proper_UI_"), //$NON-NLS-1$ = "The webResourceName property" - pkg.getWebResourceCollection_WebResourceName())); - - // This is for the description feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("Description_UI__UI_"), //$NON-NLS-1$ = "Description" - WebAppEditResourceHandler.getString("The_description_property_UI_"), //$NON-NLS-1$ = "The description property" - pkg.getWebResourceCollection_Description())); - - // This is for the secConstraint feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("SecConstraint_UI_"), //$NON-NLS-1$ = "SecConstraint" - WebAppEditResourceHandler.getString("The_secConstraint_property_UI_"), //$NON-NLS-1$ = "The secConstraint property" - pkg.getWebResourceCollection_SecConstraint())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Web Resource Name feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addWebResourceNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebResourceCollection_webResourceName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebResourceCollection_webResourceName_feature", "_UI_WebResourceCollection_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWebResourceCollection_WebResourceName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Description feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addDescriptionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebResourceCollection_description_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebResourceCollection_description_feature", "_UI_WebResourceCollection_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWebResourceCollection_Description(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Url Pattern feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUrlPatternPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebResourceCollection_urlPattern_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebResourceCollection_urlPattern_feature", "_UI_WebResourceCollection_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWebResourceCollection_UrlPattern(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Http Method feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addHttpMethodPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebResourceCollection_httpMethod_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebResourceCollection_httpMethod_feature", "_UI_WebResourceCollection_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWebResourceCollection_HttpMethod(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - public String getText(Object object) { - // return WebAppEditResourceHandler.getString("38concat_UI_", (new Object[] { - // ((WebResourceCollection)object).getWebResourceName() })); //$NON-NLS-1$ = - // "WebResourceCollection {0}" - return ((WebResourceCollection) object).getWebResourceName(); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(WebResourceCollection.class)) { - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__WEB_RESOURCE_NAME : - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__DESCRIPTION : - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__URL_PATTERN : - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__HTTP_METHOD : - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__UR_LS : - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__DESCRIPTIONS : - case WebapplicationPackage.WEB_RESOURCE_COLLECTION__HTT_PS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(((WebResourceCollection) WebapplicationPackage.eINSTANCE.getWebResourceCollection()).getURLs(), WebapplicationFactory.eINSTANCE.createURLPatternType())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebResourceCollection_Descriptions(), CommonFactory.eINSTANCE.createDescription())); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWebResourceCollection_Descriptions(), WscommonFactory.eINSTANCE.createDescriptionType())); - - newChildDescriptors.add(createChildParameter(((WebResourceCollection) WebapplicationPackage.eINSTANCE.getWebResourceCollection()).getHttpMethod(), WebapplicationFactory.eINSTANCE.createHTTPMethodType())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.edit.provider.IEditingDomainItemProvider#createCommand(java.lang.Object, - * org.eclipse.emf.edit.domain.EditingDomain, java.lang.Class, - * org.eclipse.emf.edit.command.CommandParameter) - */ - public Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter) { - EStructuralFeature sf = commandParameter.getEReference(); - if (sf == null) { - sf = commandParameter.getEAttribute(); - if (sf != null && !sf.isMany()) - sf = null; - } - if (sf != null) { - EObject owner = commandParameter.getEOwner(); - Collection collection = commandParameter.getCollection(); - if (commandClass == AddCommand.class) { - return createAddCommand(editingDomain, owner, sf, collection, commandParameter.getIndex()); - } else if (commandClass == RemoveCommand.class) { - return createRemoveCommand(editingDomain, owner, sf, collection); - } - } - return super.createCommand(object, editingDomain, commandClass, commandParameter); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebToolingItemPropertyDescriptor.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebToolingItemPropertyDescriptor.java deleted file mode 100644 index 11a3640ba..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebToolingItemPropertyDescriptor.java +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CompoundCommand; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; - -/** - * Insert the type's description here. Creation date: (12/11/2000 5:54:28 PM) - * - * @author: Administrator - */ -public class WebToolingItemPropertyDescriptor extends ItemPropertyDescriptor { - - protected int cellEditorType = -1; - public final static int SMALL_ICON_EDITOR = 1; - public final static int LARGE_ICON_EDITOR = 2; - public final static int MULTILINE_TEXT_EDITOR = 3; - public final static int AUTH_CONSTRAINT_ROLES_EDITOR = 4; - - /** - * This creates an instance where the category and filter flags are empty and the cell editor is - * determined for the references. - */ - public WebToolingItemPropertyDescriptor(AdapterFactory adapterFactory, String displayName, String description, EReference[] parentReferences) { - super(adapterFactory, displayName, description, parentReferences); - } - - /** - * This creates an instance where the category is filter flags are empty and the cell editor is - * determined from the type of the structural feature> - */ - public WebToolingItemPropertyDescriptor(AdapterFactory adapterFactory, String displayName, String description, EStructuralFeature feature) { - super(adapterFactory, displayName, description, feature); - } - - /** - * This creates an instance where the category is filter flags are empty and the cell editor is - * determined from the type of the structural feature> - */ - public WebToolingItemPropertyDescriptor(AdapterFactory adapterFactory, String displayName, String description, EStructuralFeature feature, int newCellEditorType) { - super(adapterFactory, displayName, description, feature); - cellEditorType = newCellEditorType; - } - - protected void executeCommand(EditingDomain editingDomain, Command command) { - //TODO We need to use the CommandStack from the WebEditModel. - // if (editingDomain instanceof StructuredTextEditingDomain) - // ((StructuredTextEditingDomain) editingDomain).execute(command); - // else - // editingDomain.getCommandStack().execute(command); - - } - - /** - * Returns the editor type. - */ - public int getCellEditorType() { - return cellEditorType; - } - - /** - * This does the delegated job of setting the property to the given value. It is implemented in - * a generic way using the structural feature. - */ - public void setPropertyValue(Object object, Object value) { - EObject refObject = (EObject) object; - EditingDomain editingDomain = getEditingDomain(object); - - if (parentReferences != null) { - EObject refValue = (EObject) value; - Command removeCommand = null; - for (int i = 0; i < parentReferences.length; ++i) { - Object oldValue = refObject.eGet(parentReferences[i]); - if (oldValue != null) { - final EReference parentReference = parentReferences[i]; - if (oldValue == value) { - return; - } - // else if (refValue.refIsInstanceOf(parentReference.getEType(), true)) - else if (refValue.eClass() == parentReference.getEType() || refValue.eClass().getEAllSuperTypes().contains(parentReference.getEType())) { - if (editingDomain == null) { - refObject.eSet(parentReference, value); - } else { - Command setCommand = SetCommand.create(editingDomain, refObject, parentReference, value); - executeCommand(editingDomain, setCommand); - } - return; - } else { - if (editingDomain == null) { - refObject.eSet(parentReference, null); - } else { - removeCommand = SetCommand.create(editingDomain, refObject, parentReference, null); - } - break; - } - } - } - - for (int i = 0; i < parentReferences.length; ++i) { - final EReference parentReference = parentReferences[i]; - //if (refValue.refIsInstanceOf(parentReference.getEType(), true)) - if (refValue.eClass() == parentReference.getEType() || refValue.eClass().getEAllSuperTypes().contains(parentReference.getEType())) { - if (editingDomain == null) { - refObject.eSet(parentReferences[i], value); - } else { - if (removeCommand != null) { - final CompoundCommand compoundCommand = new CompoundCommand(CompoundCommand.LAST_COMMAND_ALL); - compoundCommand.append(removeCommand); - compoundCommand.append(SetCommand.create(editingDomain, refObject, parentReference, value)); - executeCommand(editingDomain, compoundCommand); - } else { - executeCommand(editingDomain, SetCommand.create(editingDomain, refObject, parentReference, value)); - } - } - break; - } - } - } else { - if (editingDomain == null) { - refObject.eSet(feature, value); - } else { - executeCommand(editingDomain, SetCommand.create(editingDomain, refObject, feature, value)); - } - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebTypeItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebTypeItemProvider.java deleted file mode 100644 index f9c7cd2ff..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebTypeItemProvider.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebType}object. - */ -public class WebTypeItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public WebTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns web_type.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("web_type");//$NON-NLS-1$ - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - //WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE;; - - } - return itemPropertyDescriptors; - } - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("WebType_UI_"); //$NON-NLS-1$ = "WebType" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebapplicationItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebapplicationItemProviderAdapter.java deleted file mode 100644 index fa80205bd..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebapplicationItemProviderAdapter.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.Collections; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; - - -/** - * This extended item provider supports two addition features, (@link CreateChildCommand} and - * {@link CreateChildrenCommand}. These two actions are implemented uniformly on all our item - * adapters using this common base class. - */ -public class WebapplicationItemProviderAdapter extends org.eclipse.emf.edit.provider.ItemProviderAdapter { - - /** - * This creates and instance from an adapter factory and a domain notifier. - */ - protected WebapplicationItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This implements the default behavior for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - return null; - } - - /** - * This creates the default new children for {@link CreateChildrenCommand}. - */ - public Collection createChildren(Object object) { - return Collections.EMPTY_LIST; - } - - /** - * This returns the default create child image. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - Collection achildrenReferences = getChildrenReferences(object); - if (achildrenReferences.size() != 1) { - return WebPlugin.getDefault().getImage("create_child"); //$NON-NLS-1$ - } - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "Create" + //$NON-NLS-1$ - ((EReference) achildrenReferences.iterator().next()).getEType().getName()); - - } - - /** - * This returns the default create children label. - */ - public String getCreateChildrenText(Object object) { - //EObject refObject = (EObject) object; - Collection achildrenReferences = getChildrenReferences(object); - if (achildrenReferences.size() != 1) { - return WebAppEditResourceHandler.getString("Create_Two_Children_UI_"); //$NON-NLS-1$ = "Create Two Children" - } - return WebAppEditResourceHandler.getString("9concat_UI_", (new Object[]{((EReference) achildrenReferences.iterator().next()).getEType().getName()})); //$NON-NLS-1$ = "Create Two {0}s" - - } - - /** - * This returns the default create children help text. - */ - public String getCreateChildrenToolTipText(Object object) { - EObject refObject = (EObject) object; - Collection achildrenReferences = getChildrenReferences(object); - if (achildrenReferences.size() != 1) { - return WebAppEditResourceHandler.getString("7concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create two new children for the selected {0}." - } - return WebAppEditResourceHandler.getString("8concat_UI_", (new Object[]{((EReference) achildrenReferences.iterator().next()).getEType().getName(), refObject.eClass().getName()})); //$NON-NLS-1$ - //$NON-NLS-1$ = "Create two new children of type {0} for the selected {1}." - - } - - /** - * This returns the default create child label. - */ - public String getCreateChildText(Object object) { - //EObject refObject = (EObject) object; - Collection achildrenReferences = getChildrenReferences(object); - if (achildrenReferences.size() != 1) { - return WebAppEditResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ = "Create Child" - } - return WebAppEditResourceHandler.getString("6concat_UI_", (new Object[]{((EReference) achildrenReferences.iterator().next()).getEType().getName()})); //$NON-NLS-1$ = "Create {0}" - - } - - /** - * This returns the default create child help text. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - Collection achildrenReferences = getChildrenReferences(object); - if (achildrenReferences.size() != 1) { - return WebAppEditResourceHandler.getString("2concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a new child for the selected {0}." - } - return WebAppEditResourceHandler.getString("4concat_UI_", (new Object[]{((EReference) achildrenReferences.iterator().next()).getEType().getName(), refObject.eClass().getName()})); //$NON-NLS-1$ - //$NON-NLS-1$ = "Create a child of type {0} for the selected {1}." - - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebapplicationItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebapplicationItemProviderAdapterFactory.java deleted file mode 100644 index eac67b72e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WebapplicationItemProviderAdapterFactory.java +++ /dev/null @@ -1,686 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.Disposable; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.common.internal.provider.ListenerItemProvider; -import org.eclipse.jst.j2ee.internal.webapplication.util.WebapplicationAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewer.ContentViewer}s. The adapters generated by this factory convert - * MOF adapter notificiations into {@link org.eclipse.jface.DomainEvent}s. The adapters also - * support property sheets, see {@link com.ibm.itp.ui.api.propertysheet}. - */ -public class WebapplicationItemProviderAdapterFactory extends WebapplicationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - /** - * This keeps track of the one adapter used for all {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebApp} - * instances. - */ - protected WebAppItemProvider webAppItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ContextParam}instances. - */ - protected ContextParamItemProvider contextParamItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ErrorPage}instances. - */ - protected ErrorPageItemProvider errorPageItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ExceptionTypeErrorPage}instances. - */ - protected ExceptionTypeErrorPageItemProvider exceptionTypeErrorPageItemProvider; - /** - * This keeps track of the one adapter used for all {@link org.eclipse.jst.j2ee.internal.internal.webapplication.Filter} - * instances. - */ - protected FilterItemProvider filterItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.FilterMapping}instances. - */ - protected FilterMappingItemProvider filterMappingItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ErrorCodeErrorPage}instances. - */ - protected ErrorCodeErrorPageItemProvider errorCodeErrorPageItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WelcomeFileList}instances. - */ - protected WelcomeFileListItemProvider welcomeFileListItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WelcomeFile}instances. - */ - protected WelcomeFileItemProvider welcomeFileItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.TagLibRef}instances. - */ - protected TagLibRefItemProvider tagLibRefItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.TagLibRefType}instances. - */ - protected TagLibRefTypeItemProvider tagLibRefTypeItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.SecurityConstraint}instances. - */ - protected SecurityConstraintItemProvider securityConstraintItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebResourceCollection}instances. - */ - protected WebResourceCollectionItemProvider webResourceCollectionItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.URLPatternType}instances. - */ - protected URLPatternTypeItemProvider uRLPatternTypeItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.HTTPMethodType}instances. - */ - protected HTTPMethodTypeItemProvider hTTPMethodTypeItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.AuthConstraint}instances. - */ - protected AuthConstraintItemProvider authConstraintItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.UserDataConstraint}instances. - */ - protected UserDataConstraintItemProvider userDataConstraintItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LoginConfig}instances. - */ - protected LoginConfigItemProvider loginConfigItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.FormLoginConfig}instances. - */ - protected FormLoginConfigItemProvider formLoginConfigItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.MimeMapping}instances. - */ - protected MimeMappingItemProvider mimeMappingItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.SessionConfig}instances. - */ - protected SessionConfigItemProvider sessionConfigItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ServletMapping}instances. - */ - protected ServletMappingItemProvider servletMappingItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.Servlet}instances. - */ - protected ServletItemProvider servletItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebType}instances. - */ - protected WebTypeItemProvider webTypeItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ServletType}instances. - */ - protected ServletTypeItemProvider servletTypeItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.JSPType}instances. - */ - protected JSPTypeItemProvider jSPTypeItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.InitParam}instances. - */ - protected InitParamItemProvider initParamItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.Listener}instances. - */ - protected ListenerItemProvider listenerItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.RoleNameType}instances. - */ - protected RoleNameTypeItemProvider roleNameTypeItemProvider; - protected Disposable disposable = new Disposable(); - - /** - * This constructs an instance from a domain notifier. - */ - public WebapplicationItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - public Adapter adapt(Notifier target, Object adapterKey) { - return super.adapt(target, this); - } - - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - public Adapter adaptNew(Notifier target, Object adapterType) { - Adapter adapter = super.adaptNew(target, adapterType); - disposable.add(adapter); - return adapter; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.AuthConstraint}. - */ - public Adapter createAuthConstraintAdapter() { - if (authConstraintItemProvider == null) { - authConstraintItemProvider = new AuthConstraintItemProvider(this); - } - - return authConstraintItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ContextParam}. - */ - public Adapter createContextParamAdapter() { - if (contextParamItemProvider == null) { - contextParamItemProvider = new ContextParamItemProvider(this); - } - - return contextParamItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ErrorCodeErrorPage}. - */ - public Adapter createErrorCodeErrorPageAdapter() { - if (errorCodeErrorPageItemProvider == null) { - errorCodeErrorPageItemProvider = new ErrorCodeErrorPageItemProvider(this); - } - - return errorCodeErrorPageItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ErrorPage}. - */ - public Adapter createErrorPageAdapter() { - if (errorPageItemProvider == null) { - errorPageItemProvider = new ErrorPageItemProvider(this); - } - - return errorPageItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ExceptionTypeErrorPage}. - */ - public Adapter createExceptionTypeErrorPageAdapter() { - if (exceptionTypeErrorPageItemProvider == null) { - exceptionTypeErrorPageItemProvider = new ExceptionTypeErrorPageItemProvider(this); - } - - return exceptionTypeErrorPageItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.Filter}. - */ - public Adapter createFilterAdapter() { - if (filterItemProvider == null) { - filterItemProvider = new FilterItemProvider(this); - } - - return filterItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LocalEncodingMappingList}instances. <!-- begin-user-doc - * --> <!-- end-user-doc --> - * - * @generated - */ - protected LocalEncodingMappingListItemProvider localEncodingMappingListItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LocalEncodingMappingList}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createLocalEncodingMappingListAdapter() { - if (localEncodingMappingListItemProvider == null) { - localEncodingMappingListItemProvider = new LocalEncodingMappingListItemProvider(this); - } - - return localEncodingMappingListItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LocalEncodingMapping}instances. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected LocalEncodingMappingItemProvider localEncodingMappingItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LocalEncodingMapping}. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public Adapter createLocalEncodingMappingAdapter() { - if (localEncodingMappingItemProvider == null) { - localEncodingMappingItemProvider = new LocalEncodingMappingItemProvider(this); - } - - return localEncodingMappingItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.FilterMapping}. - */ - public Adapter createFilterMappingAdapter() { - if (filterMappingItemProvider == null) { - filterMappingItemProvider = new FilterMappingItemProvider(this); - } - - return filterMappingItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.FormLoginConfig}. - */ - public Adapter createFormLoginConfigAdapter() { - if (formLoginConfigItemProvider == null) { - formLoginConfigItemProvider = new FormLoginConfigItemProvider(this); - } - - return formLoginConfigItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.HTTPMethodType}. - */ - public Adapter createHTTPMethodTypeAdapter() { - if (hTTPMethodTypeItemProvider == null) { - hTTPMethodTypeItemProvider = new HTTPMethodTypeItemProvider(this); - } - - return hTTPMethodTypeItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.InitParam}. - */ - public Adapter createInitParamAdapter() { - if (initParamItemProvider == null) { - initParamItemProvider = new InitParamItemProvider(this); - } - - return initParamItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.Listener}. - */ - public Adapter createListenerAdapter() { - if (listenerItemProvider == null) { - listenerItemProvider = new ListenerItemProvider(this); - } - - return listenerItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.JSPType}. - */ - public Adapter createJSPTypeAdapter() { - if (jSPTypeItemProvider == null) { - jSPTypeItemProvider = new JSPTypeItemProvider(this); - } - - return jSPTypeItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.URLPatternType}instances. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected URLPatternTypeItemProvider urlPatternTypeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.LoginConfig}. - */ - public Adapter createLoginConfigAdapter() { - if (loginConfigItemProvider == null) { - loginConfigItemProvider = new LoginConfigItemProvider(this); - } - - return loginConfigItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.MimeMapping}. - */ - public Adapter createMimeMappingAdapter() { - if (mimeMappingItemProvider == null) { - mimeMappingItemProvider = new MimeMappingItemProvider(this); - } - - return mimeMappingItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.RoleNameType}. - */ - public Adapter createRoleNameTypeAdapter() { - if (roleNameTypeItemProvider == null) { - roleNameTypeItemProvider = new RoleNameTypeItemProvider(this); - } - - return roleNameTypeItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.SecurityConstraint}. - */ - public Adapter createSecurityConstraintAdapter() { - if (securityConstraintItemProvider == null) { - securityConstraintItemProvider = new SecurityConstraintItemProvider(this); - } - - return securityConstraintItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.Servlet}. - */ - public Adapter createServletAdapter() { - if (servletItemProvider == null) { - servletItemProvider = new ServletItemProvider(this); - } - - return servletItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ServletMapping}. - */ - public Adapter createServletMappingAdapter() { - if (servletMappingItemProvider == null) { - servletMappingItemProvider = new ServletMappingItemProvider(this); - } - - return servletMappingItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.ServletType}. - */ - public Adapter createServletTypeAdapter() { - if (servletTypeItemProvider == null) { - servletTypeItemProvider = new ServletTypeItemProvider(this); - } - - return servletTypeItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.JSPType}instances. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected JSPTypeItemProvider jspTypeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.SessionConfig}. - */ - public Adapter createSessionConfigAdapter() { - if (sessionConfigItemProvider == null) { - sessionConfigItemProvider = new SessionConfigItemProvider(this); - } - - return sessionConfigItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.TagLibRef}. - */ - public Adapter createTagLibRefAdapter() { - if (tagLibRefItemProvider == null) { - tagLibRefItemProvider = new TagLibRefItemProvider(this); - } - - return tagLibRefItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.TagLibRef}. - */ - public Adapter createTagLibRefTypeAdapter() { - if (tagLibRefTypeItemProvider == null) { - tagLibRefTypeItemProvider = new TagLibRefTypeItemProvider(this); - } - - return tagLibRefTypeItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.URLPatternType}. - */ - public Adapter createURLPatternTypeAdapter() { - if (uRLPatternTypeItemProvider == null) { - uRLPatternTypeItemProvider = new URLPatternTypeItemProvider(this); - } - - return uRLPatternTypeItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.HTTPMethodType}instances. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected HTTPMethodTypeItemProvider httpMethodTypeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.UserDataConstraint}. - */ - public Adapter createUserDataConstraintAdapter() { - if (userDataConstraintItemProvider == null) { - userDataConstraintItemProvider = new UserDataConstraintItemProvider(this); - } - - return userDataConstraintItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebApp}. - */ - public Adapter createWebAppAdapter() { - if (webAppItemProvider == null) { - webAppItemProvider = new WebAppItemProvider(this); - } - - return webAppItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebResourceCollection}. - */ - public Adapter createWebResourceCollectionAdapter() { - if (webResourceCollectionItemProvider == null) { - webResourceCollectionItemProvider = new WebResourceCollectionItemProvider(this); - } - - return webResourceCollectionItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WebType}. - */ - public Adapter createWebTypeAdapter() { - if (webTypeItemProvider == null) { - webTypeItemProvider = new WebTypeItemProvider(this); - } - - return webTypeItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WelcomeFile}. - */ - public Adapter createWelcomeFileAdapter() { - if (welcomeFileItemProvider == null) { - welcomeFileItemProvider = new WelcomeFileItemProvider(this); - } - - return welcomeFileItemProvider; - } - - /** - * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WelcomeFileList}. - */ - public Adapter createWelcomeFileListAdapter() { - if (welcomeFileListItemProvider == null) { - welcomeFileListItemProvider = new WelcomeFileListItemProvider(this); - } - - return welcomeFileListItemProvider; - } - - public void dispose() { - disposable.dispose(); - } - - /** - * This returns the root adapter factory that contains the factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return (parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory()); - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This sets the composed adapter factory that contains the factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WelcomeFileItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WelcomeFileItemProvider.java deleted file mode 100644 index a30a3170f..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WelcomeFileItemProvider.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.WelcomeFile; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WelcomeFile}object. - */ -public class WelcomeFileItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public WelcomeFileItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns welcome_file.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("welcome_file");//$NON-NLS-1$ - } - - /** - * This returns the fileList of the WelcomeFile. - */ - public Object getParent(Object object) { - return ((WelcomeFile) object).getFileList(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - WebapplicationPackage pkg = WebapplicationPackage.eINSTANCE; - - // This is for the welcomeFile feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), WebAppEditResourceHandler.getString("WelcomeFile_UI_"), //$NON-NLS-1$ = "WelcomeFile" - WebAppEditResourceHandler.getString("The_welcomeFile_property_UI_"), //$NON-NLS-1$ = "The welcomeFile property" - pkg.getWelcomeFile_WelcomeFile())); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Welcome File feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addWelcomeFilePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WelcomeFile_welcomeFile_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WelcomeFile_welcomeFile_feature", "_UI_WelcomeFile_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - WebapplicationPackage.eINSTANCE.getWelcomeFile_WelcomeFile(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - WelcomeFile welcomeFile = (WelcomeFile) object; - String name = welcomeFile.getWelcomeFile(); - if (name == null) - name = WebAppEditResourceHandler.getString("<welcome-file>_UI_"); //$NON-NLS-1$ = "<welcome-file>" - return name; - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(WelcomeFile.class)) { - case WebapplicationPackage.WELCOME_FILE__WELCOME_FILE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /** - * This always returns false. The base class has already implemented - * {@link org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren ItemProviderAdapter.getChildren} - * to return the empty enumeration, and this to check that enumeration, but we know there can't - * be any children, so this is faster. - */ - public boolean hasChildren(Object object) { - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WelcomeFileListItemProvider.java b/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WelcomeFileListItemProvider.java deleted file mode 100644 index 0907eb48a..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webedit/org/eclipse/jst/j2ee/internal/web/providers/WelcomeFileListItemProvider.java +++ /dev/null @@ -1,161 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.providers; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.webapplication.WebapplicationPackage; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webapplication.WelcomeFile; -import org.eclipse.jst.j2ee.webapplication.WelcomeFileList; - - -/** - * This is the item provider adpater for a {@link org.eclipse.jst.j2ee.internal.internal.webapplication.WelcomeFileList} - * object. - */ -public class WelcomeFileListItemProvider extends WebapplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - */ - public WelcomeFileListItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This creates a new child for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - WelcomeFile child = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - return Collections.singleton(WebapplicationPackage.eINSTANCE.getWelcomeFileList_File()); - } - - /** - * This returns the image for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return WebPlugin.getDefault().getImage(refObject.eClass().getName() + "CreateWelcomeFile");//$NON-NLS-1$ - } - - /** - * This returns the label for {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return WebAppEditResourceHandler.getString("Create_WelcomeFile_UI_"); //$NON-NLS-1$ = "Create WelcomeFile" - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.webapplication.commandCreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return WebAppEditResourceHandler.getString("42concat_UI_", (new Object[]{refObject.eClass().getName()})); //$NON-NLS-1$ = "Create a child of type WelcomeFile for the selected {0}." - } - - /** - * This returns welcome_list.gif. - */ - public Object getImage(Object object) { - return WebPlugin.getDefault().getImage("welcome_list");//$NON-NLS-1$ - } - - /** - * This returns the webApp of the WelcomeFileList. - */ - public Object getParent(Object object) { - return ((WelcomeFileList) object).getWebApp(); - } - - public String getText(Object object) { - return WebAppEditResourceHandler.getString("Welcome_File_List_UI_"); //$NON-NLS-1$ = "Welcome File List" - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(WelcomeFileList.class)) { - case WebapplicationPackage.WELCOME_FILE_LIST__FILE : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(WebapplicationPackage.eINSTANCE.getWelcomeFileList_File(), WebapplicationFactory.eINSTANCE.createWelcomeFile())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/ContextRootUpdateOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/ContextRootUpdateOperation.java deleted file mode 100644 index 23a343130..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/ContextRootUpdateOperation.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.internal.earcreation.EAREditModel; -import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; - -/** - * Insert the type's description here. Creation date: (10/31/2001 6:45:07 PM) - * - * @author: Administrator - */ -public class ContextRootUpdateOperation implements IHeadlessRunnableWithProgress { - public String fContextRoot; - public org.eclipse.core.resources.IProject fProject; - - /** - * ContextRootUpdateOperation constructor comment. - */ - public ContextRootUpdateOperation(IProject project, String contextRoot) { - super(); - fProject = project; - fContextRoot = contextRoot; - } - - /** - * Runs this operation without forcing a UI dependency. - * - * @param monitor - * the progress monitor to use to display progress and receive requests for - * cancelation - * @exception InvocationTargetException - * if the run method must propagate a checked exception, it should wrap it inside - * an <code>InvocationTargetException</code>; runtime exceptions are - * automatically wrapped in an <code>InvocationTargetException</code> by the - * calling context - * @exception InterruptedException - * if the operation detects a request to cancel, using - * <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing - * <code>InterruptedException</code> - * - * @see IRunnableWithProgress - */ - public void run(org.eclipse.core.runtime.IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - - // update context root in web project - WebPropertiesUtil.updateContextRoot(fProject, fContextRoot); - - // update context root in ear project - updateContextRootInEAR(fProject, fContextRoot); - } - - protected void updateContextRootInEAR(org.eclipse.core.resources.IProject project, String contextRoot) { - -// J2EEWebNatureRuntime runtime = J2EEWebNatureRuntime.getRuntime(project); -// if (runtime == null) -// return; - -// EARNatureRuntime earNatureRuntime[] = runtime.getReferencingEARProjects(); - EARNatureRuntime earNatureRuntime[] = new EARNatureRuntime[0]; - EAREditModel editModel = null; - for (int i = 0; i < earNatureRuntime.length; i++) { - // hold the model and update the context root & release the model - try { - editModel = earNatureRuntime[i].getEarEditModelForWrite(this); - if (editModel != null) { - Module module = null; - if ((module = earNatureRuntime[i].getModule(project)) != null) { - - // only if the module is a WebModule - if (module instanceof WebModule) { - //if(((WebModule)module).isSetContextRoot()) - ((WebModule) module).setContextRoot(contextRoot); - } - } - editModel.saveIfNecessary(this); - } - } catch (Throwable e) { - Logger.getLogger().logError(e); - } finally { - if (editModel != null) - editModel.releaseAccess(this); - editModel = null; - } - - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/FlexibleJ2EEWebSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/FlexibleJ2EEWebSaveStrategyImpl.java deleted file mode 100644 index 002f0bfa0..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/FlexibleJ2EEWebSaveStrategyImpl.java +++ /dev/null @@ -1,201 +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.jst.j2ee.internal.web.archive.operations; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.archive.operations.FlexibleJ2EESaveStrategyImpl; -import org.eclipse.jst.j2ee.internal.plugin.LibCopyBuilder; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.componentcore.resources.IVirtualResource; - -public class FlexibleJ2EEWebSaveStrategyImpl extends FlexibleJ2EESaveStrategyImpl { - - private HashMap filesToSave; // container a mapping from the File.getURI() to the target path - private HashSet filesNotToSave; - - public FlexibleJ2EEWebSaveStrategyImpl(IVirtualComponent vComponent) { - super(vComponent); - } - - public void save(File aFile, FileIterator iterator) throws SaveFailureException { - if (aFile.isArchive() && shouldIterateOver((Archive) aFile)) { - save((Archive) aFile); - } else { - InputStream in = null; - if (!aFile.isDirectoryEntry()) { - try { - in = iterator.getInputStream(aFile); - } catch (IOException ex) { - throw new SaveFailureException(aFile.getURI(), ex); - } - } - IPath path = (IPath) filesToSave.get(aFile.getURI()); - if (path != null) { - try { - saveToWorkbenchPath(path, in); - } catch (Exception e) { - throw new SaveFailureException(e.getMessage(), e); - } - } - } - } - - protected void saveFiles() throws SaveFailureException { - WARFile warFile = (WARFile) getArchive(); - // First go through the classes in the WEB-INF/classes directory and try - // to find a source file for each one file there. If a source file is - // found, copy - // it to the source directory, if not, copy the .class file to the - // imported_classes directory. - List classesFiles = getClassesFiles(); - Iterator classesIterator = classesFiles.iterator(); - filesToSave = new HashMap(); - HashMap libModuleFiles = new HashMap(); - boolean hasSource = false; - boolean hasClasses = false; - while (classesIterator.hasNext()) { - File classFile = (File) classesIterator.next(); - if (WTProjectStrategyUtils.isClassFile(classFile.getURI())) { - hasClasses = true; - File sourceFile = warFile.getSourceFile(classFile); - IPath path = null; - if (sourceFile != null) { - hasSource = true; - // TODO can this be optimized? - IPath sourcePath = new Path(sourceFile.getURI()); - IPath relClassPath = new Path(WTProjectStrategyUtils.makeRelative(classFile.getURI(), ArchiveConstants.WEBAPP_CLASSES_URI)); - String relSourceURI = sourcePath.removeFirstSegments(sourcePath.segmentCount() - relClassPath.segmentCount()).toString(); - path = convertToSourcePath(relSourceURI); - filesToSave.put(classFile.getURI(), null); // don't save the .class file - filesToSave.put(sourceFile.getURI(), path); - } else { - path = convertToImportedClassesPath(classFile.getURI()); - filesToSave.put(classFile.getURI(), path); - } - } - } - // If there were no class files, then put any other resource in the - // classes - // directory to the source folder. - if (!hasClasses) - hasSource = true; - // Next go through the classes directory again saving all of the files - // that were - // not previously saved. This handles the resource files. - classesIterator = classesFiles.iterator(); - while (classesIterator.hasNext()) { - File classFile = (File) classesIterator.next(); - if (!filesToSave.containsKey(classFile.getURI())) { - File copyFile = warFile.getSourceFile(classFile); - // If its a java file, put it into the source directory - if (!hasSource && WTProjectStrategyUtils.isSourceFile(classFile.getURI())) - hasSource = true; - IPath path = null; - if (!hasSource) { - path = convertToImportedClassesPath(classFile.getURI()); - } else { - IPath sourcePath = new Path(classFile.getURI()); - IPath relClassPath = new Path(WTProjectStrategyUtils.makeRelative(classFile.getURI(), ArchiveConstants.WEBAPP_CLASSES_URI)); - String relSourceURI = sourcePath.removeFirstSegments(sourcePath.segmentCount() - relClassPath.segmentCount()).toString(); - path = convertToSourcePath(relSourceURI); - } - filesToSave.put(classFile.getURI(), path); - if (copyFile != null) - filesToSave.put(copyFile.getURI(), null); - } - } - // Finally, make a pass through all of the files now, saving them to the - // appropriate place - // if they have not yet been saved. - List allFiles = getArchive().getFiles(); - for (Iterator iter = allFiles.iterator(); iter.hasNext();) { - File file = (File) iter.next(); - if (!filesToSave.containsKey(file.getURI())) { - if (!libModuleFiles.containsKey(file.getURI())) { - IPath path = convertToContentPath(file.getURI()); - filesToSave.put(file.getURI(), path); - } - } - } - super.saveFiles(); - } - - protected List getClassesFiles() { - return ((WARFile) getArchive()).getClasses(); - } - - private IPath importedClassesPath; - - protected IPath convertToImportedClassesPath(String uri) { - if (importedClassesPath == null) { - IPath javaPath = getJavaSourcePath(); - importedClassesPath = javaPath.removeLastSegments(1).append(LibCopyBuilder.IMPORTED_CLASSES_PATH); - try { - IPath workspacePath = vComponent.getProject().getFullPath().append(importedClassesPath); - mkdirs(workspacePath, ResourcesPlugin.getWorkspace().getRoot()); - IVirtualFolder javaSourceFolder = vComponent.getFolder(new Path("/" + J2EEConstants.WEB_INF + "/classes")); - javaSourceFolder.createLink(workspacePath.removeFirstSegments(1), 0, null); - } catch (CoreException e) { - // TODO - } - - } - return importedClassesPath.append(WTProjectStrategyUtils.makeRelative(uri, ArchiveConstants.WEBAPP_CLASSES_URI)); - } - - private IPath javaSourcePath; - - private void loadJavaSource() { - IVirtualResource[] resources = vComponent.getResources("java"); - IVirtualFolder vJavaSourceFolder = (IVirtualFolder) resources[0]; - IFolder javaSource = vJavaSourceFolder.getUnderlyingFolder(); - javaSourcePath = javaSource.getProjectRelativePath(); - } - - protected IPath getJavaSourcePath() { - if (javaSourcePath == null) { - loadJavaSource(); - } - return javaSourcePath; - } - - protected IPath convertToSourcePath(String uri) { - return getJavaSourcePath().append(uri); - } - - private IPath webContentPath; - - protected IPath convertToContentPath(String uri) { - if (webContentPath == null) { - webContentPath = vComponent.getFolder("/").getUnderlyingResource().getProjectRelativePath(); - } - return webContentPath.append(uri); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategy.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategy.java deleted file mode 100644 index 2a2216c96..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategy.java +++ /dev/null @@ -1,16 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; - - -public interface WTProjectLoadStrategy extends LoadStrategy { - //Default -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java deleted file mode 100644 index a9bf942ca..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java +++ /dev/null @@ -1,474 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter; -import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverterImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; -import org.eclipse.jst.j2ee.internal.web.operations.ProjectSupportResourceHandler; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.web.internal.operation.ILibModule; - -public class WTProjectLoadStrategyImpl extends org.eclipse.jst.j2ee.internal.archive.operations.J2EELoadStrategyImpl { - private final static String SOURCE_DIR = "source"; //$NON-NLS-1$ - private final static String CLASSES_DIR = "classes"; //$NON-NLS-1$ - - public static final String WEBSETTINGS_FILE_URI = ".j2ee"; //$NON-NLS-1$ - - /** - * flag which indicates whether or not to export compiled JSP files (compiled files exist in - * /WEB-INF/classes as .class and .java[for debug]) - */ - private boolean excludeCompiledJspFiles = false; - - /** - * EJBProjectLoadStrategyImpl constructor comment. - */ - public WTProjectLoadStrategyImpl(IProject aProject) { - super(); - project = aProject; - filesList = new ArrayList(); - } - - /** - * For each loose lib JAR project in this ear project, add an Archive to the list of files in - * the EAR - */ - public void addLooseLibJARsToFiles() { - ILibModule[] libModules = getLibModules(); - for (int i = 0; i < libModules.length; i++) { - ILibModule iLibModule = libModules[i]; - String uri = new Path(iLibModule.getURI()).makeRelative().toString(); - String projectName = iLibModule.getProjectName(); - try { - Archive utilJAR = J2EEProjectUtilities.asArchive(uri, projectName, isExportSource(), shouldIncludeProjectMetaFiles()); - if (utilJAR == null) - continue; - filesList.add(utilJAR); - } catch (OpenFailureException oe) { - String message = ProjectSupportResourceHandler.getString("UNABLE_TO_LOAD_MODULE_ERROR_", new Object[]{uri, getProject().getName(), oe.getConcatenatedMessages()}); //$NON-NLS-1$ - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logTrace(message); - } - } - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - public java.util.List getFiles() { - filesList.clear(); - try { - // Determine if loose libs exist and set flag for meta files - if (areLooseLibJarsIncluded()) { - setIncludeProjectMetaFiles(true); - } - // First go through all of the files under the webApplication - // directory, omitting the ones that are imported classes jars. - List webAppFiles = new ArrayList(Arrays.asList(getModuleContainer().members())); - if (shouldIncludeProjectMetaFiles()) { - webAppFiles.add(getProject().getFile(PROJECT_FILE_URI)); - webAppFiles.add(getProject().getFile(CLASSPATH_FILE_URI)); - webAppFiles.add(getProject().getFile(WEBSETTINGS_FILE_URI)); - } - IContainer outputContainer = JavaProjectUtilities.getJavaProjectOutputContainer(getProject()); - webAppFiles.addAll(Arrays.asList(outputContainer.members())); - - // if the user has chosen not to export compiled JSP files, then we need to make sure - // that - // the compiled class files are excluded from the /WEB-INF/classes directory - if (isExcludeCompiledJspFiles()) { - try { - // IBaseWebNature wnr = J2EEWebNatureRuntimeUtilities.getRuntime(project); - IPath outputPath = outputContainer.getProjectRelativePath(); - // if (wnr != null) { - // IPath modulePath = wnr.getWebModulePath(); - // IPath outputPath = - // J2EEWebNatureRuntimeUtilities.getWebOutputFolderPath(modulePath.toString()); - // remove the WEB-INF folder from the list... we will get files from that - // directory - // after all others, in order to calculate which output files may exist, - // according - // to the JSPs in all other directories - // IPath webInf = modulePath.append(IWebNatureConstants.INFO_DIRECTORY); - // IResource outputDirResource = null; - // int len = webAppFiles.size(); - // boolean found = false; - // for (int i = 0; !found && i < len; i++) { - // IResource res = (IResource) webAppFiles.get(i); - // if (res.getFullPath().equals(outputPath)) { - // outputDirResource = (IResource) webAppFiles.remove(i); - // found = true; - // } - // } - // collect all the files (excluding those in /WEB-INF) and mark all of the - // JSPs' compiled files (.class,.java) to be excluded from the - webAppFiles = getFilesExcludeCompiledJsps(webAppFiles, outputPath); - // now collect the files from the /WEB-INF directory. All of the compiled - // JSP - // output files should not be picked up now, as they were placed into the - // visitedURIs - // list - ArrayList webInfList = new ArrayList(1); - webInfList.add(outputContainer); - webInfList = getFiles(webInfList); - webAppFiles.addAll(webInfList); - // } else { - // webAppFiles = getFiles(webAppFiles); - // } - } catch (Exception e) { - throw new ArchiveRuntimeException(e.getMessage(), e); - } - } else { - webAppFiles = getFiles(webAppFiles); - } - - HashSet addedURIs = new HashSet(); - - Iterator iterator = webAppFiles.iterator(); - while (iterator.hasNext()) { - File file = (File) iterator.next(); - if (!isImportedClassJar(file)) { - filesList.add(file); - addedURIs.add(file.getURI()); - } - } - - // Now go through the imported classes jars and add any - // files that were not already in the classes directory. - IContainer libFolder = WebPropertiesUtil.getWebLibFolder(project); - if (libFolder != null && libFolder.exists()) { - List libFiles = Arrays.asList(libFolder.members()); - getVisitedURIs().clear(); - libFiles = getFiles(libFiles); - - iterator = libFiles.iterator(); - while (iterator.hasNext()) { - File file = (File) iterator.next(); - if (isImportedClassJar(file)) { - List archiveFiles = getFiles((Archive) file); - Iterator i = archiveFiles.iterator(); - while (i.hasNext()) { - File innerFile = (File) i.next(); - if (!addedURIs.contains(innerFile.getURI())) { - filesList.add(innerFile); - addedURIs.add(innerFile.getURI()); - } - } - } - } - } - - // If the user wants source in his WAR file, then add that in too. - if (isExportSource()) { - List asourceFolders = getSourceFolders(); - - for (int i = 0; i < asourceFolders.size(); i++) { - IContainer sourceFolder = (IContainer) asourceFolders.get(i); - if (sourceFolder != null && sourceFolder.exists()) { - List sourceFiles = Arrays.asList(sourceFolder.members()); - sourceFiles = getFiles(sourceFiles); - - Iterator iterator2 = sourceFiles.iterator(); - while (iterator2.hasNext()) { - File sourceFile = (File) iterator2.next(); - if (!addedURIs.contains(sourceFile.getURI())) { - filesList.add(sourceFile); - addedURIs.add(sourceFile.getURI()); - } - } - } - } - } - // Add any lib module jars in. - addLooseLibJARsToFiles(); - } catch (Exception exc) { - throw new ArchiveRuntimeException(exc.getMessage(), exc); - //$NON-NLS-1$ - } - return filesList; - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - private ArrayList getFiles(Archive archive) throws Exception { - - List archiveFiles = archive.getFiles(); - ArrayList retList = new ArrayList(archiveFiles.size()); - Iterator i = archiveFiles.iterator(); - while (i.hasNext()) { - File file = (File) i.next(); - file.setURI(ArchiveConstants.WEBAPP_CLASSES_URI + file.getURI()); - retList.add(file); - } - return retList; - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - protected ArrayList getFiles(List projectResources) throws Exception { - if (projectResources.isEmpty()) { - return new ArrayList(0); - } - - ArrayList retAry = new ArrayList(); - - Iterator iterator = projectResources.iterator(); - while (iterator.hasNext()) { - IResource res = (IResource) (iterator.next()); - if (res.getType() == IResource.FILE) { - //We have to avoid duplicates between the source and output folders (non-java - // resources) - IPath projRelPath = res.getProjectRelativePath(); - IPath outputPath = getOutputPathForFile(projRelPath); - String loadURI = projRelPath == null ? null : projRelPath.toString(); - if (loadURI == null || getVisitedURIs().contains(loadURI)) - continue; - File cFile = createFile(loadURI); - cFile.setURI(outputPath.toString()); - cFile.setLastModified(getLastModified(res)); - retAry.add(cFile); - getVisitedURIs().add(loadURI); - } else { - List moreFiles = getFiles(Arrays.asList(((IContainer) res).members())); - retAry.addAll(moreFiles); - } - } - return retAry; - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - protected ArrayList getFilesExcludeCompiledJsps(List projectResources, IPath outputDir) throws Exception { - if (projectResources.isEmpty()) { - return new ArrayList(0); - } - - ArrayList retAry = new ArrayList(); - - Iterator iterator = projectResources.iterator(); - while (iterator.hasNext()) { - IResource res = (IResource) (iterator.next()); - if (res.getType() == IResource.FILE) { - //We have to avoid duplicates between the source and output folders (non-java - // resources) - IPath projRelPath = res.getProjectRelativePath(); - IPath outputPath = getOutputPathForFile(projRelPath); - String loadURI = projRelPath == null ? null : projRelPath.toString(); - if (loadURI == null || getVisitedURIs().contains(loadURI)) - continue; - File cFile = createFile(loadURI); - cFile.setURI(outputPath.toString()); - cFile.setLastModified(getLastModified(res)); - retAry.add(cFile); - getVisitedURIs().add(loadURI); - - // exclude compiled JSP files - String ext = projRelPath.getFileExtension(); - if (ext != null && ext.equals("jsp")) {//$NON-NLS-1$ - addOutputFilesToList(outputDir, outputPath, getVisitedURIs()); - } - } else { - List moreFiles = getFilesExcludeCompiledJsps(Arrays.asList(((IContainer) res).members()), outputDir); - retAry.addAll(moreFiles); - } - } - return retAry; - } - - /* - * mark the compiled JSP output files (.class,.java) to NOT be added to the list of files to be - * exported - */ - private void addOutputFilesToList(IPath outputDir, IPath relativeJspPath, Set visitedUris) { - outputDir = outputDir.removeFirstSegments(1); - - relativeJspPath = relativeJspPath.removeFileExtension(); - String baseFileName = getCompiledJspManagledName(relativeJspPath.lastSegment()); - relativeJspPath = relativeJspPath.removeLastSegments(1); - - String jspClass = outputDir.append(relativeJspPath).append(baseFileName + ".class").toString(); //$NON-NLS-1$ - String jspJava = outputDir.append(relativeJspPath).append(baseFileName + ".java").toString();//$NON-NLS-1$ - - visitedUris.add(jspClass); - visitedUris.add(jspJava); - } - - /** - * Mangle string to WAS-like specifications - * - * Was mangles Tom&Jerry as: _Tom_26_Jerry; this takes in the mangled name and returns the - * original name. - * - * Unmangles the qualified type name. If an underscore is found it is assumed to be a mangled - * representation of a non-alpha, non-digit character of the form _NN_, where NN are hex digits - * representing the encoded character. This routine converts it back to the original character. - */ - protected static String getCompiledJspManagledName(String name) { - StringBuffer modifiedName = new StringBuffer(); - int length = name.length(); - - modifiedName.append('_'); - - // ensure rest of characters are valid - for (int i = 0; i < length; i++) { - char currentChar = name.charAt(i); - if (Character.isJavaIdentifierPart(currentChar) == true) { - modifiedName.append(currentChar); - } else { - modifiedName.append(mangleChar(currentChar)); - } - } - return modifiedName.toString(); - - } - - /** - * take a character and return its hex equivalent - */ - protected static String mangleChar(char ch) { - if (ch == java.io.File.separatorChar) { - ch = '/'; - } - - if (Character.isLetterOrDigit(ch) == true) { - return "" + ch; //$NON-NLS-1$ - } - return "_" + Integer.toHexString(ch).toUpperCase() + "_"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * @see com.ibm.etools.archive.LoadStrategy - */ - public IContainer getModuleContainer() { - return WebPropertiesUtil.getModuleServerRoot(project); - } - - /** - * save method comment. - */ - public WorkbenchURIConverter getProjectURIConverter() { - projectURIConverter = new WorkbenchURIConverterImpl(project); - projectURIConverter.addInputContainer(getModuleContainer()); - return projectURIConverter; - - } - - /** - * save method comment. - */ - public IFolder getSourceFolder() { - return (IFolder) WebPropertiesUtil.getJavaSourceFolder(project); - } - - public ILibModule[] getLibModules() { - //TODO this will throw classcast exception, do we still use ILibModule? - WebArtifactEdit webArtifactEdit = null; - try { - webArtifactEdit = (WebArtifactEdit)StructureEdit.getFirstArtifactEditForRead(project); - if (webArtifactEdit!=null) - return (ILibModule[]) webArtifactEdit.getLibModules(); - } finally { - if (webArtifactEdit!=null) - webArtifactEdit.dispose(); - } - return null; - - } - - protected IPath getOutputPathForFile(IPath aPath) throws Exception { - if (isProjectMetaFile(aPath.toString())) - return aPath; - - String uri = aPath.toString(); - if (uri.startsWith(getModuleContainer().getName())) { - return new Path(uri).removeFirstSegments(getModuleContainer().getProjectRelativePath().segmentCount()); - } - // If this is a source folder, stick it 'source' dir under the classes directory - List asourceFolders = getSourceFolders(); - for (Iterator iterator = asourceFolders.iterator(); iterator.hasNext();) { - IFolder sourceFolder = (IFolder) iterator.next(); - if (uri.startsWith(sourceFolder.getProjectRelativePath().toString())) { - IPath relPath = aPath.removeFirstSegments(sourceFolder.getProjectRelativePath().segmentCount()); - IPath retPath = new Path(J2EEConstants.WEB_INF); - retPath = retPath.append(SOURCE_DIR); - return retPath.append(relPath); - } - } - - // If this is in an output folder, stick it in 'WEB-INF/classes - IPath outputPath = JavaProjectUtilities.getJavaProjectOutputContainer(getProject()).getProjectRelativePath(); - if (aPath.segmentCount() > outputPath.segmentCount() && aPath.removeLastSegments(aPath.segmentCount() - outputPath.segmentCount()).equals(outputPath)) { - IPath retPath = new Path(J2EEConstants.WEB_INF); - retPath = retPath.append(CLASSES_DIR); - return retPath.append(aPath.removeFirstSegments(outputPath.segmentCount())); - } - - return aPath; - } - - private boolean isImportedClassJar(File file) { - String uri = file.getURI(); - return file.isArchive() && uri.startsWith(ArchiveConstants.WEBAPP_LIB_URI) && uri.endsWith(IWebNatureConstants.IMPORTED_CLASSES_SUFFIX); - } - - private boolean areLooseLibJarsIncluded() { - boolean exists = false; - ILibModule[] libModules = getLibModules(); - if (libModules.length > 0) - exists = true; - return exists; - } - - /** - * set flag which indicates whether or not to export compiled JSP files (compiled files exist in - * /WEB-INF/classes as .class and .java[for debug]) - */ - public void setExcludeCompiledJspFiles(boolean export) { - excludeCompiledJspFiles = export; - } - - /** - * return whether or not to export compiled JSP files (compiled files exist in /WEB-INF/classes - * as .class and .java[for debug]) - */ - public boolean isExcludeCompiledJspFiles() { - return excludeCompiledJspFiles; - } - - protected boolean isProjectMetaFile(String uri) { - return super.isProjectMetaFile(uri) || WEBSETTINGS_FILE_URI.equals(uri); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectSaveStrategy.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectSaveStrategy.java deleted file mode 100644 index 069bbd114..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectSaveStrategy.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; - - - -public interface WTProjectSaveStrategy extends SaveStrategy { - //Default -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectSaveStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectSaveStrategyImpl.java deleted file mode 100644 index e3c6d5074..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectSaveStrategyImpl.java +++ /dev/null @@ -1,581 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jem.util.emf.workbench.WorkbenchByteArrayOutputStream; -import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter; -import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverterImpl; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator; -import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil; -import org.eclipse.jst.j2ee.internal.archive.operations.J2EESaveStrategyImpl; -import org.eclipse.jst.j2ee.internal.plugin.LibCopyBuilder; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; - -/** - * @author: Kevin Bauer - */ -public class WTProjectSaveStrategyImpl extends J2EESaveStrategyImpl { - HashMap filesToSave; - - //protected List libModules; - // Need .websettings to determine which jars are actually WLP/utility jars - //protected WebSettings webSettings; - //protected HashMap createdProjectsMap; - //protected boolean isNestedWAR = false; - protected WebModuleImportDataModel dataModel; - - public static final String WEBSETTINGS_FILE_URI = ".websettings"; //$NON-NLS-1$ - - /** - * WorkbenchSaveStrategyImpl constructor comment. - */ - public WTProjectSaveStrategyImpl(IProject project) { - super(project); - } - - /** - * Return the container that represents the root of this war file - */ - public IContainer getModuleServerRoot() { - return WebPropertiesUtil.getModuleServerRoot(project); - } - - /** - * Return an output stream for the input file. - */ - public OutputStream getOutputStream(String uri) throws Exception { - return getURIConverter(uri).createOutputStream(URI.createURI(uri)); - } - - public IFile getSaveFile(String aURI) { - String saveURI = (String) filesToSave.get(aURI); - try { - return getURIConverter(aURI).getFile(saveURI); - } catch (Exception exc) { - return null; - } - } - - public WorkbenchURIConverter getSourceURIConverter() { - if (sourceURIConverter == null) { - sourceURIConverter = new WorkbenchURIConverterImpl(getModuleServerRoot()); - sourceURIConverter.setForceSaveRelative(true); - } - return sourceURIConverter; - } - - public WorkbenchURIConverter getURIConverter(String uri) throws Exception { - return new WorkbenchURIConverterImpl(project); - } - - /** - * Return the web nature for the war project. - */ -// public J2EEWebNatureRuntime getWebNature() { -// return J2EEWebNatureRuntimeUtilities.getJ2EERuntime(project); -// } - - protected void saveFiles(FileIterator iterator) throws SaveFailureException { - while (iterator.hasNext()) { - File aFile = iterator.next(); - if (shouldSave(aFile)) - save(aFile, iterator); - } - } - - // private void setUpWLPs() { - // if (!(getLibModules().isEmpty())) { - // ILibModule[] libModArray = new ILibModule[libModules.size()]; - // for (int i = 0; i < libModules.size(); i++) { - // libModArray[i] = (ILibModule) libModules.get(i); - // } - // try { - // getWebNature().setLibModules(libModArray); - // } catch (CoreException e) { - // Logger.getLogger().logError(e); - // } - // } - // } - - protected boolean shouldSave(String uri) { - //if (uri.endsWith(WEBSETTINGS_FILE_URI)) { - // return false; - //} - if (isProjectMetaFile(uri)) - return includeProjectMetaFiles; - boolean shouldSave = getFilter().shouldSave(uri, getArchive()); - if (shouldSave && overwriteHandler != null) { - return (shouldOverwrite(uri)); - } - return shouldSave; - } - - protected boolean isProjectMetaFile(String uri) { - return super.isProjectMetaFile(uri) || WEBSETTINGS_FILE_URI.equals(uri); - } - - - protected List getClassesFiles() { - return ((WARFile) getArchive()).getClasses(); - } - - protected List getJarFiles() { - return ((WARFile) getArchive()).getArchiveFiles(); - } - - protected String convertToImportedClassesURI(String uri) { - IPath path = new Path(LibCopyBuilder.IMPORTED_CLASSES_PATH); - path = path.append(WTProjectStrategyUtils.makeRelative(uri, ArchiveConstants.WEBAPP_CLASSES_URI)); - return path.toString(); - } - - protected String convertToSourceURI(String uri) { - IFolder javaSource = (IFolder) WebPropertiesUtil.getJavaSourceFolder(project); - IPath path = javaSource.getProjectRelativePath(); - path = path.append(uri); - return path.toString(); - } - - protected String convertToContentURI(String uri) { - if (isProjectMetaFile(uri)) - return uri; - IPath path = WebPropertiesUtil.getModuleServerRoot(project).getProjectRelativePath(); - path = path.append(uri); - return path.toString(); - } - - protected void saveFiles() throws SaveFailureException { - WARFile warFile = (WARFile) getArchive(); - // First go through the classes in the WEB-INF/classes directory and try - // to find a source file for each one file there. If a source file is found, copy - // it to the source directory, if not, copy the .class file to the - // imported_classes directory. - List classesFiles = getClassesFiles(); - Iterator classesIterator = classesFiles.iterator(); - filesToSave = new HashMap(); - HashMap libModuleFiles = new HashMap(); - boolean hasSource = false; - boolean hasClasses = false; - while (classesIterator.hasNext()) { - File classFile = (File) classesIterator.next(); - if (WTProjectStrategyUtils.isClassFile(classFile.getURI())) { - hasClasses = true; - File copyFile = warFile.getSourceFile(classFile); - String saveURI = null; - if (copyFile == null) { - copyFile = classFile; - saveURI = convertToImportedClassesURI(copyFile.getURI()); - } else { - IPath sourcePath = new Path(copyFile.getURI()); - IPath relClassPath = new Path(WTProjectStrategyUtils.makeRelative(classFile.getURI(), ArchiveConstants.WEBAPP_CLASSES_URI)); - String relSourceURI = sourcePath.removeFirstSegments(sourcePath.segmentCount() - relClassPath.segmentCount()).toString(); - saveURI = convertToSourceURI(relSourceURI); - hasSource = true; - } - filesToSave.put(classFile.getURI(), null); - filesToSave.put(copyFile.getURI(), saveURI); - } - } - // If there were no class files, then put any other resource in the classes - // directory to the source folder. - if (!hasClasses) - hasSource = true; - // Next go through the classes directory again saving all of the files that were - // not previously saved. This handles the resource files. - classesIterator = classesFiles.iterator(); - while (classesIterator.hasNext()) { - File classFile = (File) classesIterator.next(); - if (!filesToSave.containsKey(classFile.getURI())) { - File copyFile = warFile.getSourceFile(classFile); - // If its a java file, put it into the source directory - if (!hasSource && WTProjectStrategyUtils.isSourceFile(classFile.getURI())) - hasSource = true; - String saveURI = null; - if (!hasSource) { - saveURI = convertToImportedClassesURI(classFile.getURI()); - } else { - IPath sourcePath = new Path(classFile.getURI()); - IPath relClassPath = new Path(WTProjectStrategyUtils.makeRelative(classFile.getURI(), ArchiveConstants.WEBAPP_CLASSES_URI)); - String relSourceURI = sourcePath.removeFirstSegments(sourcePath.segmentCount() - relClassPath.segmentCount()).toString(); - saveURI = convertToSourceURI(relSourceURI); - } - filesToSave.put(classFile.getURI(), saveURI); - if (copyFile != null) - filesToSave.put(copyFile.getURI(), null); - } - } - // if (isNestedWAR()) { - // if (!includeProjectMetaFiles) { - // if (checkCreateProjectOption()) - // createSourceProjectsForSelectJars(libModuleFiles); - // setUpWLPs(); - // } else - // createProjectsToIncludeProjectMetaData(libModuleFiles); - // } - // Finally, make a pass through all of the files now, saving them to the appropriate place - // if they have not yet been saved. - List allFiles = getArchive().getFiles(); - for (Iterator iter = allFiles.iterator(); iter.hasNext();) { - File file = (File) iter.next(); - if (!filesToSave.containsKey(file.getURI())) { - if (!libModuleFiles.containsKey(file.getURI())) { - String saveURI = convertToContentURI(file.getURI()); - filesToSave.put(file.getURI(), saveURI); - } - } - } - super.saveFiles(); - //updateProjectClasspaths(); - } - - // private void createProjectsToIncludeProjectMetaData(HashMap libModuleFiles) throws - // SaveFailureException { - // // Next go through the jar files to determine if there are wlp files to - // // expand into binary projects. Only if webSettings file has been saved - // ILibModule[] libModules = getLooseLibsModules(); - // List jarFiles = getJarFiles(); - // if (libModules != null && jarFiles != null) { - // - // Iterator jarIterator = jarFiles.iterator(); - // while (jarIterator.hasNext()) { - // File jarFile = (File) jarIterator.next(); - // for (int i = 0; i < libModules.length; i++) { - // if (jarFile.getName().equals(libModules[i].getJarName())) { - // saveArchiveAsJavaProject((Archive) jarFile, libModules[i]); - // libModuleFiles.put(jarFile.getURI(), null); - // } - // } - // } - // } - // } - - /** - * - */ - // private void createSourceProjectsForSelectJars(HashMap libModuleFiles) throws - // SaveFailureException { - // List jarFiles = getJarFiles(); - // Iterator jarIterator = jarFiles.iterator(); - // while (jarIterator.hasNext()) { - // File jarFile = (File) jarIterator.next(); - // if (checkCreateProjectOptions(jarFile)) { - // saveArchiveAsJavaProject((Archive) jarFile); - // libModuleFiles.put(jarFile.getURI(), null); - // } - // - // } - // } - /** - * - */ - // private void updateProjectClasspaths() { - // try { - // if (createdProjectsMap == null) - // return; - // List libModules = getJarFiles(); - // for (int i = 0; i < libModules.size(); i++) { - // Archive module = (Archive) libModules.get(i); - // Object object = createdProjectsMap.get(module.getURI()); - // if (object != null) { - // IProject proj = (IProject) object; - // IPath path = proj.getFullPath(); - // IClasspathEntry newEntry = JavaCore.newProjectEntry(path, false); - // ProjectUtilities.appendJavaClassPath(project, newEntry); - // } - // } - // } catch (JavaModelException ex) { - // Logger.getLogger().logError(ex); - // } - // } - // /** - // * @return - // */ - // private boolean checkCreateProjectOption() { - // return createWLProjectOptions != null && !createWLProjectOptions.isEmpty(); - // } - // - // /** - // * @return - // */ - // private boolean checkCreateProjectOptions(File jarFile) { - // return createWLProjectOptions != null && - // createWLProjectOptions.containsKey(jarFile.getURI()); - // } - /** - * @see com.ibm.etools.archive.SaveStrategy - */ - public void save(File aFile, FileIterator iterator) throws SaveFailureException { - if (aFile.isArchive() && dataModel.handlesArchive((Archive) aFile)) { - return; - } - - if (aFile.isArchive() && shouldIterateOver((Archive) aFile)) { - save((Archive) aFile); - } else { - InputStream in = null; - if (!aFile.isDirectoryEntry()) { - try { - in = iterator.getInputStream(aFile); - } catch (IOException ex) { - throw new SaveFailureException(aFile.getURI(), ex); - } - } - String saveURI = (String) filesToSave.get(aFile.getURI()); - if (saveURI != null) - save(saveURI, in); - } - } - - /** - * save method comment. - */ - public void save(String outputURI, InputStream in) throws SaveFailureException { - getProgressMonitor().subTask(outputURI); - try { - WorkbenchURIConverter conv = getProjectMetaURIConverter(); - IFile aFile = conv.getOutputFileWithMappingApplied(outputURI); - validateEdit(aFile); - OutputStream out = new WorkbenchByteArrayOutputStream(aFile); - ArchiveUtil.copy(in, out); - } catch (Exception e) { - throw new SaveFailureException(e.getMessage(), e); - } - worked(1); - } - - // protected ILibModule[] getLooseLibsModules() { - // try { - // File webSettingsFile = (((WARFile) getArchive()).getFile(WEBSETTINGS_FILE_URI)); - // - // ILibModule[] wlpModules; - // if (webSettingsFile != null) { - // WebSettings webSettings = new WebSettings(project, webSettingsFile); - // if (webSettings != null) { - // wlpModules = webSettings.getLibModules(); - // return wlpModules; - // } - // } - // } catch (FileNotFoundException ex) { - // return new ILibModule[0]; - // } - // return new ILibModule[0]; - // } - - // protected void saveArchiveAsJavaProject(Archive jarFile, ILibModule libModule) throws - // SaveFailureException { - // IProject nestedProject = null; - // if (createdProjectsMap == null) - // createdProjectsMap = new HashMap(); - // // Do overwrite protection - // if (shouldSaveWLProject(libModule)) { - // String projectName = createWLProjectOptions == null ? null : (String) - // createWLProjectOptions.get(jarFile.getURI()); - // if (projectName == null) - // projectName = libModule.getProjectName(); - // - // WebProjectCreationDataModel model = new WebProjectCreationDataModel(); - // model.setProperty(WebProjectCreationDataModel.CREATE_DEFAULT_FILES, Boolean.FALSE); - // model.setProperty(WebProjectCreationDataModel.PROJECT_NAME, projectName); - // IHeadlessRunnableWithProgress projOp = new WebProjectCreationOperation(model); - // executeOperation(projOp); - // nestedProject = model.getProject(); - // createdProjectsMap.put(jarFile.getURI(), nestedProject); - // - // if (isBinary() || includeProjectMetaFiles) { - // saveBinaryProject(nestedProject, jarFile); - // } else { - // JavaProjectSaveStrategyImpl strat = new JavaProjectSaveStrategyImpl(nestedProject); - // strat.setIncludeProjectMetaFiles(includeProjectMetaFiles); - // strat.setShouldIncludeImportedClasses(true); - // strat.setProgressMonitor(new SubProgressMonitor(progressMonitor, 1)); - // jarFile.save(strat); - // - // if (includeProjectMetaFiles) { - // try { - // ProjectUtilities.forceClasspathReload(nestedProject); - // } catch (JavaModelException ex) { - // Logger.getLogger().logError(ex); - // } - // } - // } - // // Keep list of Library modules to readd to websettings - // if (!includeProjectMetaFiles) - // getLibModules().add(libModule); - // } - // - // } - - // /** - // * @param object - // */ - // private void executeOperation(IHeadlessRunnableWithProgress op) { - // try { - // op.run(new NullProgressMonitor()); - // } catch (java.lang.reflect.InvocationTargetException e) { - // Logger.getLogger().logError(e); - // } catch (InterruptedException ex) { - // Logger.getLogger().logError(ex); - // } - // } - - // protected IProject saveArchiveAsJavaProject(Archive jarFile) throws SaveFailureException { - // IProject nestedProject = null; - // if (createdProjectsMap == null) - // createdProjectsMap = new HashMap(); - // // Do overwrite protection - // J2EEJavaProjectInfo javaProjectInfo = new J2EEJavaProjectInfo(); - // String projectName = (String) createWLProjectOptions.get(jarFile.getURI()); - // J2EEProjectCreationDataModel model = new J2EEProjectCreationDataModel(); - // model.setProperty(J2EEProjectCreationDataModel.PROJECT_NAME, projectName); - // model.setProperty(J2EEProjectCreationDataModel.CREATE_DEFAULT_FILES, Boolean.FALSE); - // IHeadlessRunnableWithProgress op = new JavaUtilityJARProjectCreationOperation(model); - // nestedProject = model.getProject(); - // createdProjectsMap.put(jarFile.getURI(), nestedProject); - // if (isBinary()) { - // saveBinaryProject(nestedProject, jarFile); - // } else { - // JavaProjectSaveStrategyImpl strat = new JavaProjectSaveStrategyImpl(nestedProject); - // strat.setIncludeProjectMetaFiles(includeProjectMetaFiles); - // strat.setShouldIncludeImportedClasses(true); - // strat.setProgressMonitor(new SubProgressMonitor(progressMonitor, 1)); - // jarFile.save(strat); - // if (includeProjectMetaFiles) { - // try { - // ProjectUtilities.forceClasspathReload(nestedProject); - // } catch (JavaModelException ex) { - // Logger.getLogger().logError(ex); - // } - // } - // } - // return nestedProject; - // } - // protected void saveBinaryProject(IProject aProject, Archive nested) throws - // SaveFailureException { - // saveJARInBinaryProject(aProject, nested); - // if (includeProjectMetaFiles) { - // try { - // ProjectUtilities.forceClasspathReload(aProject); - // } catch (JavaModelException ex) { - // Logger.getLogger().logError(ex); - // } - // // ensureBinary(nested, aProject); - // } - // - // // try { - // // IPath path = aFile.getFullPath(); - // // IClasspathEntry newEntry = JavaCore.newLibraryEntry(path, path, null, true); - // // ProjectUtilities.appendJavaClassPath(aProject, newEntry); - // // } catch (JavaModelException ex) { - // // Logger.getLogger().logError(ex); - // // } - // - // J2EEModuleNature nature = (J2EEModuleNature) J2EENature.getRegisteredRuntime(aProject); - // if (nature != null) - // nature.recomputeBinaryProject(); - // } - - // protected IFile saveJARInBinaryProject(IProject project, Archive nested) throws - // SaveFailureException { - // IFile savedArchive = null; - // try { - // // savedArchive = saveFile(nested, project); - // // Put directly in the root directory, remove the WEB-INF/lib segments - // IPath path = new Path(nested.getURI()); - // path = path.removeFirstSegments(2); - // IFile iFile = project.getFile(path.toString()); - // WorkbenchByteArrayOutputStream out = new WorkbenchByteArrayOutputStream(iFile); - // ArchiveUtil.copy(nested.getInputStream(), out); - // savedArchive = iFile; - // if (includeProjectMetaFiles) { - // saveEnclosedFile(nested, project, CLASSPATH_FILE_URI); - // saveEnclosedFile(nested, project, PROJECT_FILE_URI); - // } - // - // return savedArchive; - // } catch (IOException io) { - // throw new SaveFailureException(archive.getURI(), io); - // } - // } - protected void saveEnclosedFile(Archive anArchive, IProject p, String uri) throws IOException { - try { - File aFile = anArchive.getFile(uri); - saveFile(aFile, p); - } catch (FileNotFoundException ignore) { - //Ignore - } - } - - protected IFile saveFile(File aFile, IProject p) throws IOException { - IFile iFile = p.getFile(aFile.getURI()); - WorkbenchByteArrayOutputStream out = new WorkbenchByteArrayOutputStream(iFile); - ArchiveUtil.copy(aFile.getInputStream(), out); - return iFile; - } - - // protected boolean shouldSaveWLProject(ILibModule libModule) { - // IProject wlProject = libModule.getProject(); - // // Do overwrite protection - // if (wlProject != null && wlProject.exists()) { - // if (overwriteHandler != null) { - // return (overwriteHandler.shouldOverwriteWLProject(wlProject, libModule.getProjectName())); - // } - // } - // return true; - // } - - // protected void initializeLibModules() { - // // Get the existing lib modules from the web nature - // ILibModule[] libModulesAry = getWebNature().getLibModules(); - // libModules = new Vector(libModulesAry.length); - // for (int i = 0; i < libModulesAry.length; i++) { - // libModules.add(libModulesAry[i]); - // } - // } - - // protected List getLibModules() { - // if (libModules == null) - // initializeLibModules(); - // return libModules; - // } - - // public void setNestedWAR(boolean isNested) { - // this.isNestedWAR = isNested; - // } - // public boolean isNestedWAR() { - // return isNestedWAR; - // } - - public void setDataModel(WebModuleImportDataModel model) { - this.dataModel = model; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectStrategyUtils.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectStrategyUtils.java deleted file mode 100644 index 9f4a42b77..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectStrategyUtils.java +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - - - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.File; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants; -import org.eclipse.jst.j2ee.internal.J2EEConstants; - - -public class WTProjectStrategyUtils { - public static File findSourceFile(Archive archive, String file) { - if (isClassFile(file)) - return findSourceFileForClass(archive, file); - - // Look in the CLASSES directory - try { - if (!isOutputFile(file)) - return archive.getFile(file); - } catch (java.io.FileNotFoundException ex) { - //Do nothing - } - return null; - } - - public static File findSourceFileForClass(Archive archive, String classFile) { - // Look in the CLASSES directory - IPath classFilePath = new Path(classFile); - IPath sourceFilePath = classFilePath.removeFileExtension().addFileExtension("java");//$NON-NLS-1$ - try { - File file = archive.getFile(sourceFilePath.toString()); - if (file != null) - return file; - } catch (java.io.FileNotFoundException ex) { - //Do nothing - } - - // Look in the LIB directory - sourceFilePath = new Path(ArchiveConstants.WEBAPP_LIB_URI).append(sourceFilePath); - try { - File file = archive.getFile(sourceFilePath.toString()); - if (file != null) - return file; - } catch (java.io.FileNotFoundException ex) { - //Do nothing - } - return null; - - } - - public static boolean isClassFile(String uri) { - return uri.startsWith(ArchiveConstants.WEBAPP_CLASSES_URI) && uri.endsWith(".class");//$NON-NLS-1$ - } - - public static boolean isOutputFile(String uri) { - return uri.startsWith(ArchiveConstants.WEBAPP_CLASSES_URI); - } - - public static boolean isSourceFile(String uri) { - // A file is considered a java source file if it is in the - // WEB_INF directory and it does not end with .class. - if (uri.startsWith(J2EEConstants.WEB_INF + "/") && //$NON-NLS-1$ - uri.endsWith(".java"))//$NON-NLS-1$ - return true; - return false; - - } - - public static String makeRelative(String pathString, String relToPathString) { - IPath relToPath = new Path(relToPathString); - IPath path = new Path(pathString); - - if (path.matchingFirstSegments(relToPath) == relToPath.segmentCount()) - path = path.removeFirstSegments(relToPath.segmentCount()); - - return path.toString(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebComponentCreationDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebComponentCreationDataModel.java deleted file mode 100644 index faafdca27..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebComponentCreationDataModel.java +++ /dev/null @@ -1,325 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.archive.operations; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.AddWebModuleToEARDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent; -import org.eclipse.wst.common.frameworks.internal.operations.WTPPropertyDescriptor; - -/** - * This dataModel is used for to create Web Modules. - * - * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as - * the new project structures are adopted. Use at your own risk. - * - * @since WTP 1.0 - */ -public class WebComponentCreationDataModel extends J2EEComponentCreationDataModel { - - /** - * Type Integer - */ - public static final String SERVLET_VERSION = "WebModuleCreationDataModel.SERVLET_VERSION"; //$NON-NLS-1$ - /** - * Type Integer - */ - public static final String JSP_VERSION = "WebModuleCreationDataModel.JSP_VERSION"; //$NON-NLS-1$ - /** - * Type String - */ - public static final String CONTEXT_ROOT = AddWebModuleToEARDataModel.CONTEXT_ROOT; - - - - - public WTPOperation getDefaultOperation() { - return new WebComponentCreationOperation(this); - } - - /** - * @return Returns the default J2EE spec level based on the Global J2EE Preference - */ - protected Integer getDefaultComponentVersion() { - int highestJ2EEPref = J2EEPlugin.getDefault().getJ2EEPreferences().getHighestJ2EEVersionID(); - switch (highestJ2EEPref) { - case (J2EEVersionConstants.J2EE_1_4_ID) : - return new Integer(J2EEVersionConstants.WEB_2_4_ID); - case (J2EEVersionConstants.J2EE_1_3_ID) : - return new Integer(J2EEVersionConstants.WEB_2_3_ID); - case (J2EEVersionConstants.J2EE_1_2_ID) : - return new Integer(J2EEVersionConstants.WEB_2_2_ID); - default : - return new Integer(J2EEVersionConstants.WEB_2_4_ID); - } - } - - - protected void init() { - //setJ2EENatureID(IWebNatureConstants.J2EE_NATURE_ID); - //setProperty(EDIT_MODEL_ID, IWebNatureConstants.EDIT_MODEL_ID); -// getProjectDataModel().setProperty(ProjectCreationDataModel.PROJECT_NATURES, new String[]{IModuleConstants.MODULE_NATURE_ID}); -// getJavaProjectCreationDataModel().setProperty(JavaProjectCreationDataModel.SOURCE_FOLDERS, new String[]{getDefaultJavaSourceFolderName()}); - updateOutputLocation(); - super.init(); - } - - - - protected boolean doSetProperty(String propertyName, Object propertyValue) { - boolean retVal = super.doSetProperty(propertyName, propertyValue); - if (propertyName.equals(USE_ANNOTATIONS)) { - notifyEnablementChange(COMPONENT_VERSION); - } else if (propertyName.equals(COMPONENT_VERSION)) { - if (getJ2EEVersion() < J2EEVersionConstants.VERSION_1_3) - setProperty(USE_ANNOTATIONS, Boolean.FALSE); - notifyEnablementChange(USE_ANNOTATIONS); - } else if (propertyName.equals(CONTEXT_ROOT)) { - getAddModuleToApplicationDataModel().setProperty(AddWebModuleToEARDataModel.CONTEXT_ROOT, propertyValue); - } else if (propertyName.equals(COMPONENT_NAME)) { - if (!isSet(CONTEXT_ROOT)) { - notifyDefaultChange(CONTEXT_ROOT); - ((AddWebModuleToEARDataModel) getAddModuleToApplicationDataModel()).defaultContextRoot=(String)propertyValue; - getAddModuleToApplicationDataModel().notifyDefaultChange(AddWebModuleToEARDataModel.CONTEXT_ROOT); - } - } - return retVal; - } - - private void updateOutputLocation() { -// getJavaProjectCreationDataModel().setProperty(JavaProjectCreationDataModel.OUTPUT_LOCATION, getOutputLocation()); - } - -// private Object getOutputLocation() { -// StringBuffer buf = new StringBuffer(getStringProperty(WEB_CONTENT)); -// buf.append(IPath.SEPARATOR); -// buf.append(IWebNatureConstants.INFO_DIRECTORY); -// buf.append(IPath.SEPARATOR); -// buf.append(IWebNatureConstants.CLASSES_DIRECTORY); -// return buf.toString(); -// } - - protected void initValidBaseProperties() { - super.initValidBaseProperties(); - addValidBaseProperty(SERVLET_VERSION); - addValidBaseProperty(JSP_VERSION); - addValidBaseProperty(USE_ANNOTATIONS); - addValidBaseProperty(CONTEXT_ROOT); - } - - protected AddComponentToEnterpriseApplicationDataModel createModuleNestedModel() { - return new AddWebModuleToEARDataModel(); - } - - private Object updateAddToEar() { - //IRuntime type = getServerTargetDataModel().getRuntimeTarget(); -// Boolean ret = Boolean.FALSE; -// IRuntime type = getProjectDataModel().getServerTargetDataModel().getRuntimeTarget(); -// if (type == null) -// return Boolean.TRUE; -// IRuntimeType rType = type.getRuntimeType(); -// if (rType == null) -// return Boolean.TRUE; -// return ret; - //return new Boolean(!rType.getVendor().equals(APACHE_VENDER_NAME)); - return null; - } - - protected Object getDefaultProperty(String propertyName) { - - - if (propertyName.equals(ADD_TO_EAR)) { - return updateAddToEar(); - - } - -// if (propertyName.equals(WEB_CONTENT)) { -// String webContentFolderPref = J2EEPlugin.getDefault().getJ2EEPreferences().getJ2EEWebContentFolderName(); -// if (webContentFolderPref == null || webContentFolderPref.length() == 0) -// webContentFolderPref = IWebNatureConstants.WEB_MODULE_DIRECTORY_; -// return webContentFolderPref; -// } - if (propertyName.equals(CONTEXT_ROOT)) { - return getProperty(COMPONENT_NAME); - } - - if (propertyName.equals(SERVLET_VERSION)) { - int moduleVersion = getIntProperty(COMPONENT_VERSION); - int servletVersion = J2EEVersionConstants.SERVLET_2_2; - switch (moduleVersion) { - case J2EEVersionConstants.WEB_2_2_ID : - servletVersion = J2EEVersionConstants.SERVLET_2_2; - break; - case J2EEVersionConstants.WEB_2_3_ID : - case J2EEVersionConstants.WEB_2_4_ID : - servletVersion = J2EEVersionConstants.SERVLET_2_3; - break; - } - return new Integer(servletVersion); - } - if (propertyName.equals(JSP_VERSION)) { - int moduleVersion = getIntProperty(COMPONENT_VERSION); - int jspVersion = J2EEVersionConstants.JSP_1_2_ID; - switch (moduleVersion) { - case J2EEVersionConstants.WEB_2_2_ID : - jspVersion = J2EEVersionConstants.JSP_1_2_ID; - break; - case J2EEVersionConstants.WEB_2_3_ID : - case J2EEVersionConstants.WEB_2_4_ID : - jspVersion = J2EEVersionConstants.JSP_2_0_ID; - break; - } - return new Integer(jspVersion); - } - if (propertyName.equals(DD_FOLDER)) { - return IPath.SEPARATOR + this.getModuleName()+IPath.SEPARATOR + "WebContent"+IPath.SEPARATOR + J2EEConstants.WEB_INF; - } - if (propertyName.equals(J2EEComponentCreationDataModel.JAVASOURCE_FOLDER)) { - return IPath.SEPARATOR + this.getModuleName()+IPath.SEPARATOR + "JavaSource"; - } - if (propertyName.equals(MANIFEST_FOLDER)) { - return IPath.SEPARATOR + this.getModuleName()+IPath.SEPARATOR + "WebContent"+IPath.SEPARATOR + J2EEConstants.META_INF; - } - return super.getDefaultProperty(propertyName); - } - - protected WTPPropertyDescriptor doGetPropertyDescriptor(String propertyName) { - if (propertyName.equals(COMPONENT_VERSION)) { - Integer propertyValue = (Integer) getProperty(propertyName); - String description = null; - switch (propertyValue.intValue()) { - case J2EEVersionConstants.WEB_2_2_ID : - description = J2EEVersionConstants.VERSION_2_2_TEXT; - break; - case J2EEVersionConstants.WEB_2_3_ID : - description = J2EEVersionConstants.VERSION_2_3_TEXT; - break; - case J2EEVersionConstants.WEB_2_4_ID : - default : - description = J2EEVersionConstants.VERSION_2_4_TEXT; - break; - } - return new WTPPropertyDescriptor(propertyValue, description); - } - return super.doGetPropertyDescriptor(propertyName); - } - - protected WTPPropertyDescriptor[] getValidComponentVersionDescriptors() { - int highestJ2EEPref = J2EEPlugin.getDefault().getJ2EEPreferences().getHighestJ2EEVersionID(); - WTPPropertyDescriptor[] descriptors = null; - switch (highestJ2EEPref) { - case J2EEVersionConstants.J2EE_1_2_ID : - descriptors = new WTPPropertyDescriptor[1]; - descriptors[0] = new WTPPropertyDescriptor(new Integer(J2EEVersionConstants.WEB_2_2_ID), J2EEVersionConstants.VERSION_2_2_TEXT); - break; - case J2EEVersionConstants.J2EE_1_3_ID : - descriptors = new WTPPropertyDescriptor[2]; - descriptors[0] = new WTPPropertyDescriptor(new Integer(J2EEVersionConstants.WEB_2_2_ID), J2EEVersionConstants.VERSION_2_2_TEXT); - descriptors[1] = new WTPPropertyDescriptor(new Integer(J2EEVersionConstants.WEB_2_3_ID), J2EEVersionConstants.VERSION_2_3_TEXT); - break; - case J2EEVersionConstants.J2EE_1_4_ID : - default : - descriptors = new WTPPropertyDescriptor[3]; - descriptors[0] = new WTPPropertyDescriptor(new Integer(J2EEVersionConstants.WEB_2_2_ID), J2EEVersionConstants.VERSION_2_2_TEXT); - descriptors[1] = new WTPPropertyDescriptor(new Integer(J2EEVersionConstants.WEB_2_3_ID), J2EEVersionConstants.VERSION_2_3_TEXT); - descriptors[2] = new WTPPropertyDescriptor(new Integer(J2EEVersionConstants.WEB_2_4_ID), J2EEVersionConstants.VERSION_2_4_TEXT); - break; - } - return descriptors; - } - - protected int convertModuleVersionToJ2EEVersion(int moduleVersion) { - switch (moduleVersion) { - case J2EEVersionConstants.WEB_2_2_ID : - return J2EEVersionConstants.J2EE_1_2_ID; - case J2EEVersionConstants.WEB_2_3_ID : - return J2EEVersionConstants.J2EE_1_3_ID; - case J2EEVersionConstants.WEB_2_4_ID : - return J2EEVersionConstants.J2EE_1_4_ID; - } - return -1; - } - - protected Integer convertJ2EEVersionToModuleVersion(Integer j2eeVersion) { - switch (j2eeVersion.intValue()) { - case J2EEVersionConstants.J2EE_1_2_ID : - return new Integer(J2EEVersionConstants.WEB_2_2_ID); - case J2EEVersionConstants.J2EE_1_3_ID : - return new Integer(J2EEVersionConstants.WEB_2_3_ID); - case J2EEVersionConstants.J2EE_1_4_ID : - return new Integer(J2EEVersionConstants.WEB_2_4_ID); - } - return super.convertJ2EEVersionToModuleVersion(j2eeVersion); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.application.operations.J2EEModuleCreationDataModel#getModuleType() - */ - protected EClass getComponentType() { - return CommonarchiveFactoryImpl.getPackage().getWARFile(); - } - - protected String getComponentExtension() { - return ".war"; //$NON-NLS-1$ - } - - protected Boolean basicIsEnabled(String propertyName) { - if (USE_ANNOTATIONS.equals(propertyName)) { - if (getJ2EEVersion() < J2EEVersionConstants.VERSION_1_3) - return Boolean.FALSE; - return Boolean.TRUE; - } - return super.basicIsEnabled(propertyName); - } - - protected IStatus doValidateProperty(String propertyName) { - if (propertyName.equals(CONTEXT_ROOT)) { - if (getBooleanProperty(ADD_TO_EAR)) { - return getAddModuleToApplicationDataModel().validateProperty(AddWebModuleToEARDataModel.CONTEXT_ROOT); - } - return OK_STATUS; - - } - return super.doValidateProperty(propertyName); - } - - public void propertyChanged(WTPOperationDataModelEvent event) { - super.propertyChanged(event); - if (event.getDataModel() == getAddModuleToApplicationDataModel() && event.getPropertyName().equals(AddWebModuleToEARDataModel.CONTEXT_ROOT) && event.getDataModel().isSet(AddWebModuleToEARDataModel.CONTEXT_ROOT)) { - setProperty(CONTEXT_ROOT, event.getProperty()); - } //else if (event.getDataModel() == getServerTargetDataModel() && event.getPropertyName().equals(ServerTargetDataModel.RUNTIME_TARGET_ID) && event.getDataModel().isSet(ServerTargetDataModel.RUNTIME_TARGET_ID)) - //setProperty(ADD_TO_EAR, updateAddToEar()); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.application.operations.FlexibleJ2EECreationDataModel#getModuleID() - */ - protected String getComponentID() { - return IModuleConstants.JST_WEB_MODULE; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebComponentCreationOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebComponentCreationOperation.java deleted file mode 100644 index 88eb2c0b3..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebComponentCreationOperation.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Nov 6, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.archive.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationOperation; -import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientComponentCreationDataModel; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionUtil; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory; -import org.eclipse.wst.common.componentcore.internal.Property; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; - -public class WebComponentCreationOperation extends J2EEComponentCreationOperation { - public WebComponentCreationOperation(WebComponentCreationDataModel dataModel) { - super(dataModel); - } - - public WebComponentCreationOperation() { - super(); - } /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.application.operations.J2EEComponentCreationOperation#createAndLinkJ2EEComponents() - */ - protected void createAndLinkJ2EEComponents() throws CoreException { - IVirtualComponent component = ComponentCore.createComponent(getProject(), getModuleDeployName()); - component.create(0, null); - //create and link javaSource Source Folder - IVirtualFolder javaSourceFolder = component.getFolder(new Path("/" + J2EEConstants.WEB_INF + "/classes")); //$NON-NLS-1$ - javaSourceFolder.createLink(new Path("/" + getModuleName() + "/JavaSource"), 0, null); - - //create and link META-INF and WEB-INF folder - IVirtualFolder webContent = component.getFolder(new Path("/")); //$NON-NLS-1$ - webContent.createLink(new Path("/" + getModuleName() + "/" + "WebContent" ), 0, null); - - IVirtualFolder webInfFolder = webContent.getFolder(J2EEConstants.WEB_INF); - webInfFolder.create(IResource.FORCE, null); - - IVirtualFolder metaInfFolder = webContent.getFolder(J2EEConstants.META_INF); - metaInfFolder.create(IResource.FORCE,null); - - IVirtualFolder webLib = webInfFolder.getFolder("lib"); - webLib.create(IResource.FORCE, null); - //webLib.create(); - } - - protected void createDeploymentDescriptor(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - - //should cache wbmodule when created instead of searching ? - StructureEdit moduleCore = null; - WorkbenchComponent wbmodule = null; - try { - moduleCore = StructureEdit.getStructureEditForRead(getProject()); - wbmodule = moduleCore.findComponentByName(operationDataModel.getStringProperty(WebComponentCreationDataModel.COMPONENT_DEPLOY_NAME)); - } finally { - if (null != moduleCore) { - moduleCore.dispose(); - } - } - - WebArtifactEdit webEdit = null; - try{ - webEdit = WebArtifactEdit.getWebArtifactEditForWrite(wbmodule); - Integer version = (Integer)operationDataModel.getProperty(WebComponentCreationDataModel.COMPONENT_VERSION); - webEdit.createModelRoot(version.intValue()); - webEdit.save(monitor); - } - catch(Exception e){ - Logger.getLogger().logError(e); - } finally { - if(webEdit != null) - webEdit.dispose(); - webEdit = null; - } - } - - protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - super.execute( IModuleConstants.JST_WEB_MODULE, monitor ); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.j2ee.application.operations.J2EEComponentCreationOperation#getVersion() - */ - protected String getVersion() { - int version = operationDataModel.getIntProperty(J2EEComponentCreationDataModel.COMPONENT_VERSION); - return J2EEVersionUtil.getServletTextVersion(version); - - } - protected List getProperties() { - List newProps = new ArrayList(); - Property prop = ComponentcoreFactory.eINSTANCE.createProperty(); - prop.setName(J2EEConstants.CONTEXTROOT); - prop.setValue(operationDataModel.getStringProperty(WebComponentCreationDataModel.CONTEXT_ROOT)); - newProps.add(prop); - return newProps; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebContentNameUpdateOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebContentNameUpdateOperation.java deleted file mode 100644 index c3bebd849..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebContentNameUpdateOperation.java +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; - - -public class WebContentNameUpdateOperation implements IHeadlessRunnableWithProgress { - - public String fWebContentName; - public IProject fProject; - - - public WebContentNameUpdateOperation(IProject project, String webContentName) { - super(); - fProject = project; - fWebContentName = webContentName; - } - - - /** - * Runs this operation without forcing a UI dependency. - * - * @param monitor - * the progress monitor to use to display progress and receive requests for - * cancelation - * @exception InvocationTargetException - * if the run method must propagate a checked exception, it should wrap it inside - * an <code>InvocationTargetException</code>; runtime exceptions are - * automatically wrapped in an <code>InvocationTargetException</code> by the - * calling context - * @exception InterruptedException - * if the operation detects a request to cancel, using - * <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing - * <code>InterruptedException</code> - * - * @see IRunnableWithProgress - */ - public void run(org.eclipse.core.runtime.IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - - try { - WebPropertiesUtil.updateWebContentNameAndProperties(fProject, fWebContentName, monitor); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleExportDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleExportDataModel.java deleted file mode 100644 index d3024b2f9..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleExportDataModel.java +++ /dev/null @@ -1,107 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEModuleExportDataModel; -import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; - -/** - * This dataModel is used to export Web Modules to WAR files. - * - * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as - * the new project structures are adopted. Use at your own risk. - * - * @since WTP 1.0 - */ -public final class WebModuleExportDataModel extends J2EEModuleExportDataModel { - - /** - * Exports the specified Web Module project to the specified WAR file. - * - * @param webProjectName - * The name of the Web Module project to export. - * @param warFileName - * The fully qualified WAR file location to export the specified Web Module project. - * @param overwriteExisting - * If this is <code>true</code> then an existing file at the location specified by - * <code>earFileName</code> will be overwritten. - * @param exportSource - * If this is <code>true</code> then all source files in the specified Web Module - * will be included in the resulting WAR file. - * @since WTP 1.0 - */ - public static void exportProject(String webProjectName, String warFileName, boolean overwriteExisting, boolean exportSource) { - WebModuleExportDataModel dataModel = new WebModuleExportDataModel(); - dataModel.setProperty(PROJECT_NAME, webProjectName); - dataModel.setBooleanProperty(OVERWRITE_EXISTING, overwriteExisting); - dataModel.setProperty(ARCHIVE_DESTINATION, warFileName); - dataModel.setBooleanProperty(EXPORT_SOURCE_FILES, exportSource); - try { - dataModel.getDefaultOperation().run(null); - } catch (InvocationTargetException e) { - Logger.getLogger().logError(e); - } catch (InterruptedException e) { - Logger.getLogger().logError(e); - } - } - - public WTPOperation getDefaultOperation() { - return new WebModuleExportOperation(this); - } - - /** - * Required, type Boolean flag which indicates whether or not to export compiled JSP files - * (compiled files exist in /WEB-INF/classes as .class and .java[for debug]) - */ - public static final String EXCLUDE_COMPILE_JSP = "WebExportDataModel.EXCLUDE_COMPILE_JSP"; //$NON-NLS-1$ - - protected void init() { - super.init(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.internal.emfworkbench.operation.EditModelOperationDataModel#initValidBaseProperties() - */ - protected void initValidBaseProperties() { - addValidBaseProperty(EXCLUDE_COMPILE_JSP); - super.initValidBaseProperties(); - } - - protected Object getDefaultProperty(String propertyName) { - if (EXCLUDE_COMPILE_JSP.equals(propertyName)) { - return Boolean.FALSE; - } - return super.getDefaultProperty(propertyName); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.application.operations.J2EEExportDataModel#getModuleExtension() - */ - protected String getModuleExtension() { - return ".war"; //$NON-NLS-1$ - } - - protected String getWrongProjectTypeString(String projectName) { - return EARCreationResourceHandler.getString(EARCreationResourceHandler.NOT_A_WAR, new Object[]{projectName}); - } - - protected String getNatureID() { - return IWebNatureConstants.J2EE_NATURE_ID; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleExportOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleExportOperation.java deleted file mode 100644 index 93a5ab9b5..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleExportOperation.java +++ /dev/null @@ -1,233 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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 - **************************************************************************************************/ -/* - * Created on Dec 16, 2003 - * - * To change the template for this generated file go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.archive.operations; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEArtifactExportDataModel; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchivePackage; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException; -import org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactExportOperation; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.web.internal.operation.ILibModule; - - -public final class WebModuleExportOperation extends J2EEArtifactExportOperation { - /** - * flag which indicates whether nested projects should be incrementally built as part of export - */ - protected boolean buildIncremental = true; - - /** - * @param model - */ - public WebModuleExportOperation(J2EEArtifactExportDataModel model) { - super(model); - // TODO Auto-generated constructor stub - } - - protected String archiveString() { - return "War File";//$NON-NLS-1$ - } - - /** - * Insert the method's description here. Creation date: (1/9/2001 11:47:44 AM) - * - * @exception java.lang.Exception - * The exception description. - */ - public void createModuleFile() throws SaveFailureException { - - try { - CommonarchiveFactory caf = ((CommonarchivePackage) EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory(); - WTProjectLoadStrategyImpl ls = new WTProjectLoadStrategyImpl(project); - moduleFile = caf.openWARFile(ls, getDestinationPath().toOSString()); - // moduleFile.setSaveFilter(getFilter()); - if (isExportSource()) - ls.setExportSource(true); - if (((WebModuleExportDataModel) operationDataModel).getBooleanProperty(WebModuleExportDataModel.EXCLUDE_COMPILE_JSP)) - ls.setExcludeCompiledJspFiles(true); - } catch (Exception e) { - throw new SaveFailureException(e); - } - } - - public void export() throws SaveFailureException { - - try { - // Defect 227051 - buildProjectsIfNecessary(getProgressMonitor()); - - exportWarProject(); - } catch (SaveFailureException ex) { - throw ex; - } catch (Exception e) { - throw new SaveFailureException(e.getMessage(), e);//$NON-NLS-1$ - } - - } - - protected void exportWarProject() throws SaveFailureException { - try { - createModuleFile(); - getWarFile().saveAsNoReopen(getDestinationPath().toOSString()); - } catch (SaveFailureException ex) { - throw ex; - } catch (Exception e) { - throw new SaveFailureException(e.getMessage(), e);//$NON-NLS-1$ - } - - } - - /** - * Creates a class loader to be used by the 1.0 dd generator for reflecting java fields; - * - * @return an instance of URLClassLoader with the class path of the current project - */ - public ClassLoader getAlternateClassLoader() { - IPath wbPath = Platform.getLocation(); - IJavaProject p = getJavaProject(); - IClasspathEntry[] cp = null; - try { - cp = p.getRawClasspath(); - } catch (Exception ex) { - //Real hack for now; On the very first try, it bombs - //On subsequent tries, it works - try { - cp = p.getRawClasspath(); - } catch (JavaModelException ex2) { - //Okay; something is really wrong - //TODO - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - } - } - List paths = new ArrayList(); - try { - paths.add(getJavaProject().getOutputLocation().addTrailingSeparator()); - } catch (JavaModelException ex) { - //TODO - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - } - for (int i = 0; i < cp.length; i++) { - if (cp[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) { - continue; - } - paths.add(cp[i].getPath()); - } - java.net.URL[] pathUrls = new java.net.URL[paths.size()]; - for (int i = 0; i < paths.size(); i++) { - IPath path = (IPath) paths.get(i); - if (path.getDevice() == null) { - path = wbPath.append(path); - } - try { - pathUrls[i] = new java.net.URL("file:///" + path.toString());//$NON-NLS-1$ - } catch (java.net.MalformedURLException ex) { - //TODO - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex); - } - } - java.net.URLClassLoader parent = null; // - // URL entries can be jar or directory. - // this will use the system class loader as the parent - // parent - null = bootstrap class loader. - java.net.URLClassLoader cl = new java.net.URLClassLoader(pathUrls, parent); - return cl; - } - - public WARFile getWarFile() { - return (WARFile) moduleFile; - - } - - protected void buildProjectsIfNecessary(IProgressMonitor monitor) throws CoreException { - if (!buildIncremental || !operationDataModel.getBooleanProperty(J2EEArtifactExportDataModel.RUN_BUILD)) { - return; - } - SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1); - try { - Set projectsToBuild = new HashSet(); - ILibModule[] libModules = getLibModules(); - for (int i = 0; i < libModules.length; i++) { - projectsToBuild.add(libModules[i].getProject()); - } - - List inOrderProjects = getProjectsInOrder(projectsToBuild); - subMonitor.beginTask("", inOrderProjects.size());//$NON-NLS-1$ - //defect 240999 - project.refreshLocal(IResource.DEPTH_INFINITE, null); - javac(project, monitor); - for (int i = 0; i < inOrderProjects.size(); i++) { - IProject moduleProject = (IProject) inOrderProjects.get(i); - if (moduleProject.isAccessible()) { - //defect 240999 - project.refreshLocal(IResource.DEPTH_INFINITE, null); - javac(project, monitor); - } - } - } finally { - subMonitor.done(); - } - } - - protected ILibModule[] getLibModules() { - //TODO this will throw class cast exception, do we still use ILibModule? - WebArtifactEdit webArtifactEdit = null; - try { - webArtifactEdit = (WebArtifactEdit)StructureEdit.getFirstArtifactEditForRead(project); - if (webArtifactEdit!=null) - return (ILibModule[]) webArtifactEdit.getLibModules(); - } finally { - if (webArtifactEdit!=null) - webArtifactEdit.dispose(); - } - return new ILibModule[] {}; - } - - private List getProjectsInOrder(Set projectsToBuild) { - List result = new ArrayList(); - IProject[] projects = (IProject[]) projectsToBuild.toArray(new IProject[projectsToBuild.size()]); - - IWorkspace.ProjectOrder projectOrder = ResourcesPlugin.getWorkspace().computeProjectOrder(projects); - result.addAll(Arrays.asList(projectOrder.projects)); - if (projectOrder.hasCycles) { - for (int i = 0; i < projectOrder.knots.length; i++) { - result.addAll(Arrays.asList(projectOrder.knots[i])); - } - } - return result; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleImportDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleImportDataModel.java deleted file mode 100644 index f33527d77..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleImportDataModel.java +++ /dev/null @@ -1,193 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.archive.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEArtifactImportDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEModuleImportDataModel; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.CommonarchiveFactory; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; - -/** - * This dataModel is used for to import Web Modules (from WAR files) into the workspace. - * - * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as - * the new project structures are adopted. Use at your own risk. - * - * @since WTP 1.0 - */ -public final class WebModuleImportDataModel extends J2EEModuleImportDataModel { - //do not modify this property constant - public static final String HANDLED_ARCHIVES = "WARImportDataModel.HANDLED_ARCHIVES"; //$NON-NLS-1$ - - /** - * Imports the specified WAR file into the specified Web Module project. - * - * @param warFileName - * The path to the WAR file. - * @param webProjectName - * The name of the Web project where the Web Module should be imported. - * @param addToEar - * If this is <code>true</code> then Web project specified by - * <code>webProjectName</code> will be added to the Enterprise Application project - * specified by <code>earProjectName</code>. - * @param earProjectName - * The name of the Enterprise Application project to add the specified Web project - * to. This field is only relevant if <code>addToEar</code> is set to - * <code>true</code>. If this is set to <code>null</code> then a default name - * computed from the <code>webProjectName</code> will be used. - * @since WTP 1.0 - */ - public static void importArchive(String warFileName, String webProjectName, boolean addToEar, String earProjectName) { - WebModuleImportDataModel dataModel = new WebModuleImportDataModel(); - dataModel.setProperty(FILE_NAME, warFileName); - dataModel.setProperty(PROJECT_NAME, webProjectName); - dataModel.setBooleanProperty(ADD_TO_EAR, addToEar); - if (earProjectName != null) { - dataModel.setProperty(EAR_NAME, earProjectName); - } - try { - dataModel.getDefaultOperation().run(null); - } catch (InvocationTargetException e) { - Logger.getLogger().logError(e); - } catch (InterruptedException e) { - Logger.getLogger().logError(e); - } - } - - protected void initValidBaseProperties() { - super.initValidBaseProperties(); - addValidBaseProperty(HANDLED_ARCHIVES); - } - - protected Object getDefaultProperty(String propertyName) { - if (propertyName.equals(BINARY)) { - return Boolean.FALSE; - } - if (propertyName.equals(HANDLED_ARCHIVES)) { - return Collections.EMPTY_LIST; - } - return super.getDefaultProperty(propertyName); - } - - protected J2EEComponentCreationDataModel createJ2EEProjectCreationDataModel() { - WebComponentCreationDataModel dm = new WebComponentCreationDataModel(); -// dm.setBooleanProperty(J2EEComponentCreationDataModel.ADD_SERVER_TARGET, false); -// dm.setBooleanProperty(WebComponentCreationDataModel.MIGRATE_WEB_SETTINGS, false); - return dm; - } - - protected boolean doSetProperty(String propertyName, Object propertyValue) { - boolean returnVal = super.doSetProperty(propertyName, propertyValue); - if (propertyName.equals(PRESERVE_PROJECT_METADATA) || ((propertyName.equals(FILE) || propertyName.equals(FILE_NAME)) && getBooleanProperty(PRESERVE_PROJECT_METADATA))) { - String webContentName = null; - if (getBooleanProperty(PRESERVE_PROJECT_METADATA)) { - WARFileImpl warFile = (WARFileImpl) getArchiveFile(); - if (null != warFile) { - if (warFile.containsFile(".j2ee")) { //$NON-NLS-1$ - //To do: Needs work here, no web content exists now -// try { -// //webContentName = WebSettings.getWebContentDirectory(warFile.getInputStream(".j2ee")); //$NON-NLS-1$ -// ArtifactEdit artifact = null; -// WebArtifactEdit webEdit = null; -// try{ -// artifact = ModuleCore.getFirstArtifactEditForRead( project ); -// webEdit = ( WebArtifactEdit )artifact; -// if(webEdit != null) { -// -// } -// }catch (Exception e) { -// e.printStackTrace(); -// }finally{ -// if( webEdit != null ) -// webEdit.dispose(); -// } -// -// } catch (FileNotFoundException e) { -// //Do nothing -// } catch (IOException e) { -// //Do nothing -// } - } - } - } - //setProperty(WebComponentCreationDataModel.WEB_CONTENT, webContentName); - } - return returnVal; - } - - - protected int getType() { - return XMLResource.WEB_APP_TYPE; - } - - protected IStatus validateModuleType() { - if (getArchiveFile() instanceof WARFile) - return OK_STATUS; - - //TODO: STRING MOVE - return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString("Temp String for none WARFile")); //$NON-NLS-1$); - } - - protected boolean openArchive(String uri) throws OpenFailureException { - setArchiveFile(CommonarchiveFactory.eINSTANCE.openWARFile(getArchiveOptions(), uri)); - if (getArchiveFile() == null) - return false; - return true; - } - - public WTPOperation getDefaultOperation() { - return new WebModuleImportOperation(this); - } - - public void extractHandled(List newList, boolean addModels) { - List handledList = new ArrayList(); - WARFile warFile = (WARFile) getArchiveFile(); - List libArchives = warFile.getLibArchives(); - J2EEArtifactImportDataModel model = null; - for (int i = newList.size() - 1; i > -1; i--) { - model = (J2EEArtifactImportDataModel) newList.get(i); - if (libArchives.contains(model.getArchiveFile())) { - if (addModels) { - handledList.add(model); - } - newList.remove(model); - } - } - if (addModels) { - setProperty(HANDLED_ARCHIVES, handledList); - } - } - - public boolean handlesArchive(Archive archive) { - List list = (List) getProperty(HANDLED_ARCHIVES); - J2EEArtifactImportDataModel model = null; - for (int i = 0; i < list.size(); i++) { - model = (J2EEArtifactImportDataModel) list.get(i); - if (model.getArchiveFile() == archive) { - return true; - } - } - return false; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleImportOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleImportOperation.java deleted file mode 100644 index 3bd58c319..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WebModuleImportOperation.java +++ /dev/null @@ -1,164 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Dec 5, 2003 - * - * To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.archive.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEArtifactImportDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModel; -import org.eclipse.jst.j2ee.application.internal.operations.J2EEUtilityJarImportDataModel; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.SaveStrategy; -import org.eclipse.jst.j2ee.internal.archive.operations.BinaryProjectHelper; -import org.eclipse.jst.j2ee.internal.archive.operations.J2EEArtifactImportOperation; -import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.componentcore.internal.ReferencedComponent; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.web.internal.operation.ILibModule; -import org.eclipse.wst.web.internal.operation.LibModule; - -public class WebModuleImportOperation extends J2EEArtifactImportOperation { - /** - * @param model - */ - public WebModuleImportOperation(WebModuleImportDataModel model) { - super(model); - } - - /* - * (non-Javadoc) - * - * @see com.ibm.etools.archive.j2ee.operations.J2EEImportOperationNEW#createModuleProject(org.eclipse.jst.j2ee.internal.internal.application.operations.J2EEProjectCreationDataModel, - * org.eclipse.core.runtime.IProgressMonitor) - */ - protected void createModuleProject(J2EEComponentCreationDataModel model, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - WebComponentCreationOperation op = new WebComponentCreationOperation((WebComponentCreationDataModel) model); - op.run(monitor); - } - - protected void modifyStrategy(SaveStrategy saveStrat) { - WTProjectSaveStrategyImpl strategy = (WTProjectSaveStrategyImpl) saveStrat; - if (null != strategy.getOverwriteHandler()) { - strategy.getOverwriteHandler().setWarSaveStrategy(strategy); - } - } - - /* - * (non-Javadoc) - * - * @see com.ibm.etools.archive.j2ee.operations.J2EEImportOperationNEW#createSaveStrategy(org.eclipse.core.resources.IProject) - */ - protected SaveStrategy createSaveStrategy(IProject project) { - WTProjectSaveStrategyImpl saveStrat = new WTProjectSaveStrategyImpl(project); - saveStrat.setDataModel((WebModuleImportDataModel) operationDataModel); - return saveStrat; - } - - protected void doExecute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { - super.doExecute(monitor); - WebModuleImportDataModel model = (WebModuleImportDataModel) operationDataModel; - if (!model.getBooleanProperty(J2EEArtifactImportDataModel.PRESERVE_PROJECT_METADATA)) { - IFolder folder = WebPropertiesUtil.getWebLibFolder(model.getProject()); - if (!folder.exists()) { - folder.create(true, true, new NullProgressMonitor()); - } - } - - addExtraClasspathEntries(monitor, model); - IProject project = model.getProject(); - if (model.getBooleanProperty(J2EEArtifactImportDataModel.PRESERVE_PROJECT_METADATA)) { - BinaryProjectHelper.removeImportedClassesFromClasspathIfNecessary(project); - } - //J2EEWebNatureRuntime webNature = J2EEWebNatureRuntime.getRuntime(project); - //webNature.getWebSettings().write(); - //project.getFile(webNature.getWebSettingsPath()).refreshLocal(0, monitor); - //WebSettingsMigrator migrator = new WebSettingsMigrator(); - //migrator.migrate(project); -// if (!model.getJ2eeArtifactCreationDataModel().getBooleanProperty(J2EEComponentCreationDataModel.ADD_SERVER_TARGET)) -// addServerTarget(monitor); - } - - private void addExtraClasspathEntries(IProgressMonitor monitor, WebModuleImportDataModel model) throws InvocationTargetException, InterruptedException, CoreException, JavaModelException { - boolean preserveMetadata = model.getBooleanProperty(J2EEArtifactImportDataModel.PRESERVE_PROJECT_METADATA); - List extraEntries = null; - IJavaProject javaProject = JavaCore.create(model.getProject()); - if (!preserveMetadata) - extraEntries = new ArrayList(); - importWebLibraryProjects(monitor, extraEntries, javaProject); - - if (!preserveMetadata) { - IResource[] libs = WebPropertiesUtil.getWebLibFolder(model.getProject()).members(); - for (int i = 0; i < libs.length; i++) { - if (!javaProject.isOnClasspath(libs[i])) - extraEntries.add(JavaCore.newLibraryEntry(libs[i].getFullPath(), libs[i].getFullPath(), null)); - } - addToClasspath(model, extraEntries); - } - } - - private void importWebLibraryProjects(IProgressMonitor monitor, List extraEntries, IJavaProject javaProject) throws InvocationTargetException, InterruptedException { - boolean preserveMetadata = operationDataModel.getBooleanProperty(J2EEArtifactImportDataModel.PRESERVE_PROJECT_METADATA); - List libProjects = (List) operationDataModel.getProperty(WebModuleImportDataModel.HANDLED_ARCHIVES); - J2EEUtilityJarImportDataModel importModel = null; - WTPOperation importOperation = null; - ArrayList libModules = new ArrayList(); - for (int i = 0; null != libProjects && i < libProjects.size(); i++) { - importModel = (J2EEUtilityJarImportDataModel) libProjects.get(i); - libModules.add(new LibModule(importModel.getArchiveFile().getName(), importModel.getProject().getName())); - importOperation = importModel.getDefaultOperation(); - importOperation.run(monitor); - if (extraEntries != null) { - if (!javaProject.isOnClasspath(importModel.getProject())) { - if (preserveMetadata) { - extraEntries.add(JavaCore.newLibraryEntry(importModel.getProject().getFullPath(), importModel.getProject().getFullPath(), null)); - } else { - extraEntries.add(JavaCore.newProjectEntry(importModel.getProject().getFullPath())); - } - } - } - } - LibModule[] libModulesArray = new LibModule[libModules.size()]; - for (int i = 0; i < libModules.size(); i++) { - libModulesArray[i] = (LibModule) libModules.get(i); - } - setLibModules(javaProject.getProject(),libModulesArray); - } - - protected void setLibModules(IProject project, ILibModule[] modules) { - //TODO this will throw class cast exception, do we still use ILibModule? - WebArtifactEdit webArtifactEdit = null; - try { - webArtifactEdit = (WebArtifactEdit)StructureEdit.getFirstArtifactEditForRead(project); - if (webArtifactEdit!=null) - webArtifactEdit.addLibModules((ReferencedComponent[])modules); - } finally { - if (webArtifactEdit!=null) - webArtifactEdit.dispose(); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ClasspathUtilities.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ClasspathUtilities.java deleted file mode 100644 index af7511043..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ClasspathUtilities.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.internal.core.ClasspathEntry; - -public class ClasspathUtilities { - - static public IClasspathEntry[] addClasspathEntries(IClasspathEntry[] entries1, IClasspathEntry[] entries2) { - List list = new ArrayList(entries1.length + entries2.length); - list.addAll(Arrays.asList(entries1)); - - for (int i = 0; i < entries2.length; i++) { - IClasspathEntry iClasspathEntry = entries2[i]; - if (!list.contains(iClasspathEntry)) - list.add(iClasspathEntry); - } - - ClasspathEntry[] ret = new ClasspathEntry[list.size()]; - return (IClasspathEntry[]) list.toArray(ret); - } - - static protected boolean entryExists(IClasspathEntry entry, IClasspathEntry[] col) { - for (int i = 0; i < col.length; i++) { - IClasspathEntry otherEntry = col[i]; - if (entry.getContentKind() != otherEntry.getContentKind()) - continue; - - if (entry.getEntryKind() != otherEntry.getEntryKind()) - continue; - - if (entry.isExported() != otherEntry.isExported()) - continue; - - if (!entry.getPath().equals(otherEntry.getPath())) - continue; - return true; - } - return false; - } - - static public IClasspathEntry[] removeClasspathEntries(IClasspathEntry[] removeFromCol, IClasspathEntry[] removeCol) { - List list = new ArrayList(removeFromCol.length); - // list.addAll(Arrays.asList(removeFromCol)); - - for (int i = 0; i < removeFromCol.length; i++) { - IClasspathEntry iClasspathEntry = removeFromCol[i]; - if (!entryExists(iClasspathEntry, removeCol)) - list.add(iClasspathEntry); - } - - ClasspathEntry[] ret = new ClasspathEntry[list.size()]; - return (IClasspathEntry[]) list.toArray(ret); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ConvertWebProjectDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ConvertWebProjectDataModel.java deleted file mode 100644 index c776c045e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ConvertWebProjectDataModel.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Created on Jun 28, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationDataModel; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentCreationOperation; -import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; -import org.eclipse.wst.common.internal.emfworkbench.operation.EditModelOperationDataModel; - -/** - * @author fatty - * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates - */ -public class ConvertWebProjectDataModel extends WebComponentCreationDataModel -{ - /* - * (non-Javadoc) - * - * @see com.ibm.iwt.webproject.operations.WebProjectCreationDataModel#getDefaultOperation() - */ - public WTPOperation getDefaultOperation() - { - // TODO Auto-generated method stub - return new WebComponentCreationOperation(this); - } - - /* - * (non-Javadoc) - * - * @see com.ibm.etools.application.operations.J2EEModuleCreationDataModel#doValidateProperty(java.lang.String) - */ - protected IStatus doValidateProperty(String propertyName) - { - if( EditModelOperationDataModel.PROJECT_NAME.equals(propertyName) ) - { - return ProjectCreationDataModel.validateProjectName((String) getProperty(PROJECT_NAME)); - } - return super.doValidateProperty(propertyName); - } - - /* (non-Javadoc) - * @see com.ibm.etools.application.operations.J2EEModuleCreationDataModel#initProjectModel() - */ - public void initProjectModel() - { - // use JavaProjectConverstionDataModel instead of JavaProjectCreationDataModel - // to avoid validating project name and location - //TODO Doe this still make sense?? - //setProjectDataModel(new JavaProjectCreationDataModel()); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java deleted file mode 100644 index b7b5adb73..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.wst.web.internal.operation.IStaticWebNature; - - -/** - * Insert the type's description here. Creation date: (10/16/2001 1:40:37 PM) - * - * @author: Administrator - */ -public interface IDynamicWebNature extends IStaticWebNature { - - /** - * Insert the method's description here. Creation date: (10/31/2001 2:26:39 PM) - * - * @return org.eclipse.core.resources.IContainer - */ - IContainer getCSSFolder(); - - - /** - * Insert the method's description here. Creation date: (10/23/2001 2:44:09 PM) - * - * @return com.ibm.iwt.webproject.RelationData - */ - RelationData getRelationData(); - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebProjectWizardInfo.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebProjectWizardInfo.java deleted file mode 100644 index e8de100ce..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebProjectWizardInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import org.eclipse.jdt.core.IClasspathEntry; - -public interface IWebProjectWizardInfo { - /** - * Adds entries to the class path for this project - */ - public void addToClasspathEntries(IClasspathEntry[] entries); - - /** - * Get the name of the specified project Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public String getProjectName(); - - /** - * Get the Enterprise Application Project - */ - public String getEARProjectName(); - - /** - * Get the name of the web content folder. If not set then return the current default. - */ - public String getWebContentName(); - - /** - * Set the name of the web content folder - */ - public void setWebContentName(String name); - - /** - * Get the name of the Java source folder If not set then return the current default. - */ - public String getJavaSourceName(); - - /** - * Set the name of the Java source folder - */ - public void setJavaSourceName(String name); - - /** - * Return an Object for the assocated properties or null - */ - public Object getProperty(String propertyName); - - /** - * Set an Object for the assocated properties or null - */ - public void setProperty(String propertyName, Object value); - - -} - diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebToolingConstants.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebToolingConstants.java deleted file mode 100644 index 9c5053087..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebToolingConstants.java +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - - -/* - * The IConfigurationConstants are the list of tags that are usuable for specifying a web - * application parameters via XML - * - * @see WebApplicationSpecification for the full DTD - */ - -public interface IWebToolingConstants { - - public String TRUE = "true"; //$NON-NLS-1$ - public String FALSE = "false"; //$NON-NLS-1$ - - public String HTTP_PATH_PREFIX = "http://"; //$NON-NLS-1$ - public String INDEX_FILE = "index.html"; //$NON-NLS-1$ - public String HTTP_PARAMETER_SEPARATOR = "?"; //$NON-NLS-1$ - public String CONTENT_LENGTH_HEADER_KEY = "Content-Length"; //$NON-NLS-1$ - - public String SENTENCE_TERMINATOR = "."; //$NON-NLS-1$ - - public String POST_COMMAND = "POST"; //$NON-NLS-1$ - public String GET_COMMAND = "GET"; //$NON-NLS-1$ -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebToolingCoreConstants.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebToolingCoreConstants.java deleted file mode 100644 index 1d9eaaaec..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IWebToolingCoreConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -/** - * The IWebToolingCoreConstants are the constants required by the ITP core - */ -public interface IWebToolingCoreConstants { - public String PLUG_IN_ID = "com.ibm.etools.webtools"; //$NON-NLS-1$ - public String PROP_SERVLET_JAR = "com.ibm.etools.webtools.servletjar"; //$NON-NLS-1$ - public String PROP_WEBAS_JAR = "com.ibm.etools.webtools.webasjar"; //$NON-NLS-1$ - public String PROP_CLIENT_NAME = "com.ibm.etools.webtools.clientname"; //$NON-NLS-1$ - public String PROP_LINK_STYLE = "com.ibm.etools.webtools.linkstyle"; //$NON-NLS-1$ - public String PROP_MODIFY_LINK_PROMPT = "com.ibm.etools.webtools.modifyprompt"; //$NON-NLS-1$ - public String PROP_AUTO_MODIFY_LINK = "com.ibm.etools.webtools.automodify"; //$NON-NLS-1$ - public String JDT_IDENTIFIER = "org.eclipse.jdt.ui"; //$NON-NLS-1$ - public String RUNTIME_IDENTIFIER = "WebNatureRuntime"; //$NON-NLS-1$ - public String DOC_RELATIVE = "DOC_RELATIVE"; //$NON-NLS-1$ - public String DOC_ROOT_RELATIVE = "DOC_ROOT_RELATIVE"; //$NON-NLS-1$ - public String ICON_PATH = "icons"; //$NON-NLS-1$ -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/J2EEWebNatureRuntime.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/J2EEWebNatureRuntime.java deleted file mode 100644 index d724b57cc..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/J2EEWebNatureRuntime.java +++ /dev/null @@ -1,1134 +0,0 @@ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.Map; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.URIConverter; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jem.util.emf.workbench.EMFWorkbenchContextBase; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jem.util.emf.workbench.ProjectResourceSet; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile; -import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException; -import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions; -import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEEditModel; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.application.ApplicationPackage; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.project.J2EEModuleNature; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WTProjectLoadStrategyImpl; -import org.eclipse.jst.j2ee.internal.web.plugin.WebPlugin; -import org.eclipse.jst.j2ee.internal.web.taglib.ITaglibRegistry; -import org.eclipse.jst.j2ee.internal.webservices.WebServiceEditModel; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebAppResource; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.internal.impl.ComponentCoreURIConverter; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel; -import org.eclipse.wst.web.internal.operation.ILibModule; - -/** - * @deprecated - - * Use - * <p> - * WebArtifactEdit - * </p> - */ - -public class J2EEWebNatureRuntime extends J2EEModuleNature implements IDynamicWebNature, IWebNatureConstants { - static protected String PROJECTTYPE_J2EE_VALUE = "J2EE"; //$NON-NLS-1$ - private static final String WEB_PROJECT_12_OVERLAY = "1_2_ovr"; //$NON-NLS-1$ - private static final String WEB_PROJECT_13_OVERLAY = "1_3_ovr"; //$NON-NLS-1$ - private static final String WEB_PROJECT_14_OVERLAY = "1_4_ovr"; //$NON-NLS-1$ - public static final String SERVLETLEVEL_2_2 = "Servlet 2.2"; //$NON-NLS-1$ - public static final String SERVLETLEVEL_2_3 = "Servlet 2.3"; //$NON-NLS-1$ - public static final String SERVLETLEVEL_2_4 = "Servlet 2.4"; //$NON-NLS-1$ - public static final String JSPLEVEL_1_1 = "JSP 1.1"; //$NON-NLS-1$ - public static final String JSPLEVEL_1_2 = "JSP 1.2"; //$NON-NLS-1$ - public static final String JSPLEVEL_2_0 = "JSP 2.0"; //$NON-NLS-1$ - public static final String DEFAULT_JSPLEVEL = JSPLEVEL_1_1; - public static final String DEFAULT_SERVLETLEVEL = SERVLETLEVEL_2_2; - // Version number may not change with every release, - // only when changes necessitate a new version number - public static int CURRENT_VERSION = 600; - /* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE NOTE: - * - * If you add any instance variables, make sure to update the resetWebSettings() method if - * appropriate. - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - public static int instanceCount = 1; - public int instanceStamp = 0; - protected RelationData relationData; - protected String contextRoot = null; - protected String jspLevel = null; - protected String servletLevel = null; - protected ILibModule[] libModules = null; - protected String[] featureIds = null; - protected int fVersion = -1; - private int fWebNatureType = -1; - //protected WebSettings fWebSettings; - - /* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE NOTE: - * - * If you add any instance variables, make sure to update the resetWebSettings() method if - * appropriate. - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - /** - * WebNatureRuntime constructor comment. - */ - public J2EEWebNatureRuntime() { - super(); - instanceStamp = instanceCount; - instanceCount++; - // class WebSettingsModifier implements IResourceChangeListener, - // IResourceDeltaVisitor { - // - // public void resourceChanged(IResourceChangeEvent event) { - // if (event.getSource() instanceof IWorkspace) { - // IResourceDelta delta = event.getDelta(); - // switch (event.getType()) { - // case IResourceChangeEvent.PRE_AUTO_BUILD : - // if (delta != null) { - // try { - // delta.accept(this); - // } catch (CoreException e) { - // } - // } - // break; - // } - // } - // } - // public boolean visit(IResourceDelta delta) throws CoreException { - // if (delta != null) { - // // get target IResource - // final IResource resource = delta.getResource(); - // if (resource != null) { - // if (resource.getType() == IResource.FILE) { - // // If the websettings file is being modified, reset - // // all the cached values - // // in the nature - // IFile file = (IFile) resource; - // if - // ((file.getName().equals(IWebNatureConstants.WEBSETTINGS_FILE_NAME)) - // && (resource.getProject().getName().equals(getProject().getName()))) - // { - // resetWebSettings(); - // } - // } - // } - // return true; - // } - // return false; - // } - // - // } - // IWorkspace workspace = ResourcesPlugin.getWorkspace(); - // workspace.addResourceChangeListener(new WebSettingsModifier(), - // IResourceChangeEvent.PRE_AUTO_BUILD); - } - - /* - * Do nothing with a cvs ignore file for web projects, - */ - public void addCVSIgnoreFile() { - //Default nothing - } - - public void addLibDirBuilder() throws CoreException { - addToFrontOfBuildSpec(J2EEPlugin.LIBDIRCHANGE_BUILDER_ID); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature#getJ2EEVersion() - */ - public int getJ2EEVersion() { - int j2eeVersion; - switch (getModuleVersion()) { - case J2EEVersionConstants.WEB_2_2_ID : - j2eeVersion = J2EEVersionConstants.J2EE_1_2_ID; - break; - case J2EEVersionConstants.WEB_2_3_ID : - j2eeVersion = J2EEVersionConstants.J2EE_1_3_ID; - break; - default : - j2eeVersion = J2EEVersionConstants.J2EE_1_4_ID; - } - return j2eeVersion; - } - - /** - * Adds a builder to the build spec for the given project. - */ - protected void addToFrontOfBuildSpec(String builderID) throws CoreException { - IProjectDescription description = getProject().getDescription(); - ICommand[] commands = description.getBuildSpec(); - boolean found = false; - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(builderID)) { - found = true; - break; - } - } - if (!found) { - ICommand command = description.newCommand(); - command.setBuilderName(builderID); - ICommand[] newCommands = new ICommand[commands.length + 1]; - System.arraycopy(commands, 0, newCommands, 1, commands.length); - newCommands[0] = command; - IProjectDescription desc = getProject().getDescription(); - desc.setBuildSpec(newCommands); - getProject().setDescription(desc, null); - } - } - - public Archive asArchive() throws OpenFailureException { - return asWARFile(); - } - - public Archive asArchive(boolean shouldExportSource) throws OpenFailureException { - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) - return asWARFile(shouldExportSource); - - return null; - } - - public org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile asWARFile() throws OpenFailureException { - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) { - IProject proj = getProject(); - if (proj == null) - return null; - LoadStrategy loader = new WTProjectLoadStrategyImpl(proj); - loader.setResourceSet(getResourceSet()); - return getCommonArchiveFactory().openWARFile(loader, proj.getName()); - } - return null; - - } - - public WARFile asWARFile(boolean shouldExportSource) throws OpenFailureException { - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) { - IProject proj = getProject(); - if (proj == null) - return null; - WTProjectLoadStrategyImpl loader = new WTProjectLoadStrategyImpl(proj); - loader.setExportSource(shouldExportSource); - loader.setResourceSet(getResourceSet()); - ArchiveOptions options = new ArchiveOptions(); - options.setLoadStrategy(loader); - if (isBinaryProject()) { - options.setIsReadOnly(true); - } - return getCommonArchiveFactory().openWARFile(options, proj.getName()); - } - return null; - - } - - /** - * Configures the project with this nature. - * - * @see IProjectNature#configure() - */ - public void primConfigure() throws CoreException { - //TODO - Move builders to the operations - // add Validation Builder to Web Projects' builder list - ProjectUtilities.addToBuildSpec(J2EEPlugin.VALIDATION_BUILDER_ID, getProject()); - // add LibCopy Builder to Web Projects' builder list - // Note: since this is the last nature added, we are assuming it will - // be after the Java builder. May need to be more explicit about this. - ProjectUtilities.addToBuildSpec(J2EEPlugin.LIBCOPY_BUILDER_ID, getProject()); - addLibDirBuilder(); - super.primConfigure(); - } - - protected EditModel createCacheEditModel() { - return getWebAppEditModelForRead(this); - } - - /** - * Create a default file for the user given the name (directory relative to the project) and the - * default contents for the file. - * - * @param newFilePath - - * IPath - * @param newFileContents - - * String - */ - public void createFile(IPath newFilePath, String newFileContents) throws CoreException { - IPath projectPath = project.getFullPath(); - IWorkspace workspace = J2EEPlugin.getWorkspace(); - createFolder(newFilePath.removeLastSegments(1).toString()); - IFile outputFile = workspace.getRoot().getFile(projectPath.append(newFilePath)); - outputFile.refreshLocal(IResource.DEPTH_INFINITE, null); - InputStream inputStream = new ByteArrayInputStream(newFileContents.getBytes()); - if (!(outputFile.exists())) - outputFile.create(inputStream, true, null); - } - - /** - * Create the folders for the project we have just created. - * - * @exception com.ibm.itp.core.api.resources.CoreException - * The exception description. - */ - protected void createFolders() throws CoreException { - // Create the WEB_MODULE directory - createFolder(getBasicWebModulePath()); - //build for metapath - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) { - createFolder(getMetaPath().toString()); - super.createFolders(); - } - // Create the WEB_INF/lib directory - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) - createFolder(getLibraryPath()); - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature - */ - public Module createNewModule() { - return ((ApplicationPackage) EPackage.Registry.INSTANCE.getEPackage(ApplicationPackage.eNS_URI)).getApplicationFactory().createWebModule(); - } - - /** - * Create a new nature runtime from the project info - */ - // public static J2EEWebNatureRuntime createRuntime(WebProjectInfo info) - // throws CoreException { - // IProject project = info.getProject(); - // if (!hasRuntime(project)) { - // addNatureToProject(project, IWebNatureConstants.J2EE_NATURE_ID); - // J2EEWebNatureRuntime runtime = getRuntime(project); - // runtime.initializeFromInfo(info); - // return runtime; - // } - // return getRuntime(project); - // } - /** - * Removes this nature from the project. - * - * @see IProjectNature#deconfigure - */ - public void deconfigure() throws CoreException { - removeFromBuildSpec(J2EEPlugin.LIBDIRCHANGE_BUILDER_ID); - super.deconfigure(); - } - - /* - * Returns the context root that the server is configured with (also called the web app path). - * This is the path that the war is placed on within the deployed server. This path must be - * included as the first segment of a doc relative path specification within an html file. - */ - public String getContextRoot() { - if (contextRoot == null || contextRoot.equals("")) { -// WebSettings settings = getWebSettings(); -// contextRoot = settings.getContextRoot(); - - ArtifactEdit artifact = null; - WebArtifactEdit webEdit = null; - - try{ - artifact = StructureEdit.getFirstArtifactEditForRead( project ); - webEdit = ( WebArtifactEdit )artifact; - if(webEdit != null) { - contextRoot = webEdit.getServerContextRoot(); - } - }catch (Exception e) { - e.printStackTrace(); - }finally{ - if( webEdit != null ) - webEdit.dispose(); - } - - - if (contextRoot == null) - contextRoot = getProject().getName(); - } - return contextRoot; - } - -// public WebSettings getWebSettings() { -// if (fWebSettings == null) { -// fWebSettings = new WebSettings(getProject()); -// } -// return fWebSettings; -// } - - public IContainer getCSSFolder() { - return getProject().getFolder(getBasicWebModulePath().append(IWebNatureConstants.CSS_DIRECTORY)); - } - - /* - * See description in IJ2EEWebNature interface Creation date: (10/31/2001 10:21:37 AM) @return - * org.eclipse.jdt.core.IJavaProject - */ - public IJavaProject getJ2EEJavaProject() { - return JavaProjectUtilities.getJavaProject(project); - } - - protected IPath getLibraryPath() { - return getWEBINFPath().append(IWebNatureConstants.LIBRARY_DIRECTORY); - } - - public IContainer getLibraryFolder() { - return getProject().getFolder(getLibraryPath()); - } - - protected String getMetaPathKey() { - return J2EEConstants.WEB_INF; - } - - /* - * Returns the root that the server runs off of. In the case of a web project, this is the "Web - * content" folder. For projects created under V4, this is the webApplication folder. - */ - public IContainer getModuleServerRoot() { - return getProject().getFolder(getModuleServerRootName()); - } - - /* - * Returns the name of the module server root directory. For projects created in v4, this is - * webApplication. For projects created in v5.0, this is Web Content. For projects created in - * v5.0.1 and later, this is configurable per project by the user. - */ - public String getModuleServerRootName() { -// String name = getWebSettings().getWebContentName(); -// if (name == null) { -// name = J2EEPlugin.getDefault().getJ2EEPreferences().getJ2EEWebContentFolderName(); -// if (name == null || name.length() == 0) -// name = IWebNatureConstants.WEB_MODULE_DIRECTORY_; -// } -// return name; - return ""; //To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead - } - - public void setModuleServerRootName(String name) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// getWebSettings().setWebContentName(name); -// getWebSettings().write(); - - } - - /** - * Return the root location for loading mof resources; defaults to the source folder, subclasses - * may override - */ - public IContainer getEMFRoot() { - return getModuleServerRoot(); - } - - /** - * Return the nature's ID. - */ - public String getNatureID() { - return IWebNatureConstants.J2EE_NATURE_ID; - } - - /** - * Return the ID of the plugin that this nature is contained within. - */ - protected String getPluginID() { - return IWebToolingCoreConstants.PLUG_IN_ID; - } - - /** - * return the inlinks for this project. This is done by asking the relationData to restore - * itself. - */ - public RelationData getRelationData() { - if (relationData == null) { - relationData = new RelationData(); - relationData.restore(getProject()); - } - return relationData; - } - - /** - * Insert the method's description here. Creation date: (10/30/2001 11:12:41 PM) - * - * @return org.eclipse.core.resources.IContainer - */ - public IContainer getRootPublishableFolder() { - return getModuleServerRoot(); - } - - /** - * Get a WebNatureRuntime that corresponds to the supplied project. - * - * @return com.ibm.itp.wt.IWebNature - * @param project - * com.ibm.itp.core.api.resources.IProject - */ - public static J2EEWebNatureRuntime getRuntime(IProject project) { - try { - J2EEWebNatureRuntime a = (J2EEWebNatureRuntime) project.getNature(IWebNatureConstants.J2EE_NATURE_ID); - return a; - } catch (CoreException e) { - return null; - } - } - - public ITaglibRegistry getTaglibRegistry() { - return WebPlugin.getDefault().getTaglibRegistryManager().getTaglibRegistry(getProject()); - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature#getEditModelKey() - */ - public String getEditModelKey() { - return EDIT_MODEL_ID; - } - - /** - * Returns a web xml model that consists of the MOF model and the DOM model. Important!!! - * Calling this method increments the use count of this model. When you are done accessing the - * model, call releaseAccess()! - */ - public WebEditModel getWebAppEditModelForRead(Object accessorKey) { - return (WebEditModel) getEditModelForRead(EDIT_MODEL_ID, accessorKey); - } - - /** - * Returns a web xml model that consists of the MOF model and the DOM model. Important!!! - * Calling this method increments the use count of this model. When you are done accessing the - * model, call releaseAccess()! - */ - public WebEditModel getWebAppEditModelForWrite(Object accessorKey) { - return (WebEditModel) getEditModelForWrite(EDIT_MODEL_ID, accessorKey); - } - - /** - * @return org.eclipse.core.runtime.IPath - */ - public IPath getWEBINFPath() { - return getBasicWebModulePath().append(IWebNatureConstants.INFO_DIRECTORY); - } - - /** - * @return org.eclipse.core.runtime.IPath - */ - public IPath getDeploymentDescriptorPath() { - return getWEBINFPath().append(IWebNatureConstants.DEPLOYMENT_DESCRIPTOR_FILE_NAME); - } - - /** - * @return org.eclipse.core.runtime.IPath - */ - public IPath getWebBindingsPath() { - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) - return getProjectPath().append(getWEBINFPath()).append(IWebNatureConstants.BINDINGS_FILE_NAME); - - return null; - } - - /** - * @return org.eclipse.core.runtime.IPath - */ - public IPath getWebExtensionsPath() { - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) - return getProjectPath().append(getWEBINFPath()).append(IWebNatureConstants.EXTENSIONS_FILE_NAME); - - return null; - } - - public IPath getBasicWebModulePath() { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings webSettings = getWebSettings(); -// String name = webSettings.getWebContentName(); -// if (name == null) { -// int version = getVersion(); -// // If created in V5 or beyond -// if (version != -1 && version >= 500) -// return IWebNatureConstants.WEB_MODULE_PATH_; -// -// return IWebNatureConstants.WEB_MODULE_PATH_V4; -// } -// return new Path(name); - return new Path(""); - } - - public IPath getWebModulePath() { - return getProjectPath().append(getBasicWebModulePath()); - } - - /** - * Insert the method's description here. Creation date: (10/30/2001 5:25:06 PM) - * - * @return boolean - */ - public int getWebNatureType() { - if (fWebNatureType == -1) { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings settings = getWebSettings(); -// String strType = settings.getProjectType(); - String strType = PROJECTTYPE_J2EE_VALUE; - if (strType != null) { - if (strType.equalsIgnoreCase(PROJECTTYPE_J2EE_VALUE)) - fWebNatureType = IWebNatureConstants.J2EE_WEB_PROJECT; - } - if (fWebNatureType == -1) { - // Invalid value, don't make any unnecessary noice and - // just fix it quietly. find out if web-inf directory - // exists and take an educated guess - IContainer webmoduleFolder = getRootPublishableFolder(); - IFolder webinfFolder = ((IFolder) webmoduleFolder).getFolder(IWebNatureConstants.INFO_DIRECTORY); - if (webinfFolder.exists()) - fWebNatureType = IWebNatureConstants.J2EE_WEB_PROJECT; - } - } - return fWebNatureType; - } - - /* - * Return the current version number. - */ - public static int getCurrentVersion() { - return CURRENT_VERSION; - } - - /* - * Return the version number stored in the web settings file. The version number is used to - * determine when the web project was created (i.e., under what product version). The current - * version number does not necessarily change with each product version -- it's only changed - * when it becomes necessary to distinguish a new version from a prior version. - */ - public int getVersion() { - if (fVersion == -1) { - try { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// String versionString = getWebSettings().getVersion(); - String versionString = "22"; - if (versionString != null) - fVersion = Integer.parseInt(versionString); - } catch (NumberFormatException e) { - //Do nothing - } - } - return fVersion; - } - - /* - * Set the version number stored in the web settings file. The version number is used to - * determine when the web project was created (i.e., under what product version). The current - * version number does not necessarily change with each product version -- it's only changed - * when it becomes necessary to distinguish a new version from a prior version. - */ - public void setVersion(String newVersion) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// getWebSettings().setVersion(newVersion); -// getWebSettings().write(); - fVersion = -1; - } - - public IPath getWebSettingsPath() { - return getProjectPath().append(IWebNatureConstants.WEBSETTINGS_FILE_NAME); - } - - /** - * Return the MOF Resource (model) representing the Web.xml file. - */ - protected XMLResource getWebXmiResource() { - Resource res = getResource(URI.createURI(J2EEConstants.WEBAPP_DD_URI)); - return (XMLResource) res; - } - - /** - * Insert the method's description here. Creation date: (5/10/2001 3:41:00 PM) - * - * @return org.eclipse.core.runtime.IPath - */ - public IPath getWebXMLPath() { - if (getWebNatureType() == IWebNatureConstants.J2EE_WEB_PROJECT) - return getProjectPath().append(getWEBINFPath()).append(IWebNatureConstants.DEPLOYMENT_DESCRIPTOR_FILE_NAME); - - return null; - } - - /** - * Return whether or not the project has a runtime created on it. - * - * @return boolean - * @param project - * com.ibm.itp.core.api.resources.IProject - */ - public static boolean hasRuntime(IProject project) { - try { - return project.hasNature(IWebNatureConstants.J2EE_NATURE_ID); - } catch (CoreException e) { - return false; - } - } - - /** - * Insert the method's description here. Creation date: (10/31/2001 5:32:12 PM) - * - * @param info - * com.ibm.iwt.webproject.WebProjectInfo - * @exception org.eclipse.core.runtime.CoreException - * The exception description. - */ - public void initializeFromInfo(WebProjectInfo info) throws org.eclipse.core.runtime.CoreException { - int natureType = info.getWebProjectType(); - fWebNatureType = natureType; -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings webSettings = getWebSettings(); -// webSettings.setProjectType(convertNatureTypeToString(natureType)); -// webSettings.setWebContentName(info.getWebContentName()); -// webSettings.write(); - super.initializeFromInfo(info); - } - - /** - * Insert the method's description here. Creation date: (11/1/2001 2:25:22 PM) - * - * @param builderID - * java.lang.String - * @exception org.eclipse.core.runtime.CoreException - * The exception description. - */ - protected void removeFromBuildSpec(String builderID) throws org.eclipse.core.runtime.CoreException { - IProjectDescription description = getProject().getDescription(); - ICommand[] commands = description.getBuildSpec(); - boolean found = false; - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(builderID)) { - found = true; - break; - } - } - if (!found) { - ICommand command = description.newCommand(); - command.setBuilderName(builderID); - ICommand[] newCommands = new ICommand[commands.length + 1]; - System.arraycopy(commands, 0, newCommands, 1, commands.length); - newCommands[0] = command; - IProjectDescription desc = getProject().getDescription(); - desc.setBuildSpec(newCommands); - getProject().setDescription(desc, null); - } - } - - public void removeFeatureId(String featureId) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings webSettings = getWebSettings(); -// webSettings.removeFeatureId(featureId); -// webSettings.write(); - } - - // /* - // * JEC - made public so the cache can be cleared from the webview's - // * resource changed listener. Not ideal. - // */ - // public void resetWebSettings() { - // fWebSettings = null; - // contextRoot = null; - // jspLevel = null; - // libModules = null; - // featureIds = null; - // fVersion = -1; - // fWebNatureType = -1; - // } - public void setContextRoot(String newContextRoot) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// getWebSettings().setContextRoot(newContextRoot); -// getWebSettings().write(); - contextRoot = newContextRoot; - } - - public void primaryContributeToContext(EMFWorkbenchContextBase aNewEMFContext) { - if (emfContext == aNewEMFContext) - return; - ModuleCoreNature moduleCoreNature = ModuleCoreNature.getModuleCoreNature(getProject()); - if(moduleCoreNature == null) - setupNonFlexibleProject(aNewEMFContext); - else - setupFlexibleProject(aNewEMFContext); - } - - /** - * @param aNewEMFContext - */ - private void setupFlexibleProject(EMFWorkbenchContextBase aNewEMFContext) { - emfContext = aNewEMFContext; - getEmfContext().setDefaultToMOF5Compatibility(true); - //Overriding superclass to use our own URI converter, which knows about binary projects - ProjectResourceSet projectResourceSet = aNewEMFContext.getResourceSet(); - projectResourceSet.setURIConverter(createURIConverter(getProject(), projectResourceSet)); - /* Flexible projects have their own ResourceFactories and their URI Converters */ -// set.setResourceFactoryRegistry(new J2EEResourceFactoryRegistry()); -// WorkbenchURIConverter conv = initializeWorbenchURIConverter(set); -// set.setURIConverter(conv); - initializeCacheEditModel(); - addAdapterFactories(projectResourceSet); - projectResourceSet.getSynchronizer().addExtender(this); //added so we can be informed of closes to the - // project. - //new J2EEResourceDependencyRegister(set); //This must be done after the URIConverter is - // created. - } - - /** - * @param project - * @return - */ - private URIConverter createURIConverter(IProject aProject, ProjectResourceSet aResourceSet ) { - return new ComponentCoreURIConverter(aProject, aResourceSet.getSynchronizer()); - } - - /** - * @param aNewEMFContext - */ - private void setupNonFlexibleProject(EMFWorkbenchContextBase aNewEMFContext) { - super.primaryContributeToContext(aNewEMFContext); - WorkbenchURIConverter converter = (WorkbenchURIConverter) aNewEMFContext.getResourceSet().getURIConverter(); - converter.addInputContainer(getProject()); - } - - protected String convertNatureTypeToString(int type) { - return PROJECTTYPE_J2EE_VALUE; - } - - /** - * Set the web nature's type to either Static (IWebNatureConstants.STATIC_WEB_NATURE) or J2EE - * (IWebNatureConstants.J2EE_WEB_NATURE) - * - * @param newIsStaticWebProject - * boolean - */ - public void setWebNatureType(int natureType) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// getWebSettings().setProjectType(convertNatureTypeToString(natureType)); -// getWebSettings().write(); - fWebNatureType = natureType; - } - - /* - * @deprecated - Use getModuleVersion() with J2EEVersionConstants - * @see IJ2EEWebNature#isJSP1_2() - */ - public boolean isJSP1_2() { - return getJSPLevel().equals(JSPLEVEL_1_2); - } - - /* - * @deprecated - Use getModuleVersion() with J2EEVersionConstants - * @see IJ2EEWebNature#isServlet2_3() - */ - public boolean isServlet2_3() { - return SERVLETLEVEL_2_3.equals(getServletLevel()); - } - - /* - * @deprecated - Use getModuleVersion() with J2EEVersionConstants - * @see IJ2EEWebNature#setIsJSP1_2(boolean) - */ - /* - * public void setIsJSP1_2(boolean isJSP1_2) throws CoreException { if (isJSP1_2) - * setJSPLevel(JSPLEVEL_1_2); else setJSPLevel(JSPLEVEL_1_1); } - */ - /* - * @deprecated - Use getModuleVersion() with J2EEVersionConstants - * @see IJ2EEWebNature#setIsServlet2_3(boolean) - */ - /* - * public void setIsServlet2_3(boolean isServlet2_3) throws CoreException { if (isServlet2_3) - * setServletLevel(SERVLETLEVEL_2_3); else setServletLevel(SERVLETLEVEL_2_2); } - */ - /* - * @see IJ2EEWebNature#getJSPLevel() - */ - public String getJSPLevel() { - if (jspLevel == null) { - switch (getModuleVersion()) { - case J2EEVersionConstants.WEB_2_2_ID : - jspLevel = JSPLEVEL_1_1; - break; - case J2EEVersionConstants.WEB_2_3_ID : - jspLevel = JSPLEVEL_1_2; - break; - case J2EEVersionConstants.WEB_2_4_ID : - jspLevel = JSPLEVEL_2_0; - break; - default : - jspLevel = DEFAULT_JSPLEVEL; - } - } - return jspLevel; - } - - /** - * Return the root object, the web-app, from the web.xml DD. - * - * used for Read-Only Purpose - */ - public WebApp getWebApp() { - return ((WebEditModel) getCacheEditModel()).getWebApp(); - } - - /* - * @see IJ2EEWebNature#getServletLevel() - */ - public String getServletLevel() { - WebEditModel editModel = (WebEditModel) getCacheEditModel(); - String retVal = SERVLETLEVEL_2_2; - if (editModel != null) { - WebAppResource resource = editModel.getWebXmiResource(); - WebApp app = resource.getWebApp(); - switch (app.getVersionID()) { - case J2EEVersionConstants.WEB_2_4_ID : - retVal = SERVLETLEVEL_2_4; - break; - case J2EEVersionConstants.WEB_2_3_ID : - retVal = SERVLETLEVEL_2_3; - break; - case J2EEVersionConstants.WEB_2_2_ID : - default : - retVal = SERVLETLEVEL_2_2; - break; - } - } - return retVal; - } - - /* - * @see IJ2EEWebNature#setJSPLevel(String) - */ - public void setJSPLevel(String level) throws CoreException { - if (jspLevel != null && jspLevel.equals(level)) - return; - String tJspLevel = null; -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings webSettings = getWebSettings(); - if (JSPLEVEL_1_1.equals(level)) { -// webSettings.setJSPLevel(JSPLEVEL_1_1); - tJspLevel = JSPLEVEL_1_1; - } else if (JSPLEVEL_1_2.equals(level)) { -// webSettings.setJSPLevel(JSPLEVEL_1_2); - tJspLevel = JSPLEVEL_1_2; - } else if (JSPLEVEL_2_0.equals(level)) { -// webSettings.setJSPLevel(JSPLEVEL_2_0); - tJspLevel = JSPLEVEL_2_0; - } -// webSettings.write(); - - jspLevel = tJspLevel; - } - - //TODO depricate this method and create a new one that uses ints. - /* - * @see IJ2EEWebNature#setServletLevel(String) - */ - public void setServletLevel(String servletLevel) { - WebEditModel editModel = null; - try { - editModel = getWebAppEditModelForWrite(this); - if (editModel != null) { - XMLResource resource = editModel.getWebXmiResource(); - if (SERVLETLEVEL_2_3.equals(servletLevel)) { - servletLevel = SERVLETLEVEL_2_3; - resource.setDoctypeValues(J2EEConstants.WEBAPP_PUBLICID_2_3, J2EEConstants.WEBAPP_SYSTEMID_2_3); - } else if (SERVLETLEVEL_2_2.equals(servletLevel)) { - servletLevel = SERVLETLEVEL_2_2; - resource.setDoctypeValues(J2EEConstants.WEBAPP_SYSTEMID_2_2, J2EEConstants.WEBAPP_PUBLICID_2_2); - } else if (SERVLETLEVEL_2_4.equals(servletLevel)) { - servletLevel = SERVLETLEVEL_2_4; - resource.setDoctypeValues(null, null); - } else - throw new RuntimeException(ProjectSupportResourceHandler.getString("Invalid_Servlet_Level_set_on_WebNature_3_EXC_")); //$NON-NLS-1$ - editModel.saveIfNecessary(this); - } - } finally { - if (editModel != null) { - editModel.releaseAccess(this); - } - } - } - - /* - * @see IJ2EEWebNature#getLibModules() - */ - public ILibModule[] getLibModules() { - if (libModules == null) { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings settings = getWebSettings(); -// libModules = settings.getLibModules(); - if (libModules == null) - libModules = new ILibModule[0]; - } - return libModules; - } - - /* - * @see IJ2EEWebNature#setLibModules(ILibModule[]) - */ - public void setLibModules(ILibModule[] libModules) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings webSettings = getWebSettings(); -// webSettings.setLibModules(libModules); -// webSettings.write(); - this.libModules = libModules; - } - - public String[] getFeatureIds() { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings settings = getWebSettings(); -// featureIds = settings.getFeatureIds(); - if (featureIds == null) - featureIds = new String[0]; - return featureIds; - } - - public void setFeatureIds(String[] featureIds) throws CoreException { -// To do : Needs rework for flexibile project ModuleCore.getFirstArtifactEditForRead -// WebSettings webSettings = getWebSettings(); -// webSettings.setFeatureIds(featureIds); -// webSettings.write(); - } - - /** - * @deprecated - Use getJ2EEVersion() with J2EEVersionConstants - * @see IJ2EENature#isJ2EE1_3() - */ - public boolean isJ2EE1_3() { - // Removed for Defect 218792 - Performance - // return isServlet2_3() || isJSP1_2(); - return getJ2EEVersion() == J2EEVersionConstants.J2EE_1_3_ID; - } - - /** - * @see IBaseWebNature#isJ2EE() - */ - public boolean isJ2EE() { - return true; - } - - /** - * @see IBaseWebNature#isStatic() - */ - public boolean isStatic() { - return false; - } - - public String getOverlayIconName() { - switch (getJ2EEVersion()) { - case J2EEVersionConstants.J2EE_1_2_ID : - return WEB_PROJECT_12_OVERLAY; - case J2EEVersionConstants.J2EE_1_3_ID : - return WEB_PROJECT_13_OVERLAY; - case J2EEVersionConstants.J2EE_1_4_ID : - default : - return WEB_PROJECT_14_OVERLAY; - } - } - - public int getDeploymentDescriptorType() { - return XMLResource.WEB_APP_TYPE; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature#getDeploymentDescriptorRoot() - */ - public EObject getDeploymentDescriptorRoot() { - return getWebApp(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature#getVersionFromModuleFile() - */ - protected int getVersionFromModuleFile() { - WebApp ddRoot = getWebApp(); - if (ddRoot != null) { - return ddRoot.getVersionID(); - } - return J2EEVersionConstants.WEB_2_4_ID; - } - - /** - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature#getJ2EEEditModelForRead(java.lang.Object) - * deprecated - * Use - * <p> - * WebArtifactEdit.getWebArtifactEditForRead(WorkbenchComponent) - * </p> - */ - public J2EEEditModel getJ2EEEditModelForRead(Object accessorKey) { - return getWebAppEditModelForRead(accessorKey); - } - - /** - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EENature#getJ2EEEditModelForWrite(java.lang.Object) - * @deprecated - * Use - * <p> - * WebArtifactEdit.getWebArtifactEditForWrite(WorkbenchComponent) - * </p> - */ - public J2EEEditModel getJ2EEEditModelForWrite(Object accessorKey) { - return getWebAppEditModelForWrite(accessorKey); - } - - /** - * Return an editing model used to read web service resources. Important!!! Calling this method - * increments the use count of this model. When you are done accessing the model, call - * releaseAccess()! - */ - public WebServiceEditModel getWebServiceEditModelForRead(Object accessorKey, Map params) { - return (WebServiceEditModel) getEditModelForRead(WEB_SERVICE_EDIT_MODEL_ID, accessorKey, params); - } - - /** - * Return an editing model used to edit web service resources. Important!!! Calling this method - * increments the use count of this model. When you are done accessing the model, call - * releaseAccess()! - */ - public WebServiceEditModel getWebServiceEditModelForWrite(Object accessorKey, Map params) { - return (WebServiceEditModel) getEditModelForWrite(WEB_SERVICE_EDIT_MODEL_ID, accessorKey, params); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/J2EEWebNatureRuntimeUtilities.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/J2EEWebNatureRuntimeUtilities.java deleted file mode 100644 index 13ea988ea..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/J2EEWebNatureRuntimeUtilities.java +++ /dev/null @@ -1,183 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.wst.web.internal.operation.IBaseWebNature; - - -public class J2EEWebNatureRuntimeUtilities { - /** - * WebNatureRuntimeHelper constructor comment. - */ - public J2EEWebNatureRuntimeUtilities() { - super(); - } - - /** - * Adds a nauture to a project - */ - protected static void addNatureToProject(IProject proj, String natureId) throws CoreException { - ProjectUtilities.addNatureToProject(proj, natureId); - } - - /** - * Create a new nature runtime from the project info - */ - public static IBaseWebNature createRuntime(WebProjectInfo info) throws CoreException { - IProject project = info.getProject(); - - // refresh WebProjectInfo for existing runtime - if (hasRuntime(project)) { - // this is for when the web nature is being changed, such - // as from converting from static to j2ee - IBaseWebNature runtime = getRuntime(project); - if (J2EEWebNatureRuntime.hasRuntime(project)) - ((J2EEWebNatureRuntime) runtime).initializeFromInfo(info); - - return runtime; - } - if (info.getWebProjectType() == IWebNatureConstants.J2EE_WEB_PROJECT) - addNatureToProject(project, IWebNatureConstants.J2EE_NATURE_ID); - IBaseWebNature runtime = getRuntime(project); - if (info.getWebProjectType() == IWebNatureConstants.J2EE_WEB_PROJECT) - ((J2EEWebNatureRuntime) runtime).initializeFromInfo(info); - return runtime; - - } - - /** - * Creation date: (10/22/2001 2:17:25 PM) - * - * @return org.eclipse.jst.j2ee.internal.internal.internal.web.operations.IBaseWebNature - */ - public static IBaseWebNature getRuntime(IProject project) { - if (project == null) - return null; - try { - IBaseWebNature nature = null; - if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) - nature = (IBaseWebNature) project.getNature(IWebNatureConstants.J2EE_NATURE_ID); - return nature; - } catch (CoreException e) { - return null; - } - } - - - /** - * Return the J2EE Web Nature for the given project. If the the project does not have a J2EE Web - * Nature, then return null. - * - * @param project - * The project to get the nature from - * @return IJ2EEWebNature The J2EE Web Nature - */ - public static J2EEWebNatureRuntime getJ2EERuntime(IProject project) { - IBaseWebNature nature = getRuntime(project); - if (nature != null) { - if (nature.isJ2EE()) - return (J2EEWebNatureRuntime) nature; - } - return null; - } - - /** - * Return whether or not the project has a runtime created on it. - * - * @return boolean - * @param project - * com.ibm.itp.core.api.resources.IProject - * @deprecated - */ - public static boolean hasRuntime(IProject project) { - try { - return project.hasNature(IWebNatureConstants.J2EE_NATURE_ID); - } catch (CoreException e) { - return false; - } - } - - /** - * Return whether or not the project has a runtime created on it. - * - * @return boolean - * @param project - * com.ibm.itp.core.api.resources.IProject - */ - public static boolean hasJ2EERuntime(IProject project) { - if (project == null || !project.exists()) { - return false; - } - try { - return project.hasNature(IWebNatureConstants.J2EE_NATURE_ID); - } catch (CoreException e) { - return false; - } - } - - public static String getDefaultJ2EEWebContentName() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getJ2EEWebContentFolderName(); - } - - public static String getDefaultStaticWebContentName() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getStaticWebContentFolderName(); - } - - public static IPath getDefaultJ2EEWebContentPath() { - return new Path(getDefaultJ2EEWebContentName()); - } - - public static String getContextRootFromWebProject(IProject project) { - - // get uri from web app display name, and get context root from web nature - IBaseWebNature nature = J2EEWebNatureRuntimeUtilities.getRuntime(project); - String contextRoot = ""; //$NON-NLS-1$ - contextRoot = nature.getContextRoot(); - - // WebEditModel webEditModel = null; - // try { - // webEditModel = (nature.isStatic()) - // ? null - // : - // ((J2EEWebNatureRuntime)nature).getWebAppEditModelForRead(WebNatureRuntimeUtilities.this); - // contextRoot = nature.getContextRoot(); - // } catch (Exception e) { - // e.printStackTrace(); - // } - // finally { - // if (webEditModel != null) - // webEditModel.releaseAccess(WebNatureRuntimeUtilities.this); - // } - return contextRoot; - } - - public static IPath getDefaultWEBINFPath() { - return getDefaultJ2EEWebContentPath().append(IWebNatureConstants.INFO_DIRECTORY); - } - - public static IPath getDefaultWebOutputFolderPath() { - return getDefaultWEBINFPath().append(IWebNatureConstants.CLASSES_DIRECTORY); - } - - public static IPath getWebOutputFolderPath(String webContentName) { - return new Path(webContentName).append(IWebNatureConstants.INFO_DIRECTORY).append(IWebNatureConstants.CLASSES_DIRECTORY); - } - - public static String getDefaultJavaSourceName() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getJavaSourceFolderName(); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/JavaProjectConversionDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/JavaProjectConversionDataModel.java deleted file mode 100644 index 3856e62b0..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/JavaProjectConversionDataModel.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Created on Dec 1, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.common.jdt.internal.integration.JavaProjectCreationDataModel; - -/** - * @author dfholt - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class JavaProjectConversionDataModel extends JavaProjectCreationDataModel { - /* (non-Javadoc) - * @see org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModel#doValidateProperty(java.lang.String) - */ - protected IStatus doValidateProperty(String propertyName) { - if(propertyName.equals(PROJECT_NAME) || propertyName.equals(PROJECT_LOCATION)) - return OK_STATUS; - return super.doValidateProperty(propertyName); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/LibDirBuilder.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/LibDirBuilder.java deleted file mode 100644 index c99ff68a0..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/LibDirBuilder.java +++ /dev/null @@ -1,366 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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 - **************************************************************************************************/ -/* - * Created on Mar 25, 2004 - * - * To change the template for this generated file go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.operations; - - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Map; -import java.util.Vector; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; - -public class LibDirBuilder extends IncrementalProjectBuilder implements IResourceDeltaVisitor { - - //$NON-NLS-1$ - public static boolean TRACING = false; - protected IProgressMonitor pMonitor = null; - - /** - * LibDirChangeListener constructor comment. - */ - public LibDirBuilder() { - //Default constructor - } - - /** - * Implemements a method in <code>IncrementalProjectBuilder</code>. - * - * @see IncrementalProjectBuilder - */ - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - IResourceDelta delta = getDelta(getProject()); - boolean isFullBuild = (kind == IncrementalProjectBuilder.FULL_BUILD) || (delta == null); - try { - if (isFullBuild) { - synch(getProject(), monitor); - } else { - pMonitor = monitor; - delta.accept(this); - } - } catch (CoreException ex) { - Logger.getLogger().log(ex); - } - return null; - } - - /** - * Adds a new entry to the java runtime class path Creation date: (4/12/2001 1:22:03 PM) - * - * @return boolean - * @param libentry_path - * java.lang.String - */ - protected static boolean createLibEntry(IJavaProject javaProject, IPath library_path) { - boolean added = false; - - try { - WebProjectInfo projectInfo = new WebProjectInfo(); - projectInfo.setProjectName(javaProject.getProject().getName()); - - IClasspathEntry[] cp = javaProject.getRawClasspath(); - - //Try to make an entry for the java class path - IClasspathEntry entry = JavaCore.newLibraryEntry(library_path, null, null); - - boolean addEntry = true; - - // Before the jar is added, search the existing classpath to make sure - // it dose not already exist. - for (int i = 0; i < cp.length; i++) { - if (cp[i].equals(entry)) { - addEntry = false; - - } - - } - - // Finally, add the jar if necessary - - if (addEntry) { - - IClasspathEntry[] newPath = new IClasspathEntry[cp.length + 1]; - int i = 0; - for (i = 0; i < cp.length; i++) { - if (i < cp.length) { - newPath[i] = cp[i]; - } - - } - newPath[i] = entry; - - javaProject.setRawClasspath(newPath, null); - - } - - added = true; - - } catch (JavaModelException ex) { - Logger.getLogger().log(ex); - } - return added; - } - - /** - * Removes entry to the java runtime class path Creation date: (4/12/2001 1:22:03 PM) - * - * @return boolean - * @param libentry_path - * java.lang.String - */ - protected static boolean removeLibEntry(IJavaProject javaProject, IPath library_path) { - boolean added = false; - try { - WebProjectInfo projectInfo = new WebProjectInfo(); - projectInfo.setProjectName(javaProject.getProject().getName()); - - IClasspathEntry[] cp = javaProject.getRawClasspath(); - - //Make a class path entry to match with one you will remove - IClasspathEntry entry = JavaCore.newLibraryEntry(library_path, null, null); - - int found = -1; - // Before the jar is added, search the existing classpath to make sure - // it dose not already exist. - for (int i = 0; i < cp.length; i++) { - if (cp[i].getPath().equals(entry.getPath())) { - found = i; - } - - } - - // Finally, remove the jar if necessary - - if (found != -1) { - IClasspathEntry[] newPath = new IClasspathEntry[cp.length - 1]; - int i = 0; - int pos = 0; - for (i = 0; i <= newPath.length; i++) { - if (i != found) { - newPath[pos++] = cp[i]; - } - } - - javaProject.setRawClasspath(newPath, null); - } - - added = true; - - } catch (JavaModelException ex) { - Logger.getLogger().log(ex); - } - return added; - } - - /** - * Informs this builder that it is being started by the build management infrastructure. By the - * time this method is run, the builder's project is available and - * <code>setInitializationData</code> has been called. - * - * @see BaseBuilder#startupOnInitialize() - */ - protected void startupOnInitialize() { - super.startupOnInitialize(); - - if (TRACING) - Logger.getLogger().log(getClass().getName() + ProjectSupportResourceHandler.getString("24concat_INFO_", //$NON-NLS-1$ - (new Object[]{getProject()}))); - //$NON-NLS-1$ = ".startupOnInitialize() for " - - } - - /** - * Synchonizies the class path and the lib directories to catch any changes from the last use - * Creation date: (4/17/01 11:48:12 AM) - */ - protected static void synch(IProject project, IProgressMonitor monitor) { - - try { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(ProjectSupportResourceHandler.getString("Sychronize_Class_Path_UI_"), 4); //$NON-NLS-1$ - //$NON-NLS-1$ = "Sychronize Class Path" - - IContainer lib_folder = WebPropertiesUtil.getWebLibFolder(project); - //Nothing to do if the lib folder does not exist. - if (lib_folder == null || !lib_folder.isAccessible()) - return; - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - IPath lib_path = lib_folder.getProjectRelativePath(); - IPath lib_full_path = lib_folder.getFullPath(); - - IClasspathEntry[] cp = javaProject.getRawClasspath(); - - boolean needsToBeModified = false; - //Create a map of the lib projects in the current project - Hashtable lib_jars = new Hashtable(); - IResource[] children = lib_folder.members(); - monitor.subTask(ProjectSupportResourceHandler.getString("Catalog_Lib_Directory__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Catalog Lib Directory:" - for (int j = 0; j < children.length; j++) { - IResource child = children[j]; - //monitor.setTaskName(ResourceHandler.getString("Catalog_Lib_Directory__UI_") + - // child); //$NON-NLS-1$ = "Catalog Lib Directory:" - //Make sure it is a zip or a jar file - if (child.getType() == IResource.FILE && (child.getFullPath().toString().toLowerCase().endsWith(".jar") //$NON-NLS-1$ - || child.getFullPath().toString().toLowerCase().endsWith(".zip"))) { //$NON-NLS-1$ - lib_jars.put(child.getFullPath(), child); - } - - } - - monitor.worked(1); - monitor.subTask(ProjectSupportResourceHandler.getString("Update_ClassPath__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Update ClassPath:" - //Loop through all the classpath dirs looking for ones that may have - //been deleted - Vector newClassPathVector = new Vector(); - for (int j = 0; j < cp.length; j++) { - - //If it is a lib_path - if (cp[j].getPath().toString().startsWith(lib_path.toString()) || cp[j].getPath().toString().startsWith(lib_full_path.toString())) { - //It was already in the class path - if (lib_jars.get(cp[j].getPath()) != null) { - newClassPathVector.add(cp[j]); - //Remove it from the hash table of paths to add back - //monitor.setTaskName(ResourceHandler.getString("Catalog_Lib_Directory__UI_") - // + cp[j].getPath()); //$NON-NLS-1$ = "Catalog Lib Directory:" - lib_jars.remove(cp[j].getPath()); - - } else { - //You have removed something form the class path you - //will need to re-build - //monitor.setTaskName(ResourceHandler.getString("Catalog_Lib_Directory_Remo_UI_") - // + cp[j].getPath()); //$NON-NLS-1$ = "Catalog Lib Directory:Remove " - needsToBeModified = true; - } - } else { - monitor.subTask(ProjectSupportResourceHandler.getString("Catalog_Lib_Directory__UI_") + cp[j].getPath()); //$NON-NLS-1$ - //$NON-NLS-1$ = "Catalog Lib Directory:" - newClassPathVector.add(cp[j]); - } - } - monitor.worked(1); - monitor.subTask(ProjectSupportResourceHandler.getString("Update_ClassPath__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Update ClassPath:" - - //Add any entries not already found - Enumeration aenum = lib_jars.keys(); - while (aenum.hasMoreElements()) { - IPath path = (IPath) aenum.nextElement(); - newClassPathVector.add(JavaCore.newLibraryEntry(path, null, null)); - //You have added something form the class path you - //will need to re-build - //monitor.setTaskName(ResourceHandler.getString("23concat_UI_", (new Object[] { - // path }))); //$NON-NLS-1$ = "Catalog Lib Directory:Add {0}" - needsToBeModified = true; - } - - monitor.worked(1); - monitor.subTask(ProjectSupportResourceHandler.getString("Set_ClassPath__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Set ClassPath:" - - //Tansfer the vector to an array - IClasspathEntry[] newClassPathArray = new IClasspathEntry[newClassPathVector.size()]; - - for (int j = 0; j < newClassPathArray.length; j++) { - newClassPathArray[j] = (IClasspathEntry) newClassPathVector.get(j); - } - - //Only change the class path if there has been a modification - if (needsToBeModified) { - - try { - javaProject.setRawClasspath(newClassPathArray, monitor); - } catch (Exception e) { - Logger.getLogger().log(e); - } - } - - } catch (ClassCastException ex) { - Logger.getLogger().log(ex); - } catch (CoreException ex) { - Logger.getLogger().log(ex); - } finally { - monitor.done(); - } - - } - - public boolean visit(IResourceDelta subdelta) throws CoreException { - //Pull out resource - try { - IResource resource = subdelta.getResource(); - - if (resource.getType() == IResource.FILE) { - String filePath = subdelta.getFullPath().toString(); - //only allow .jar or .zip - if (filePath.toLowerCase().endsWith(".jar") //$NON-NLS-1$ - || filePath.toLowerCase().endsWith(".zip")) { //$NON-NLS-1$ - IProject project = resource.getProject(); - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - IPath lib_path = lib_path = project.getFullPath().append(WebPropertiesUtil.getWebLibFolder(project).getProjectRelativePath()); - int file_seg_count = subdelta.getFullPath().segmentCount(); - int lib_path_seg_count = lib_path.segmentCount(); - - //File must be in the lib path and not a subdir - if (filePath.startsWith(lib_path.toString()) && file_seg_count == lib_path_seg_count + 1) { // - // Find out what happened - // - int kind = subdelta.getKind(); - switch (kind) { - - case IResourceDelta.ADDED : - createLibEntry(javaProject, new Path(filePath)); - break; - case IResourceDelta.REMOVED : - removeLibEntry(javaProject, new Path(filePath)); - break; - case IResourceDelta.ADDED_PHANTOM : - break; - case IResourceDelta.REMOVED_PHANTOM : - break; - case IResourceDelta.CHANGED : - break; - } - - } - } - } else if (resource.getType() == IResource.PROJECT) { - synch(((IProject) resource), pMonitor); - } - } catch (ClassCastException ex) { - //ignore it just means this is not a web project - } - return true; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/MasterCSS.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/MasterCSS.java deleted file mode 100644 index f17c1b7ed..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/MasterCSS.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - - -/** - * Code generation class compiled from template file MasterCSS.tpl - */ -public class MasterCSS implements WebToolingTemplate { - private static final String TEXT_1 = "BODY\r\n{\r\n BACKGROUND-COLOR: #FFE4B5;\r\n COLOR: black;\r\n FONT-FAMILY: 'Times New Roman'\r\n}\r\nH1\r\n{\r\n COLOR: navy;\r\n FONT-FAMILY: 'Times New Roman';\r\n FONT-SIZE: x-large;\r\n FONT-WEIGHT: bolder;\r\n TEXT-TRANSFORM: capitalize\r\n}\r\nH2\r\n{\r\n COLOR: navy;\r\n FONT-FAMILY: 'Times New Roman';\r\n FONT-SIZE: large;\r\n FONT-WEIGHT: bolder;\r\n TEXT-TRANSFORM: capitalize\r\n}\r\nH3\r\n{\r\n COLOR: navy;\r\n FONT-FAMILY: 'Times New Roman';\r\n FONT-SIZE: large;\r\n FONT-WEIGHT: lighter;\r\n TEXT-TRANSFORM: capitalize\r\n}";//$NON-NLS-1$ - private static final String TEXT_2 = "\r\n";//$NON-NLS-1$ - - /** - * Code generation method - * - * @return String - */ - public String generate(TemplateData data) { - StringBuffer sb = new StringBuffer(); - sb.append(TEXT_1); - sb.append(TEXT_2); - return sb.toString(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ProjectSupportResourceHandler.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ProjectSupportResourceHandler.java deleted file mode 100644 index 7bfab6af5..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ProjectSupportResourceHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.jst.j2ee.internal.web.operations; - -/* - * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2002 - All Rights Reserved. US - * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP - * Schedule Contract with IBM Corp. - */ - -/* - * Licensed Material - Property of IBM (C) Copyright IBM Corp. 2001 - All Rights Reserved. US - * Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP - * Schedule Contract with IBM Corp. - */ -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class ProjectSupportResourceHandler { - - private static ResourceBundle fgResourceBundle; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("ProjectSupport");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } - - public static String getString(String key, Object[] args, int x) { - - return getString(key); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/RelationData.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/RelationData.java deleted file mode 100644 index 5e36d97b2..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/RelationData.java +++ /dev/null @@ -1,993 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; -import java.util.StringTokenizer; -import java.util.Vector; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This class stores the relationship between two files. In particular, this is an inLink and the - * files which reference it. - */ -public class RelationData { - public class Link implements Cloneable { - - private String url; - private int occurrences = 0; - - public Link(String newUrl, int occ) { - url = newUrl; - occurrences = occ; - } - - /** - * Returns an exact copy of this object. - * - * @return Created clone object - */ - public Object clone() { - return new Link(url, occurrences); - } - - /** - * Returns the url of the file that references this inLink - * - * @return String - */ - public String getURL() { - return url; - } - - /** - * Returns the number of times this file references the inLink - * - * @return int - */ - public int getOccurrences() { - return occurrences; - } - - private int addOccurrence(int add) { - occurrences = occurrences + add; - return occurrences; - } - - public String toString() { - return url; - } - } - - // our relationship table. Key is a string which is the path of the inLink, - // value is a vector of files that reference the inLink. - protected Hashtable inLinksTable = null; - protected Hashtable anchorsTable = null; - private static final int INIT_HASH_TABLE_SIZE = 100; - private static final int INIT_ANCHORS_HASH_TABLE_SIZE = 10; - private boolean fileOk = false; - private static final String LINK_STATE_FILE_NAME = "link_table_states.txt";//$NON-NLS-1$ - private static final String LINK_SERVERCONTEXTROOT_FILE_NAME = "link_scr_states.txt";//$NON-NLS-1$ - public static final String LINK_MISSING_FILE = "-";//$NON-NLS-1$ - public static final String LINK_INDEX_SEPARATOR = "+";//$NON-NLS-1$ - public static final String ANCHOR_INDEX_SEPARATOR = "#";//$NON-NLS-1$ - public static final String LINK_OCCURENCE_SEPARATOR = "/";//$NON-NLS-1$ - public static final String ANCHOR_SEPARATOR = "#### ANCHORS ####";//$NON-NLS-1$ - - /** - * RelationData constructor comment. - */ - public RelationData() { - super(); - inLinksTable = new Hashtable(INIT_HASH_TABLE_SIZE); - anchorsTable = new Hashtable(INIT_ANCHORS_HASH_TABLE_SIZE); - } - - public Link addInLink(String file_path, String parent_path, int occurence) { - Vector in_links = (Vector) inLinksTable.get(file_path); - if (in_links == null) { - return null; - } - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - // - // Increment the occurence and return - // - - if (url.compareTo(parent_path) == 0) { - inlnk.addOccurrence(occurence); - return inlnk; - } - } - - // - // The link does not exist, need to add an entry in the table for it - // - - Link inlnk = new Link(parent_path, occurence); - in_links.addElement(inlnk); - return inlnk; - } - - public void changeInLink(String filePath, boolean missing) { - - if (missing) { - Vector inlinks = (Vector) inLinksTable.remove(filePath); - inLinksTable.put(LINK_MISSING_FILE + filePath, inlinks); - } else { - Vector inlinks = (Vector) inLinksTable.remove(LINK_MISSING_FILE + filePath); - inLinksTable.put(filePath, inlinks); - } - } - - - /* - * returns which projects depend on this file i.e. any projects that are in this file's list of - * in_links - */ - public Collection getDependentProjects(String file_path) { - Hashtable outProjects = new Hashtable(); - Vector in_links = (Vector) inLinksTable.get(file_path); - - if (in_links != null) { - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - // should be in the form of: /ProjName/.... - if (url.length() > 0) { - // key could be the filename or the missing filename ("-" + filename) - // take this into account and offset the index accordingly - int index = 0; - int offset = 1; - if (url.charAt(0) == '-') { - index = url.indexOf(IPath.SEPARATOR, 2); - offset = 2; - } else { - index = url.indexOf(IPath.SEPARATOR, 1); - offset = 1; - } - if (index != -1) { - String projName = url.substring(offset, index); - outProjects.put(projName, projName); - } - } - } - } - return outProjects.values(); - } - - /* - * returns which cross-project files depend on this file i.e. any projects that are in this - * file's list of in_links - */ - public Collection getDependentProjectFiles(String projName) { - Hashtable outProjects = new Hashtable(); - - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String path = (String) aenum.nextElement(); - // should be in the form of: /ProjName/.... - if (path.length() > 0) { - // if path is a missing filename ("-" + filename) then it means that it had - // to come from this project (that is, the external nonexistent file could not have - // linked to this project). So, we will not add this path. Also, since it is marked - // broken, it probably won't exist to do anything with it anyway. - if (path.charAt(0) != '-') { - int index = path.indexOf(IPath.SEPARATOR, 1); - if (index != -1) { - String currentProjName = path.substring(1, index); - if (!currentProjName.equals(projName)) { - outProjects.put(path, path); - } - } - } - } - } - return outProjects.values(); - } - - - - public void createInLinkEntry(String file_path, String parent_path, int occurence) { - - Vector in_links = new Vector(); - Link inlnk = new Link(parent_path, occurence); - in_links.addElement(inlnk); - inLinksTable.put(file_path, in_links); - } - - - - public void dump() { - if (false) { - if (inLinksTable != null) { - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - StringBuffer St = new StringBuffer(); - String key = (String) aenum.nextElement(); - St.append("\nKey=" + key + "\n");//$NON-NLS-1$//$NON-NLS-2$ - Vector in_links = (Vector) inLinksTable.get(key); - int nb_of_links = in_links.size(); - - // Replace the string by index - // Add a '+'separator only for more than one links to save space - // - - - for (int i = 0; i < nb_of_links; i++) { - Link lnk = (Link) in_links.elementAt(i); - St.append("\tValue=" + lnk.getURL() + "[" + lnk.getOccurrences() + "]");//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ - } - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logInfo(St.toString()); - } - } - } - } - - public void dump(boolean dump) { - if (dump) { - if (inLinksTable != null) { - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - StringBuffer St = new StringBuffer(); - String key = (String) aenum.nextElement(); - St.append("\nKey=" + key + "\n");//$NON-NLS-1$//$NON-NLS-2$ - Vector in_links = (Vector) inLinksTable.get(key); - int nb_of_links = in_links.size(); - - // Replace the string by index - // Add a '+'separator only for more than one links to save space - // - - - for (int i = 0; i < nb_of_links; i++) { - Link lnk = (Link) in_links.elementAt(i); - St.append("\tValue=" + lnk.getURL() + "[" + lnk.getOccurrences() + "]");//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ - } - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(St.toString()); - } - } - } - } - - /** - * used for LinksBuilder debugging - */ - public void dump2() { - if (inLinksTable != null) { - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - StringBuffer St = new StringBuffer(); - String key = (String) aenum.nextElement(); - - Vector in_links = (Vector) inLinksTable.get(key); - int nb_of_links = in_links.size(); - St.append("\nKey=" + key + " -- num:" + nb_of_links + "\n");//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - // Replace the string by index - // Add a '+'separator only for more than one links to save space - // - - - for (int i = 0; i < nb_of_links; i++) { - Link lnk = (Link) in_links.elementAt(i); - St.append("\tValue=" + lnk.getURL() + "[" + lnk.getOccurrences() + "]");//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ - } - System.out.println(St.toString()); - } - } - System.out.println("************************************************\n\n\n\n************************************\n"); //$NON-NLS-1$ - } - - - public Vector getInLinks(String filePath) { - return (Vector) inLinksTable.get(filePath); - } - - public void getInLinks(String filePath, Vector vectInLinks) { - - if (inLinksTable != null) { - dump(); - Vector in_links = (Vector) inLinksTable.get(filePath); - if (in_links != null) { - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) ((Link) in_links.elementAt(i)).clone(); - vectInLinks.addElement(inlnk); - } - } - } - } - - public Hashtable getAnchorsTable() { - return anchorsTable; - } - - /** - * Returns the file used to store ServerContextRoot for the project. - */ - public static File getPreviousSCRFile(IProject project) { - return new Path(J2EEPlugin.getDefault().getStateLocation().toString() + File.separator + project.getName() + File.separator + LINK_SERVERCONTEXTROOT_FILE_NAME).toFile(); - } - - /** - * Returns the file used to store the state of the link relations for the project. - * - * @return java.io.File The state file - * @param project - * org.eclipse.core.resources.IProject The project to get the state file for. - */ - private File getStateFile(IProject project) { - return new Path(J2EEPlugin.getDefault().getStateLocation().toString() + File.separator + project.getName() + File.separator + LINK_STATE_FILE_NAME).toFile(); - } - - public boolean hasInLinkEntry(String path) { - return inLinksTable.containsKey(path); - } - - /** - * Run through all missing-file (-) RD entries to see if any of them closely match the path to - * this class. Return all of the matches. - */ - public Vector getPossibleMissingEndingMatches(IPath classPath) { - Vector v = new Vector(); - - String match = classPath.lastSegment(); - match = match.substring(0, match.length() - 6); // length minus ".class" - - String classPathStr = classPath.toString(); - String matchingClassPath = classPathStr.toString().substring(0, classPathStr.length() - 6); - - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String path = (String) aenum.nextElement(); - // check if path ends with the class name that has been added/removed - if (path.startsWith(LINK_MISSING_FILE) && path.endsWith(match)) { - // OK: simple match found; now let's match with finer granularity. - // Take path and put it into a form where we can check if it is a - // close match to the class that has changed: - // /Proj/Web Content/com.acme.Foo --> com/acme/Foo - String linkPath; - int index = path.lastIndexOf(IPath.SEPARATOR); - if (index != -1 && index < path.length() - 1) { - linkPath = path.substring(index + 1); - } else { - linkPath = path; - } - String closeMatch = linkPath.replace('.', IPath.SEPARATOR); - - if (matchingClassPath.endsWith(closeMatch)) { - Vector in_links = (Vector) inLinksTable.get(path); - String nonMissingPath = path.substring(1, path.length()); - changeInLink(nonMissingPath, false); - if (in_links != null) { - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - v.add(url); - } - } - } - } - } - return v; - } - - - /** - * Run through all existing RD entries to see if any of them closely match the path to this - * class. Return all of the matches. - */ - public Vector getPossibleExistingEndingMatches(IPath classPath) { - Vector v = new Vector(); - - String match = classPath.lastSegment(); - match = match.substring(0, match.length() - 6); // length minus ".class" - - String classPathStr = classPath.toString(); - String matchingClassPath = classPathStr.toString().substring(0, classPathStr.length() - 6); - - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String path = (String) aenum.nextElement(); - // check if path ends with the class name that has been added/removed - if (path.endsWith(match) && !path.startsWith(LINK_MISSING_FILE)) { - // OK: simple match found; now let's match with finer granularity. - // Take path and put it into a form where we can check if it is a - // close match to the class that has changed: - // /Proj/Web Content/com.acme.Foo --> com/acme/Foo - String linkPath; - int index = path.lastIndexOf(IPath.SEPARATOR); - if (index != -1 && index < path.length() - 1) { - linkPath = path.substring(index + 1); - } else { - linkPath = path; - } - String closeMatch = linkPath.replace('.', IPath.SEPARATOR); - - if (matchingClassPath.endsWith(closeMatch)) { - Vector in_links = (Vector) inLinksTable.get(path); - changeInLink(path, true); - if (in_links != null) { - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - v.add(url); - } - } - } - } - } - return v; - } - - /** - * Run through all existing RD entries to see if any of them closely match the path to this - * class. Remove the inlinks for all the matches. - */ - public void removeInLinksPossibleExistingEndingMatches(IPath classPath) { - String match = classPath.lastSegment(); - match = match.substring(0, match.length() - 6); // length minus ".class" - - String classPathStr = classPath.toString(); - String matchingClassPath = classPathStr.toString().substring(0, classPathStr.length() - 6); - - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String path = (String) aenum.nextElement(); - if (path.endsWith(match) && !path.startsWith(LINK_MISSING_FILE)) { - // OK: simple match found; now let's match with finer granularity. - // Take path and put it into a form where we can check if it is a - // close match to the class that has changed: - // /Proj/Web Content/com.acme.Foo --> com/acme/Foo - String linkPath; - int index = path.lastIndexOf(IPath.SEPARATOR); - if (index != -1 && index < path.length() - 1) { - linkPath = path.substring(index + 1); - } else { - linkPath = path; - } - String closeMatch = linkPath.replace('.', IPath.SEPARATOR); - - if (matchingClassPath.endsWith(closeMatch)) { - removeInLinks(path); - } - } - } - } - - /** - * Initialize links tables - */ - public void initialize() { - inLinksTable = new Hashtable(INIT_HASH_TABLE_SIZE); - anchorsTable = new Hashtable(INIT_ANCHORS_HASH_TABLE_SIZE); - - } - - /** - * Initialize links tables - */ - public void initializeAnchors() { - anchorsTable = new Hashtable(INIT_ANCHORS_HASH_TABLE_SIZE); - } - - /** - * Initialize links tables - */ - public void initializeInLinks() { - inLinksTable = new Hashtable(INIT_HASH_TABLE_SIZE); - } - - /** - * Return true if the file to restore data from existed and was successfully read. - * - * @return boolean - */ - public boolean isFileOk() { - return fileOk; - } - - public boolean isInitialized() { - return (inLinksTable != null); - } - - public void newInLinkEntry(String path) { - if (!inLinksTable.containsKey(path)) - inLinksTable.put(path, new Vector()); - } - - public void removeInLinks(String file_path) { - - // - // Iterate through the fLinksTable to remove all in-links references - // for file_path - // - - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String key = (String) aenum.nextElement(); - Vector in_links = (Vector) inLinksTable.get(key); - - for (int i = 0; i < in_links.size(); i++) { - - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(file_path) == 0) { - in_links.removeElementAt(i); - break; - } - - // - // Remove the entry in the fLinksTable if the in-link - // of the file is not in the workbench and an orphan link - // otherwise update the in-links fLinksTable - // - } - - if (in_links.isEmpty() && key.startsWith(LINK_MISSING_FILE)) { - inLinksTable.remove(key); - } - } - } - - /** - * Iterate through the fLinksTable to return all out-links references for file_path - * - * @param file_path - * @return - */ - public List getOutLinks(String file_path) { - ArrayList list = new ArrayList(); - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String key = (String) aenum.nextElement(); - Vector in_links = (Vector) inLinksTable.get(key); - - for (int i = 0; i < in_links.size(); i++) { - - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(file_path) == 0) { - list.add(key); - break; - } - } - } - - return list; - } - - - /** - * return whether other resources link to this file or not - */ - public boolean referencedByOtherLinks(String file_path) { - - // - // Iterate through the fLinksTable to remove all in-links references - // for file_path - // - boolean referenced = false; - for (Enumeration aenum = inLinksTable.keys(); !referenced && aenum.hasMoreElements();) { - String key = (String) aenum.nextElement(); - Vector in_links = (Vector) inLinksTable.get(key); - - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(file_path) == 0) { - referenced = true; - break; - } - } - } - return referenced; - } - - - /* - * performs as removeInLinks( String ) ... But for performance reasons, this also additionally - * returns a list of all the projects that this file is dependent upon. This is useful to get - * this information, and then go to all of those projects' relation data and tell them to - * removeInLinks for this file. - */ - public Collection removeInLinksForProjects(String file_path) { - - // - // Iterate through the fLinksTable to remove all in-links references - // for file_path - // - Hashtable projects = new Hashtable(); - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String key = (String) aenum.nextElement(); - Vector in_links = (Vector) inLinksTable.get(key); - - for (int i = 0; i < in_links.size(); i++) { - - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(file_path) == 0) { - // should be in the form of: /ProjName/.... - if (key.length() > 0) { - // key could be the filename or the missing filename ("-" + filename) - // take this into account and offset the index accordingly - int index = 0; - int offset = 1; - if (key.charAt(0) == '-') { - index = key.indexOf(IPath.SEPARATOR, 2); - offset = 2; - } else { - index = key.indexOf(IPath.SEPARATOR, 1); - offset = 1; - } - if (index != -1) { - String projName = key.substring(offset, index); - projects.put(projName, projName); - } - } - in_links.removeElementAt(i); - break; - } - - // - // Remove the entry in the fLinksTable if the in-link - // of the file is not in the workbench and an orphan link - // otherwise update the in-links fLinksTable - // - } - - if (in_links.isEmpty() && key.startsWith(LINK_MISSING_FILE)) - inLinksTable.remove(key); - } - - return projects.values(); - } - - - - /** - * performs as removeInLinks( String ) ... But for performance reasons, it additionally returns - * which projects depend on this file. i.e. any projects that are in this file's list of - * in_links - */ - public Collection removeInLinksAndGetDependentProjects(String file_path) { - // - // Iterate through the fLinksTable to remove all in-links references - // for file_path - // - Hashtable projects = new Hashtable(); - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String key = (String) aenum.nextElement(); - Vector in_links = (Vector) inLinksTable.get(key); - - if (key.equals(RelationData.LINK_MISSING_FILE + file_path)) { - int index = -1; - for (int i = 0; i < in_links.size(); i++) { - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(file_path) == 0) { - index = i; - } - if (url.length() > 1) { - int projindex = url.indexOf(IPath.SEPARATOR, 1); - if (projindex != -1) { - String projName = url.substring(1, projindex); - projects.put(projName, projName); - } - } - } - if (index != -1) { - in_links.removeElementAt(index); - } - - } else { - for (int i = 0; i < in_links.size(); i++) { - - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(file_path) == 0) { - - in_links.removeElementAt(i); - break; - } - - // - // Remove the entry in the fLinksTable if the in-link - // of the file is not in the workbench and an orphan link - // otherwise update the in-links fLinksTable - // - } - } - - if (in_links.isEmpty() && key.startsWith(LINK_MISSING_FILE)) { - inLinksTable.remove(key); - } - } - return projects.values(); - } - - - /** - * remove all references to a specific inLink. When removeOrphan is true the inLink entry is - * removed as well, when there are no more refereces to it - */ - public void removeInLinks(String inLinkEntry, String inLinkReference, boolean removeOrphan) { - - String key = inLinkEntry; - Vector in_links = (Vector) inLinksTable.get(key); - - for (int i = 0; i < in_links.size(); i++) { - - Link inlnk = (Link) in_links.elementAt(i); - String url = inlnk.getURL(); - - if (url.compareTo(inLinkReference) == 0) { - in_links.removeElementAt(i); - break; - } - } - - // If there are no more references to the inLinkEntry - // and the caller wants this orphan deleted then - // remove the key from the table - if (in_links.isEmpty() && removeOrphan) - inLinksTable.remove(key); - - } - - /** - * Restores this builder's saved state and returns whether it was successful in doing so. - */ - public boolean restore(IProject project) { - if (project != null) { - // get the state - File stateFile = getStateFile(project); - if (stateFile.exists()) { - inLinksTable = new Hashtable(INIT_HASH_TABLE_SIZE); - - // read inLinksTable from stateFile - Vector keys = new Vector(); - Vector indices = new Vector(); - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(stateFile)); - - String line = null; - // while( ((line = reader.readLine()) != null) && !line.startsWith( - // ANCHOR_SEPARATOR ) ) - while ((line = reader.readLine()) != null) { - String buffer = line; - - - // to take into account the possibility of links spanning multiple lines, - // keep reading until we find a line that starts with an idicator - // that the link is finished (a line beginning w/ LINK_INDEX_SEPARATOR) - line = reader.readLine(); - while (line != null && !line.startsWith(LINK_INDEX_SEPARATOR)) { - buffer = buffer + line; - line = reader.readLine(); - } - // add link string (/MyProj/file.html) - if (buffer != null) { - keys.addElement(buffer); - } - // add references line (+2/3...) - if (line != null) { - indices.addElement(line); - } else { - System.out.println(ProjectSupportResourceHandler.getString("Syntax_Error_in_the_links_UI_")); //$NON-NLS-1$ = "Syntax Error in the links state file" - return false; - } - } - - // Use this to load anchor information - // // Now let's add all of the extra anchor information - // if ( line != null && line.startsWith( ANCHOR_SEPARATOR ) ) { - // while( (line = reader.readLine()) != null ) - // { - // String buffer = line; - // - // // to take into account the possibility of links spanning multiple lines, - // // keep reading until we find a line that starts with an idicator - // // that the link is finished (a line beginning w/ LINK_INDEX_SEPARATOR) - // line = reader.readLine(); - // while ( line != null && !line.startsWith( ANCHOR_INDEX_SEPARATOR ) ) { - // buffer = buffer + line; - // line = reader.readLine(); - // } - // - // // add file and all of its anchors - // if ( buffer != null && line != null) - // { - // anchorsTable.put( buffer, line ); - // } - // else - // { - // System.out.println(ResourceHandler.getString("Syntax_Error_in_the_links_UI_")); - // //$NON-NLS-1$ = "Syntax Error in the links state file" - // return false; - // } - // } - // - // } - } catch (FileNotFoundException fe) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(fe); - } catch (IOException ie) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ie); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException ie2) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ie2); - } - } - } - - - // - // Populate the hash inLinksTable with keys (file paths) and values (in links files - // paths) - // - fileOk = true; - for (int i = 0; i < keys.size(); i++) { - try { - String key = (String) keys.elementAt(i); - String compacted_indices = (String) indices.elementAt(i); - - // - // Parse the in-links indexes - // - - int size = keys.size(); - Vector in_links = new Vector(); - if (compacted_indices != LINK_INDEX_SEPARATOR) { - - // Extract indexes and occurences - - StringTokenizer st_idx_occ = new StringTokenizer(new String(compacted_indices), LINK_INDEX_SEPARATOR); - while (st_idx_occ.hasMoreTokens()) { - String idx_occ = new String(st_idx_occ.nextToken()); - int pos_occ = idx_occ.indexOf(LINK_OCCURENCE_SEPARATOR); - int index; - int occurence = 1; - if (pos_occ == -1) { - index = Integer.valueOf(idx_occ).intValue(); - } else { - index = Integer.valueOf(idx_occ.substring(0, pos_occ)).intValue(); - occurence = Integer.valueOf(idx_occ.substring(pos_occ + 1)).intValue(); - } - if (index >= 0 && index < size) { - Link inlnk = new Link((String) keys.elementAt(index), occurence); - in_links.addElement(inlnk); - } - } - } - inLinksTable.put(key, in_links); - } catch (Exception e) { - fileOk = false; - } - } - - return fileOk; - } - return false; - - } - - return false; - } - - /** - * Saves this builder's state to disk so that it can be restarted in the same state later. - */ - public void save(IProject project) { - - File stateFile = getStateFile(project); - if (inLinksTable == null) { - stateFile.delete(); - } else { - - // Prepare the index vector - - Vector index_vector = new Vector(inLinksTable.size()); - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - index_vector.addElement(aenum.nextElement()); - } - - // write inLinksTable to stateFile - - try { - File parentFolder = stateFile.getParentFile(); - if (!parentFolder.exists()) { - parentFolder.mkdirs(); - } - PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(stateFile))); - for (Enumeration aenum = inLinksTable.keys(); aenum.hasMoreElements();) { - String key = (String) aenum.nextElement(); - out.print(key); - out.println(); - out.print(LINK_INDEX_SEPARATOR); - Vector in_links = (Vector) inLinksTable.get(key); - int nb_of_links = in_links.size(); - - // Replace the string by index - // Add a '+'separator only for more than one links to save space - // Add '/<occurence>' only if occurence > 1 to save space - // - - Link lnk = null; - int nb_lnks = 0; - if (nb_of_links > 0) { - lnk = (Link) in_links.elementAt(0); - out.print(index_vector.indexOf(lnk.getURL())); - nb_lnks = lnk.getOccurrences(); - if (nb_lnks > 1) { - out.print(LINK_OCCURENCE_SEPARATOR); - out.print(nb_lnks); - } - for (int i = 1; i < nb_of_links; i++) { - out.print(LINK_INDEX_SEPARATOR); - lnk = (Link) in_links.elementAt(i); - out.print(index_vector.indexOf(lnk.getURL())); - nb_lnks = lnk.getOccurrences(); - if (nb_lnks > 1) { - out.print(LINK_OCCURENCE_SEPARATOR); - out.print(nb_lnks); - } - } - } - out.println(); - } - /* - * use this to save out anchor information // - * ############################################ if ( !anchorsTable.isEmpty() ) { - * out.println( ANCHOR_SEPARATOR ); } for (Enumeration enum = anchorsTable.keys(); - * enum.hasMoreElements();) { String key = (String) enum.nextElement(); - * out.print(key); out.println(); //out.print(ANCHOR_INDEX_SEPARATOR); out.println( - * anchorsTable.get(key) ); } - */ - - out.flush(); - out.close(); - } catch (IOException e) { - org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ProjectSupportResourceHandler.getString("Error_while_saving_links_s_EXC_")); //$NON-NLS-1$ = "Error while saving links state file" - } - } - } - - /** - * Insert the method's description here. Creation date: (3/21/2001 1:45:58 PM) - * - * @param newFileOk - * boolean - */ - void setFileOk(boolean newFileOk) { - fileOk = newFileOk; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ServerTargetUtil.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ServerTargetUtil.java deleted file mode 100644 index 5003dc621..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/ServerTargetUtil.java +++ /dev/null @@ -1,133 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Sep 12, 2003 - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.servertarget.IServerTargetConstants; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.ServerCore; - -/** - * A class with some useful methods that support server targetting for Web projects. - * - * @author Pratik Shah - */ -public class ServerTargetUtil { - - private static final String defaultId = "com.ibm.etools.websphere.serverTarget.base.v51"; //$NON-NLS-1$ - private static final String defaultExpressId = "com.ibm.etools.websphere.serverTarget.express.v51"; //$NON-NLS-1$ - - /** - * @param targets - * A list of IServerTargets - * @return The index of the target server with the - * {@link #getDefaultServerTargetId() default Id}; or 0, if it could not be found. - */ - public static int findDefaultServerTargetIndex(List targets) { - int index = 0; - for (int i = 0; i < targets.size(); i++) { - IRuntime target = (IRuntime) targets.get(i); - if (target.getId().equals(getDefaultServerTargetId())) { - index = i; - break; - } - } - return index; - } - - /** - * @param target - * The IServerTarget that has to be found in the given list; it can be - * <code>null</code> - * @param list - * The List from which the IServerTarget has to be found - * - * @return The index of the given target in the given list; or 0, if the given target could not - * be found in the given list. Two IServerTargets are considered to be equal if they - * have the same ID. - */ - public static int findIndexOf(IRuntime target, List list) { - int index = 0; - if (target != null) { - for (int i = 0; i < list.size(); i++) { - IRuntime element = (IRuntime) list.get(i); - if (element.equals(target)) { - index = i; - break; - } - } - } - return index; - } - - /** - * @return the Id of the target server that should be selected by default - */ - public static String getDefaultServerTargetId() { - String id = defaultExpressId; - if (J2EEPlugin.isEJBSupportAvailable()) { - id = defaultId; - } - return id; - } - - /** - * @param isJ2EE13 - * <code>true</code> if the constant for J2EE version 1.3 is desired - * @return IServerTargetConstants.J2EE_12 or IServerTargetConstants.J2EE_13 - */ - public static String getJ2EEVersion(boolean isJ2EE13) { - return isJ2EE13 ? IServerTargetConstants.J2EE_13 : IServerTargetConstants.J2EE_12; - } - - /** - * A convenient method that takes in a list of IServerTargets and returns an array of labels of - * the IServerTargets in the given list. - * - * @param serverTargets - * The list of IServerTargets - * @return An array lof labels of the IServerTargets in the given list - */ - public static String[] getServerNames(List serverTargets) { - String[] result = new String[serverTargets.size()]; - for (int i = 0; i < result.length; i++) { - IRuntime runtime = (IRuntime) serverTargets.get(i); - result[i] = runtime.getName() + " (" + runtime.getRuntimeType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - } - return result; - } - - /** - * @param prjName - * name of the project whose ServerTarget has to be retrieved; it can be - * <code>null</code> - * - * @return the ServerTarget of the given project; <code>null</code> if the project does not - * exist or its ServerTarget is not specified. - */ - public static IRuntime getServerTarget(String prjName) { - if (prjName != null && !prjName.trim().equals("")) { //$NON-NLS-1$ - IProject prj = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName); - if (prj != null && prj.exists()) { - return ServerCore.getProjectProperties(prj).getRuntimeTarget(); - } - } - return null; - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/SynchronizeWLPoperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/SynchronizeWLPoperation.java deleted file mode 100644 index f95ef37e7..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/SynchronizeWLPoperation.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Sep 15, 2003 - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jst.j2ee.internal.servertarget.ServerTargetHelper; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.web.internal.operation.ILibModule; - -/** - * Given a Web Project, this operation will sychronize all its Web Library Projects (WLPs), i.e., it - * will change the target server of all WLPs to that of the Web Project. - * - * @author Pratik Shah - */ -public class SynchronizeWLPoperation implements IHeadlessRunnableWithProgress { - private IProject prj; - - /** - * Constructor - * - * @param webProject - * A Web Project whose WLPs' target servers have to be changed - */ - public SynchronizeWLPoperation(IProject webProject) { - prj = webProject; - } - - /** - * Synchronizes all WLPs to have the same target server as the given Web project. - * - * @see org.eclipse.jst.j2ee.internal.internal.operations.IHeadlessRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) - */ - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - IRuntime target = ServerTargetUtil.getServerTarget(prj.getName()); - ILibModule[] wlps = getLibModules(); - monitor.beginTask(ProjectSupportResourceHandler.getString("Sync_WLP_Op"), wlps.length); //$NON-NLS-1$ - for (int i = 0; i < wlps.length; i++) { - IProject module = wlps[i].getProject(); - if (target != null) { - ServerTargetHelper.cleanUpNonServerTargetClasspath(module); - try { - ServerCore.getProjectProperties(module).setRuntimeTarget(target, monitor); - } catch (CoreException ce) { - // TODO - handle exception - } - } - monitor.worked(1); - } - monitor.done(); - } - - protected ILibModule[] getLibModules() { - //TODO this will throw class cast exception, do we use ILibModule anymore? - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(prj); - if (webEdit != null) - return (ILibModule[]) webEdit.getLibModules(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return new ILibModule[] {}; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/TemplateData.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/TemplateData.java deleted file mode 100644 index 092e80054..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/TemplateData.java +++ /dev/null @@ -1,94 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - - -public class TemplateData { - protected java.lang.String wtFileName = "";//$NON-NLS-1$ - protected java.lang.String wtCSSName = "";//$NON-NLS-1$ - protected java.lang.String wtContainerLocatoin = "";//$NON-NLS-1$ - protected java.lang.String taglibs; - - /** - * TemplateData constructor comment. - */ - public TemplateData() { - super(); - } - - /** - */ - public String getContainerLocatoin() { - return wtContainerLocatoin; - } - - /** - * Insert the method's description here. Creation date: (6/4/2001 5:24:30 PM) - * - * @return java.lang.String - */ - public java.lang.String getCSSName() { - return wtCSSName; - } - - /** - * Insert the method's description here. Creation date: (6/4/2001 5:22:56 PM) - * - * @return java.lang.String - */ - public String getFileName() { - return wtFileName; - } - - /** - * Insert the method's description here. Creation date: (11/15/2001 4:16:10 PM) - * - * @return java.lang.String - */ - public java.lang.String getTaglibs() { - return taglibs; - } - - /** - */ - public void setContainerLocatoin(String newFileName) { - wtContainerLocatoin = newFileName; - } - - /** - * Insert the method's description here. Creation date: (6/4/2001 5:24:30 PM) - * - * @param newCSSName - * java.lang.String - */ - public void setCSSName(java.lang.String newCSSName) { - wtCSSName = newCSSName; - } - - /** - * Insert the method's description here. Creation date: (6/4/2001 5:22:56 PM) - * - * @param newWtFileName - * java.lang.String - */ - public void setFileName(String newFileName) { - wtFileName = newFileName; - } - - /** - * Insert the method's description here. Creation date: (11/15/2001 4:16:10 PM) - * - * @param newTaglibs - * java.lang.String - */ - public void setTaglibs(java.lang.String newTaglibs) { - taglibs = newTaglibs; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebContentResourceChangeListener.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebContentResourceChangeListener.java deleted file mode 100644 index 0db02f59c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebContentResourceChangeListener.java +++ /dev/null @@ -1,99 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - - -/* - * This class listens for renames of a web project's web content folder. If the folder is renamed, - * the .websettings files is updated as well as the Java output folder. - */ -public class WebContentResourceChangeListener implements IResourceChangeListener { - - /** - * @see IResourceChangeListener#resourceChanged - */ - public void resourceChanged(final IResourceChangeEvent event) { - processDelta(event.getDelta()); - } - - - private void processDelta(IResourceDelta delta) { - // Get the affected resource - IResource resource = delta.getResource(); - - switch (resource.getType()) { - case IResource.ROOT : - // Iterate over changed projects under the root - IResourceDelta[] affectedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED); - for (int i = 0; i < affectedChildren.length; i++) { - processDelta(affectedChildren[i]); - } - break; - - case IResource.PROJECT : - // Only process web projects - /* IBaseWebNature nature = ModuleCore.getModuleCoreNature(org.eclipse.emf.common.util.URI.createURI("ADD MODULE URI")); - if (nature != null) - processWebProject(delta, (IProject) resource, nature);*/ - return; - - default : - return; - } - } - - - /* - * If renaming web content folder, then updated project properties. - */ - private void processWebProject(IResourceDelta delta, IProject project) { - IResourceDelta[] changedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED); - if (changedChildren.length == 1) - WebPropertiesUtil.synch(project, new NullProgressMonitor()); - IResourceDelta[] removedChildren = delta.getAffectedChildren(IResourceDelta.REMOVED); - if (removedChildren.length != 1 || !removedChildren[0].getResource().equals(getModuleServerRoot(project))) - return; - IResourceDelta[] addedChildren = delta.getAffectedChildren(IResourceDelta.ADDED); - if (addedChildren.length != 1) - return; - IPath newPath = addedChildren[0].getProjectRelativePath(); - if (newPath.segmentCount() != 1) - return; - String newName = newPath.segment(0); - try { - WebPropertiesUtil.updateWebContentNamePropertiesOnly(project, newName, new NullProgressMonitor()); - } catch (CoreException e) { - //Ignore - } - } - - protected IResource getModuleServerRoot(IProject project) { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - return (IResource) webEdit.getDeploymentDescriptorResource(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebEditModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebEditModel.java deleted file mode 100644 index 93aac0c3e..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebEditModel.java +++ /dev/null @@ -1,167 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - -import java.util.List; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.application.internal.operations.DefaultModuleProjectCreationOperation; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebAppResource; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webapplication.WelcomeFile; -import org.eclipse.jst.j2ee.webapplication.WelcomeFileList; -import org.eclipse.jst.j2ee.webservice.wsclient.WebServicesResource; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext; - -/** - * @deprecated - * Use - * <p> - * WebArtifactEdit - * </p> - * - */ - -public class WebEditModel extends org.eclipse.jst.j2ee.internal.J2EEEditModel { - /** - * @param editModelID - * @param context - * @param readOnly - */ - public WebEditModel(String editModelID, EMFWorkbenchContext context, boolean readOnly) { - super(editModelID, context, readOnly); - } - - /** - * @param editModelID - * @param context - * @param readOnly - * @param knownResourceURIs - * @param shouldAccessUnkownURIsAsReadOnly - */ - public WebEditModel(String editModelID, EMFWorkbenchContext context, boolean readOnly, boolean accessUnknownResourcesAsReadOnly) { - super(editModelID, context, readOnly, accessUnknownResourcesAsReadOnly); - - } - - // TODO -- mdelder isn't sure about this and needs to talk to jsholl -/* public J2EEWebNatureRuntime getWebNature() { - return J2EEWebNatureRuntime.getRuntime(getProject()); - }*/ - - /** - * Return the root object, the web app, from the web.xml DD. - */ - public WebApp getWebApp() { - Resource dd = getWebXmiResource(); - if (dd != null) { - EList extent = dd.getContents(); - if (extent.size() > 0) { - Object webApp = getRoot(dd); - if (webApp instanceof WebApp) - return (WebApp) webApp; - } - } - return null; - } - - - public WebAppResource getWebXmiResource() { - return (WebAppResource) getResource(J2EEConstants.WEBAPP_DD_URI_OBJ); - } - - public XMLResource getDeploymentDescriptorResource() { - return getWebXmiResource(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.workbench.J2EEEditModel#getRootObject() - */ - public Object getRootObject() { - return getWebApp(); - } - - public Resource makeDeploymentDescriptorWithRoot() { - org.eclipse.jst.j2ee.internal.common.XMLResource res = (org.eclipse.jst.j2ee.internal.common.XMLResource) createResource(J2EEConstants.WEBAPP_DD_URI_OBJ); - //TODO need to verify moduleVersion() - res.setModuleVersionID(getJ2EEVersion()); - addWebAppIfNecessary(res); - return res; - } - - protected int getJ2EEVersion() { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit != null) - return webEdit.getJ2EEVersion(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return 0; - } - - /** - * @param res - */ - private void addWebAppIfNecessary(XMLResource res) { - if (res != null && res.getContents().isEmpty()) { - WebApp webApp = WebapplicationFactory.eINSTANCE.createWebApp(); - res.getContents().add(webApp); - webApp.setDisplayName(getProject().getName()); - res.setID(webApp, J2EEConstants.WEBAPP_ID); - - WelcomeFileList wList = WebapplicationFactory.eINSTANCE.createWelcomeFileList(); - webApp.setFileList(wList); - List files = wList.getFile(); - WelcomeFile file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("index.html"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("index.htm"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("index.jsp"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("default.html"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("default.htm"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("default.jsp"); //$NON-NLS-1$ - files.add(file); - } - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.internal.workbench.J2EEEditModel#get13WebServicesClientResource() - */ - public WebServicesResource get13WebServicesClientResource() { - return (WebServicesResource) getResource(J2EEConstants.WEB_SERVICES_CLIENT_WEB_INF_DD_URI_OBJ); - } - - public String getDevelopmentAcivityID() { - return DefaultModuleProjectCreationOperation.WEB_DEV_ACTIVITY_ID; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebEditModelFactory.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebEditModelFactory.java deleted file mode 100644 index 1b3b5d6a8..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebEditModelFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Oct 27, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import java.util.Map; - -import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel; -import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory; - - -/** - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - * @deprecated - * Use - * <p> - * WebArtifactEdit - * </p> - */ -public class WebEditModelFactory extends EditModelFactory { - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#createEditModelForRead(java.lang.String, - * org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext) - */ - public EditModel createEditModelForRead(String editModelID, EMFWorkbenchContext context, Map params) { - return new WebEditModel(editModelID, context, true, isLoadKnownResourcesAsReadOnly()); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.internal.emfworkbench.integration.EditModelFactory#createEditModelForWrite(java.lang.String, - * org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext) - */ - public EditModel createEditModelForWrite(String editModelID, EMFWorkbenchContext context, Map params) { - return new WebEditModel(editModelID, context, false, isLoadKnownResourcesAsReadOnly()); - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebNatureRuntimeUtilities.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebNatureRuntimeUtilities.java deleted file mode 100644 index 54fd28350..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebNatureRuntimeUtilities.java +++ /dev/null @@ -1,230 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.wst.web.internal.operation.IBaseWebNature; -import org.eclipse.wst.web.internal.operation.StaticWebNatureRuntime; - - -public class WebNatureRuntimeUtilities { - /** - * WebNatureRuntimeHelper constructor comment. - */ - public WebNatureRuntimeUtilities() { - super(); - } - - /** - * Adds a nauture to a project - */ - protected static void addNatureToProject(IProject proj, String natureId) throws CoreException { - ProjectUtilities.addNatureToProject(proj, natureId); - } - - /** - * Create a new nature runtime from the project info - */ - public static IBaseWebNature createRuntime(WebProjectInfo info) throws CoreException { - IProject project = info.getProject(); - - // refresh WebProjectInfo for existing runtime - if (hasRuntime(project)) { - // this is for when the web nature is being changed, such - // as from converting from static to j2ee - IBaseWebNature runtime = getRuntime(project); - - if (J2EEWebNatureRuntime.hasRuntime(project)) - ((J2EEWebNatureRuntime) runtime).initializeFromInfo(info); - - - return runtime; - } - if (info.getWebProjectType() == IWebNatureConstants.J2EE_WEB_PROJECT) - addNatureToProject(project, IWebNatureConstants.J2EE_NATURE_ID); - else - addNatureToProject(project, IWebNatureConstants.STATIC_NATURE_ID); - - IBaseWebNature runtime = getRuntime(project); - if (info.getWebProjectType() == IWebNatureConstants.J2EE_WEB_PROJECT) - ((J2EEWebNatureRuntime) runtime).initializeFromInfo(info); - //No longer supporting for static projects -// else -// ((StaticWebNatureRuntime) runtime).initializeFromInfo(info); - - return runtime; - - } - - /** - * Creation date: (10/22/2001 2:17:25 PM) - * - * @return org.eclipse.jst.j2ee.internal.internal.internal.web.operations.IBaseWebNature - */ - public static IBaseWebNature getRuntime(IProject project) { - if (project == null) - return null; - try { - IBaseWebNature nature; - if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) - nature = (IBaseWebNature) project.getNature(IWebNatureConstants.J2EE_NATURE_ID); - else - nature = (IBaseWebNature) project.getNature("org.eclipse.wst.web.StaticWebNature"); - return nature; - } catch (CoreException e) { - return null; - } - } - - - /** - * Return the J2EE Web Nature for the given project. If the the project does not have a J2EE Web - * Nature, then return null. - * - * @param project - * The project to get the nature from - * @return IJ2EEWebNature The J2EE Web Nature - */ - public static J2EEWebNatureRuntime getJ2EERuntime(IProject project) { - IBaseWebNature nature = getRuntime(project); - if (nature != null) { - if (nature.isJ2EE()) - return (J2EEWebNatureRuntime) nature; - } - return null; - } - - /** - * Return the J2EE Web Nature for the given project. If the the project does not have a J2EE Web - * Nature, then return null. - * - * @param project - * The project to get the nature from - * @return IJ2EEWebNature The J2EE Web Nature - */ - public static StaticWebNatureRuntime getStaticRuntime(IProject project) { - IBaseWebNature nature = getRuntime(project); - if (nature != null) { - if (nature.isStatic()) - return (StaticWebNatureRuntime) nature; - } - return null; - } - - /** - * Return whether or not the project has a runtime created on it. - * - * @return boolean - * @param project - * com.ibm.itp.core.api.resources.IProject - * @deprecated - */ - public static boolean hasRuntime(IProject project) { - try { - return project.hasNature(IWebNatureConstants.J2EE_NATURE_ID); - } catch (CoreException e) { - return false; - } - } - - /** - * Return whether or not the project has a runtime created on it. - * - * @return boolean - * @param project - * com.ibm.itp.core.api.resources.IProject - */ - public static boolean hasStaticRuntime(IProject project) { - if (project == null || !project.exists()) { - return false; - } - try { - return project.hasNature(IWebNatureConstants.STATIC_NATURE_ID); - } catch (CoreException e) { - return false; - } - } - - /** - * Return whether or not the project has a runtime created on it. - * - * @return boolean - * @param project - * com.ibm.itp.core.api.resources.IProject - */ - public static boolean hasJ2EERuntime(IProject project) { - if (project == null || !project.exists()) { - return false; - } - try { - return project.hasNature(IWebNatureConstants.J2EE_NATURE_ID); - } catch (CoreException e) { - return false; - } - } - - public static String getDefaultJ2EEWebContentName() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getJ2EEWebContentFolderName(); - } - - public static String getDefaultStaticWebContentName() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getStaticWebContentFolderName(); - } - - public static IPath getDefaultJ2EEWebContentPath() { - return new Path(getDefaultJ2EEWebContentName()); - } - - public static String getContextRootFromWebProject(IProject project) { - - // get uri from web app display name, and get context root from web nature - IBaseWebNature nature = WebNatureRuntimeUtilities.getRuntime(project); - String contextRoot = ""; //$NON-NLS-1$ - contextRoot = nature.getContextRoot(); - - // WebEditModel webEditModel = null; - // try { - // webEditModel = (nature.isStatic()) - // ? null - // : - // ((J2EEWebNatureRuntime)nature).getWebAppEditModelForRead(WebNatureRuntimeUtilities.this); - // contextRoot = nature.getContextRoot(); - // } catch (Exception e) { - // e.printStackTrace(); - // } - // finally { - // if (webEditModel != null) - // webEditModel.releaseAccess(WebNatureRuntimeUtilities.this); - // } - return contextRoot; - } - - public static IPath getDefaultWEBINFPath() { - return getDefaultJ2EEWebContentPath().append(IWebNatureConstants.INFO_DIRECTORY); - } - - public static IPath getDefaultWebOutputFolderPath() { - return getDefaultWEBINFPath().append(IWebNatureConstants.CLASSES_DIRECTORY); - } - - public static IPath getWebOutputFolderPath(String webContentName) { - return new Path(webContentName).append(IWebNatureConstants.INFO_DIRECTORY).append(IWebNatureConstants.CLASSES_DIRECTORY); - } - - public static String getDefaultJavaSourceName() { - return J2EEPlugin.getDefault().getJ2EEPreferences().getJavaSourceFolderName(); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectFeatureUpdateOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectFeatureUpdateOperation.java deleted file mode 100644 index 870fa5b9a..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectFeatureUpdateOperation.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; - - -/** - * @version 1.0 - * @author - */ -public class WebProjectFeatureUpdateOperation implements IHeadlessRunnableWithProgress { - - protected WebProjectInfo webProjectInfo; - //protected J2EEWebNatureRuntime nature; - - - public WebProjectFeatureUpdateOperation(WebProjectInfo projectInfo) { - webProjectInfo = projectInfo; - IProject project = webProjectInfo.getProject(); - //nature = (J2EEWebNatureRuntime) J2EEWebNatureRuntimeUtilities.getRuntime(project); - } - - /* - * @see IHeadlessRunnableWithProgress#run(IProgressMonitor) - */ - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - - String[] featureIDs = webProjectInfo.getFeatureIds(); - - try { - - //TODO set featureID's on module - - /* if (featureIDs != null && featureIDs.length > 0) - nature.setFeatureIds(featureIDs);*/ - - } catch (Exception e) { - throw new InvocationTargetException(e); - } - - } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectInfo.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectInfo.java deleted file mode 100644 index 48b83d278..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectInfo.java +++ /dev/null @@ -1,641 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - - -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.Vector; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - - -/** - * The WebProjectInfo is used to set up the Java project info like the J2EE specification level,java - * class path,project nature project location, associated EAR project location, for a new Web - * project creation - * - * @deprecated - * Use - * <p> - * WebArtifactEdit - * </p> - */ - -public class WebProjectInfo extends org.eclipse.jst.j2ee.internal.project.J2EEJavaProjectInfo implements IWebProjectWizardInfo { - - private String fContextRoot = null; - - public boolean fJ2EEWebProject = true; - - public final static String J2EE_VERSION_1_2 = "J2EE_1_2"; //$NON-NLS-1$ - public final static String J2EE_VERSION_1_3 = "J2EE_1_3"; //$NON-NLS-1$ - public final static String J2EE_VERSION_1_4 = "J2EE_1_4"; //$NON-NLS-1$ - - - public static final String PROPERTY_EAR_PROJECT_NAME = "EAR name"; //$NON-NLS-1$ - public static final String PROPERTY_J2EE_VERSION = "J2EE level"; //$NON-NLS-1$ - public static final String PROPERTY_PROJECT_NAME = "Project name"; //$NON-NLS-1$ - public static final String PROPERTY_SERVER_TARGET = "Server Target"; //$NON-NLS-1$ - - protected int fJSPLevel; - protected int fServletLevel; - protected IProject wtWebProject; - protected String wtProjectName; - protected IPath wtProjectLocation; - protected String wtEarProjectName; - protected String fWebContentName; - protected String fJavaSourceName; - protected IProject wtEarProject; - protected IPath wtEarProjectLocation; - protected boolean wtExampleProject = false; - protected boolean synch = false; - protected Vector wtFeatureIds = new Vector(); - - protected PropertyChangeSupport listeners; - - /** - * Additional property Hashtable - */ - protected Hashtable wtPropertyTable = new Hashtable(10, 20); - - public WebProjectInfo() { - super(); - } - - /** - * NOTE: Notification for all properties is not implemented yet. - * - * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.lang.String, - * java.beans.PropertyChangeListener) - */ - public void addPropertyChangeListener(String property, PropertyChangeListener listener) { - if (listeners == null) { - listeners = new PropertyChangeSupport(this); - } - listeners.addPropertyChangeListener(property, listener); - } - - /** - * NOTE: Notification for all properties is not implemented yet. - * - * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.lang.String, - * java.beans.PropertyChangeListener) - */ - public void removePropertyChangeListener(String property, PropertyChangeListener listener) { - if (listeners != null) { - listeners.removePropertyChangeListener(property, listener); - } - } - - public void addServerJarsToClasspathEntries() { - // The jars to be added are different based on the level of J2EE supported - // by the project. - addToClasspathEntries(getWASClasspathEntries()); - } - - public IClasspathEntry[] getWASClasspathEntries() { - List list = new ArrayList(4); - //TODO This class needs to be deleted. - // if (!org.eclipse.jst.j2ee.internal.internal.plugin.J2EEPlugin.hasDevelopmentRole()) { - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/j2ee.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/servletevent.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/ivjejb35.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/runtime.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/pagelist.jar"), null, null)); //$NON-NLS-1$ GMR - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/webcontainer.jar"), null, null)); //$NON-NLS-1$ GMR - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/xalan.jar"), null, null)); //$NON-NLS-1$ GMR - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/als.jar"), null, null)); //$NON-NLS-1$ GMR - // } else if (isJ2EE13()) { - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/j2ee.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/servletevent.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/ivjejb35.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_50_PLUGINDIR_VARIABLE - // + "/lib/runtime.jar"), null, null)); //$NON-NLS-1$ - // } else { - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_PLUGINDIR_VARIABLE + - // "/lib/j2ee.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_PLUGINDIR_VARIABLE + - // "/lib/webcontainer.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_PLUGINDIR_VARIABLE + - // "/lib/ivjejb35.jar"), null, null)); //$NON-NLS-1$ - // list.add(JavaCore.newVariableEntry(new Path(IEJBNatureConstants.WAS_PLUGINDIR_VARIABLE + - // "/lib/websphere.jar"), null, null)); //$NON-NLS-1$ - // } - - return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]); - } - - /** - * Return the standard classpath for ejb project. - */ - protected IClasspathEntry[] computeDefaultJavaClasspath() { - - super.computeDefaultJavaClasspath(); - IJavaProject javaProject = getJavaProject(); - if (javaProject == null) - return null; - - addWASJarsToClasspathEntries(); - return classpathEntries; - } - - /** - * Return the context root. - * - * @deprecated Use getContextRoot() - * @return java.lang.String - */ - public String getDefaultContextRoot() { - return getContextRoot(); - } - - public String getContextRoot() { - if (fContextRoot != null) - return fContextRoot; - return wtProjectName; - } - - /** - * Subclasses should override as necessary - */ - protected String getDefaultJavaOutputPath() { - - StringBuffer buf = new StringBuffer(getWebContentName()); - buf.append(IPath.SEPARATOR); - buf.append(IWebNatureConstants.INFO_DIRECTORY); - buf.append(IPath.SEPARATOR); - buf.append(IWebNatureConstants.CLASSES_DIRECTORY); - return buf.toString(); - } - - protected String getDefaultSourcePath() { - return getJavaSourceName(); - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public java.lang.String getDefaultUri() { - return wtProjectName.replace(' ', '_') + ".war";//$NON-NLS-1$ - } - - public String[] getFeatureIds() { - return (String[]) wtFeatureIds.toArray(new String[wtFeatureIds.size()]); - } - - /** - * Insert the method's description here. Creation date: (10/31/2001 3:10:01 PM) - * - * @return boolean - */ - public int getWebProjectType() { - if (fJ2EEWebProject) - return IWebNatureConstants.J2EE_WEB_PROJECT; - - return 0; - } - - public boolean isJ2EEWebProject() { - return fJ2EEWebProject; - } - - public boolean isJSP11() { - return fJSPLevel == J2EEVersionConstants.JSP_1_1_ID; - } - - public boolean isServlet22() { - return fServletLevel == J2EEVersionConstants.SERVLET_2_2; - } - - /** - * @deprecated - Use getModuleVersion() with J2EEVersionConstants - */ - /** - * Set the corresponding jsp and servlet levels. Creation date: (11/09/00 10:05:24 AM) - */ - public void setJ2EEVersion(String newLevel) { - if (newLevel.equals(J2EE_VERSION_1_2)) { - fJSPLevel = J2EEVersionConstants.JSP_1_1_ID; - fServletLevel = J2EEVersionConstants.SERVLET_2_2; - } else if (newLevel.equals(J2EE_VERSION_1_3)) { - fJSPLevel = J2EEVersionConstants.JSP_1_2_ID; - fServletLevel = J2EEVersionConstants.SERVLET_2_3; - } else { - fJSPLevel = J2EEVersionConstants.JSP_2_0_ID; - fServletLevel = J2EEVersionConstants.SERVLET_2_4; - } - } - - public boolean isJ2EE13() { - return (isServlet22() && !isJSP11()); - } - - /** - * Is this project being created for an example. Creation date: (10/31/2001 3:10:01 PM) - * - * @return boolean - */ - public boolean isWebExample() { - return wtExampleProject; - } - - public void setContextRoot(java.lang.String contextRoot) { - fContextRoot = contextRoot; - } - - public void addFeatureId(java.lang.String featureId) { - wtFeatureIds.add(featureId); - } - - public void removeFeatureId(java.lang.String featureId) { - wtFeatureIds.remove(featureId); - - } - - public void setFeatureIds(java.lang.String[] featureIds) { - wtFeatureIds = new Vector(); - for (int i = 0; i < featureIds.length; i++) - wtFeatureIds.add(featureIds[i]); - } - - - /** - * Insert the method's description here. Creation date: (10/31/2001 3:10:01 PM) - * - * @param newFIsStaticWebProject - * boolean - */ - public void setWebProjectType(boolean j2eeWebProject) { - fJ2EEWebProject = j2eeWebProject; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public int getJSPLevel() { - return fJSPLevel; - - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public int getServletLevel() { - return fServletLevel; - } - - /** - * This method is required as a separate method so that there are no inconsistencies when firing - * notifications caused due to change in either the JSP level or the Servlet level (through the - * setJSPLevel or setServletLevel methods), but not both. - */ - protected void updateJ2EELevel(String newLevel) { - if (newLevel.equals(J2EE_VERSION_1_2)) { - fJSPLevel = J2EEVersionConstants.JSP_1_1_ID; - fServletLevel = J2EEVersionConstants.SERVLET_2_2; - } else if (newLevel.equals(J2EE_VERSION_1_3)) { - fJSPLevel = J2EEVersionConstants.JSP_1_2_ID; - fServletLevel = J2EEVersionConstants.SERVLET_2_3; - } else { - fJSPLevel = J2EEVersionConstants.JSP_2_0_ID; - fServletLevel = J2EEVersionConstants.SERVLET_2_4; - } - - String oldValue = isJ2EE13() ? J2EE_VERSION_1_2 : J2EE_VERSION_1_3; - firePropertyChange(PROPERTY_J2EE_VERSION, oldValue, newLevel); - } - - /** - * @see java.beans.PropertyChangeSupport#firePropertyChange(java.lang.String, java.lang.Object, - * java.lang.Object) - */ - protected void firePropertyChange(String property, Object oldValue, Object newValue) { - if (listeners != null) { - listeners.firePropertyChange(property, oldValue, newValue); - } - } - - public String getJ2EELevel() { - String level = J2EE_VERSION_1_3; - if (!isJ2EE13()) { - level = J2EE_VERSION_1_2; - } - return level; - } - - /** - * The J2EE level and the individual Servlet and JSP levels are always in sync now. - * - * Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public void setJSPLevel(int newLevel) { - fJSPLevel = newLevel; - - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public void setServletLevel(int newLevel) { - fServletLevel = newLevel; - } - - /** - * Return an Object for the assocated properties or null - */ - public Object getProperty(String propertyName) { - - return wtPropertyTable.get(propertyName); - } - - /** - * Set an Object for the assocated properties or null - */ - public void setProperty(String propertyName, Object value) { - wtPropertyTable.put(propertyName, value); - return; - } - - /** - * Return the project being created; checks the workspace for an existing project - */ - public IProject getProject() { - if (wtWebProject == null && getProjectName() != null) { - IProject aProject = getWorkspace().getRoot().getProject(getProjectName()); - if (aProject.exists()) - wtWebProject = aProject; - } - return wtWebProject; - } - - /** - * Return the location of the project in the file system. - * - * @return org.eclipse.core.runtime.IPath - */ - public IPath getProjectLocation() { - return wtProjectLocation; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public java.lang.String getProjectName() { - if (wtProjectName == null) - if (wtWebProject != null) - wtProjectName = wtWebProject.getName(); - return wtProjectName; - } - - public IPath getProjectPath() { - return new Path(getProjectName()); - } - - /** - * Return the project being created; checks the workspace for an existing project - */ - public IProject getEARProject() { - wtEarProject = null; - if (!((getEARProjectName().trim()).length() == 0)) { - IProject aProject = getWorkspace().getRoot().getProject(getEARProjectName()); - if (aProject.exists()) - wtEarProject = aProject; - } - - return wtEarProject; - } - - /** - * Return the location of the project in the file system. - * - * @return org.eclipse.core.runtime.IPath - */ - public IPath getEARProjectLocation() { - return wtEarProjectLocation; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @return java.lang.String - */ - public java.lang.String getEARProjectName() { - return wtEarProjectName; - } - - public IPath getEARProjectPath() { - return new Path(getEARProjectName()); - } - - public void setProject(IProject aProject) { - fJSPLevel = getJSPVersion(); - fServletLevel = getServletVersion(); - wtWebProject = aProject; - super.setProject(aProject); - } - - protected int getJSPVersion() { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit != null) - return webEdit.getJSPVersion(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return 0; - } - - protected int getServletVersion() { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit != null) - return webEdit.getServletVersion(); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - return 0; - } - - /** - * Set the location in the file system that the project is to be created. - * - * @param newProjectLocation - * IPath - */ - public void setProjectLocation(IPath newProjectLocation) { - wtProjectLocation = newProjectLocation; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @param newProjectName - * java.lang.String - */ - public void setProjectName(java.lang.String newProjectName) { - if ((wtProjectName == null && newProjectName != null) || (wtProjectName != null && !wtProjectName.equals(newProjectName))) { - setClasspathEntries(null); - } - wtProjectName = newProjectName; - } - - public void setEARProject(IProject aProject) { - wtEarProject = aProject; - } - - /** - * Set the location in the file system that the project is to be created. - * - * @param newProjectLocation - * IPath - */ - public void setEARProjectLocation(IPath newProjectLocation) { - wtEarProjectLocation = newProjectLocation; - } - - /** - * Insert the method's description here. Creation date: (11/09/00 10:05:24 AM) - * - * @param newProjectName - * java.lang.String - */ - public void setEARProjectName(java.lang.String newProjectName) { - if ((newProjectName != null && !newProjectName.equals(wtEarProjectName)) || (newProjectName == null && wtEarProjectName != null)) { - //do nothing for now - } - wtEarProjectName = newProjectName; - } - - - /** - * Insert the method's description here. Creation date: (10/31/2001 3:10:01 PM) - * - * @param newFIsStaticWebProject - * boolean - */ - public void setWebExample(boolean exampleProject) { - wtExampleProject = exampleProject; - } - - /** - * @see J2EEJavaProjectInfo#getJavaProject() - */ - public IJavaProject getJavaProject() { - return super.getJavaProject(); - } - - - /** - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.operations.IWebProjectWizardInfo#getWebContentName() - */ - public String getWebContentName() { - if (fWebContentName == null) - fWebContentName = isJ2EEWebProject() ? J2EEPlugin.getDefault().getJ2EEPreferences().getJ2EEWebContentFolderName() : J2EEPlugin.getDefault().getJ2EEPreferences().getStaticWebContentFolderName(); - return fWebContentName; - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.operations.IWebProjectWizardInfo#setWebContentName(String) - */ - public void setWebContentName(String name) { - fWebContentName = name; - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.operations.IWebProjectWizardInfo#getJavaSourceName() - */ - public String getJavaSourceName() { - if (fJavaSourceName == null) - fJavaSourceName = J2EEPlugin.getDefault().getJ2EEPreferences().getJavaSourceFolderName(); - return fJavaSourceName; - } - - /** - * @see org.eclipse.jst.j2ee.internal.internal.internal.web.operations.IWebProjectWizardInfo#setJavaSourceName(String) - */ - public void setJavaSourceName(String name) { - fJavaSourceName = name; - } - - /** - * In addition to setting the server target, this method also sets the server target type. - * WebProjectInfo clients don't need to worry about setting the target type. - * - * @see org.eclipse.jst.j2ee.internal.internal.j2eeproject.J2EEJavaProjectInfo#setServerTarget(com.ibm.etools.server.target.IServerTarget) - */ - /* - * public void setServerTarget(IServerTarget target) { if( (target != null && - * !target.equals(getServerTarget())) || (target == null && getServerTarget() != null) ){ - * IServerTarget oldTarget = getServerTarget(); super.setServerTarget(target); - * - * ITargetType targetType = null; if( getServerTarget() != null ){ Iterator iterator = - * getServerTarget().getTargets().iterator(); while (iterator.hasNext()) { ITargetType type = - * (ITargetType) iterator.next(); if (IServerTargetConstants.WEB_TYPE.equals(type.getId())){ - * targetType = type; break; } } } setServerTargetType(targetType); - * - * firePropertyChange(PROPERTY_SERVER_TARGET, oldTarget, target); } } - */ - public void setSynchronizeWLPs(boolean synch) { - this.synch = synch; - } - - public boolean getSynchronizeWLPs() { - return synch; - } - - protected void addWASJarsToClasspathEntries() { - // The jars to be added are different based on the level of J2EE supported - // by the project. - addToClasspathEntries(getWASClasspathEntries()); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectPropertiesUpdateOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectPropertiesUpdateOperation.java deleted file mode 100644 index 7124cbdea..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebProjectPropertiesUpdateOperation.java +++ /dev/null @@ -1,135 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.internal.core.ClasspathEntry; -import org.eclipse.jst.j2ee.internal.web.archive.operations.ContextRootUpdateOperation; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebContentNameUpdateOperation; -import org.eclipse.wst.common.frameworks.internal.operations.IHeadlessRunnableWithProgress; - -/** - * @version 1.0 - * @author - */ -public class WebProjectPropertiesUpdateOperation implements IHeadlessRunnableWithProgress { - - protected WebProjectInfo webProjectInfo; -// protected J2EEWebNatureRuntime nature; - - - public WebProjectPropertiesUpdateOperation(WebProjectInfo projectInfo) { - webProjectInfo = projectInfo; - IProject project = webProjectInfo.getProject(); - //nature = (J2EEWebNatureRuntime) J2EEWebNatureRuntimeUtilities.getRuntime(project); - } - - /* - * @see IHeadlessRunnableWithProgress#run(IProgressMonitor) - */ - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - - IProject project = webProjectInfo.getProject(); - - // Update the context root - String contextRoot = webProjectInfo.getContextRoot(); - if (contextRoot != null) { - new ContextRootUpdateOperation(project, contextRoot).run(monitor); - } - - // Update the web content name - String webContentName = webProjectInfo.getWebContentName(); - if (webContentName != null) { - new WebContentNameUpdateOperation(project, webContentName).run(monitor); - } - - // Update the Servlet and JSP Levels - int servletLevel = webProjectInfo.getServletLevel(); - int jspLevel = webProjectInfo.getJSPLevel(); - - try { - updateClassPathEntries(monitor); - //TODO setOn Module forwrite - /* if (servletLevel != null) - nature.setServletLevel(servletLevel); - if (jspLevel != null) - nature.setJSPLevel(jspLevel); - -*/ - } catch (Exception e) { - throw new InvocationTargetException(e); - } - - } - - protected IClasspathEntry[] getClasspathsFromWebProjectInfo(WebProjectInfo wpInfo) { - IClasspathEntry[] wasClasspath = wpInfo.getWASClasspathEntries(); - IClasspathEntry[] serverJdkClasspath = wpInfo.getServerJDKClasspathEntries(); - List list = new ArrayList(wasClasspath.length + serverJdkClasspath.length); - list.addAll(Arrays.asList(wasClasspath)); - list.addAll(Arrays.asList(serverJdkClasspath)); - - ClasspathEntry[] ret = new ClasspathEntry[list.size()]; - return (IClasspathEntry[]) list.toArray(ret); - } - - - protected IClasspathEntry[] getOldDefaultClasspath() { - WebProjectInfo wpInfo = new WebProjectInfo(); - //TODO switch to module level -/* wpInfo.setProject(nature.getProject()); - wpInfo.setJSPLevel(nature.getJSPLevel()); - wpInfo.setServletLevel(nature.getServletLevel());*/ - return getClasspathsFromWebProjectInfo(wpInfo); - } - - protected IClasspathEntry[] getDefaultClasspath() { - WebProjectInfo wpInfo = new WebProjectInfo(); - //TODO switch to Module level - /* wpInfo.setProject(nature.getProject()); - wpInfo.setJSPLevel(webProjectInfo.getJSPLevel()); - wpInfo.setServletLevel(webProjectInfo.getServletLevel());*/ - return getClasspathsFromWebProjectInfo(wpInfo); - } - - - - protected void updateClassPathEntries(IProgressMonitor monitor) throws InvocationTargetException { - IProject project = webProjectInfo.getProject(); - try { - if (project.hasNature(JavaCore.NATURE_ID)) { - IJavaProject javaProject = JavaCore.create(project); - IClasspathEntry[] existingClasspath = javaProject.getRawClasspath(); - IClasspathEntry[] oldDefaultClasspath = getOldDefaultClasspath(); - IClasspathEntry[] defaultClasspath = getDefaultClasspath(); - IClasspathEntry[] newClasspath = ClasspathUtilities.removeClasspathEntries(existingClasspath, oldDefaultClasspath); - newClasspath = ClasspathUtilities.addClasspathEntries(newClasspath, defaultClasspath); - javaProject.setRawClasspath(newClasspath, monitor); - } - } catch (JavaModelException e) { - throw new InvocationTargetException(e); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java deleted file mode 100644 index 4ef7caefb..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java +++ /dev/null @@ -1,564 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; -import java.util.StringTokenizer; -import java.util.Vector; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.StructureEdit; - -public class WebPropertiesUtil { - //private static final char[] BAD_CHARS = {'/', '\\', ':'}; - private static final char[] BAD_CHARS = {':'}; - public static final String DEFAULT_JAVA_SOURCE_NAME = "Java Source"; //$NON-NLS-1$ - - /** - * Update the Web Content folder to a new value if it is different. This applies to both Static - * and J2EE Web Projects. In the case of a J2EE Project, the library classpath entries will be - * modifies to reflect the new location. - * - * @param project - * The Web Project to update - * @param webContentName - * The new name given to the Web Project's Web Content folder - * @param progressMonitor - * Indicates progress of the update operation - * @return True if the web content rename was actually renamed, false if unneeded. - * @throws CoreException - * The exception that occured during renaming of the the project's web content - * folder - */ - public static boolean updateWebContentNameAndProperties(IProject project, String webContentName, IProgressMonitor progressMonitor) throws CoreException { - boolean success = false; - if (project.exists() && project.isOpen()) { - - /* IBaseWebNature webNature = J2EEWebNatureRuntimeUtilities.getRuntime(project); - if (webContentName == null) { - if (webNature.isStatic()) { - webContentName = J2EEWebNatureRuntimeUtilities.getDefaultStaticWebContentName(); - } else { - webContentName = J2EEWebNatureRuntimeUtilities.getDefaultJ2EEWebContentName(); - } - }*/ - - IPath newPath = new Path(webContentName); - if (getModuleServerRoot(project).getProjectRelativePath().equals(newPath)) - return false; - if (project.exists(newPath)) { - IStatus status = new Status(IStatus.ERROR, "org.eclipse.jst.j2ee", IStatus.OK, ProjectSupportResourceHandler.getString("Could_not_rename_____2", new Object[]{webContentName}), null); //$NON-NLS-1$ //$NON-NLS-2$ - throw new CoreException(status); - } - - moveWebContentFolder(project, webContentName, progressMonitor); - updateWebContentNamePropertiesOnly(project, webContentName, progressMonitor); - success = true; - } - return success; - } - - /** - * Update the classpath entries and Server Root Name for this web project only. - * - * @param project - * @param webContentName - * @return - */ - public static void updateWebContentNamePropertiesOnly(IProject project, String webContentName, IProgressMonitor progressMonitor) throws CoreException { - IPath newPath = new Path(webContentName); - if (getModuleServerRoot(project).equals(newPath)) - return; - - if (!getModuleServerRoot(project).equals(webContentName)) { - - //if (webModuleArtifact.isJ2EE) { - // Update the library references - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - - IClasspathEntry[] classpath = javaProject.getRawClasspath(); - IClasspathEntry[] newClasspath = new IClasspathEntry[classpath.length]; - - for (int i = 0; i < classpath.length; i++) { - if (classpath[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) { - IClasspathEntry library = classpath[i]; - IPath libpath = library.getPath(); - IPath modServerRootPath = getModuleServerRoot(project).getFullPath(); - if (modServerRootPath.isPrefixOf(libpath)) { - IPath prunedPath = libpath.removeFirstSegments(modServerRootPath.segmentCount()); - IPath relWebContentPath = new Path(webContentName + "/" + prunedPath.toString()); //$NON-NLS-1$ - IResource absWebContentPath = project.getFile(relWebContentPath); - - IPath srcAttachmentPath = library.getSourceAttachmentPath(); - if(null != srcAttachmentPath){ - prunedPath = srcAttachmentPath.removeFirstSegments(modServerRootPath.segmentCount()); - } - IResource absWebContentSrcAttachmentPath = project.getFile(relWebContentPath); - - newClasspath[i] = JavaCore.newLibraryEntry(absWebContentPath.getFullPath(), absWebContentSrcAttachmentPath.getFullPath(), library.getSourceAttachmentRootPath(), library.isExported()); - - } else { - newClasspath[i] = classpath[i]; - } - - } else { - newClasspath[i] = classpath[i]; - } - // } - - // Set the java output folder - IFolder outputFolder = project.getFolder(getModuleServerRoot(project).getFullPath()); - javaProject.setRawClasspath(newClasspath, outputFolder.getFullPath(), new SubProgressMonitor(progressMonitor, 1)); - } - //update websettings - //TODO add to WebArtifactEdit - //webNature.setModuleServerRootName(webContentName); - } - } - - /** - * Moves the web content folder to the name indicated only if that path doesn't already exist in - * the project. - * - * @param project - * The web project to be updated. - * @param webContentName - * The new web content name - * @param progressMonitor - * Indicates progress - * @throws CoreException - * The exception that occured during move operation - */ - public static void moveWebContentFolder(IProject project, String webContentName, IProgressMonitor progressMonitor) throws CoreException { - IPath newPath = new Path(webContentName); - if (!project.exists(newPath)) { - if (newPath.segmentCount() > 1) { - for (int i = newPath.segmentCount() - 1; i > 0; i--) { - IPath tempPath = newPath.removeLastSegments(i); - IFolder tempFolder = project.getFolder(tempPath); - if (!tempFolder.exists()) { - tempFolder.create(true, true, null); - } - } - } - newPath = project.getFullPath().append(newPath); - IContainer webContentRoot = getModuleServerRoot(project); - IPath oldPath = webContentRoot.getProjectRelativePath(); - webContentRoot.move(newPath, IResource.FORCE | IResource.KEEP_HISTORY, new SubProgressMonitor(progressMonitor, 1)); - for (int i = 0; i < oldPath.segmentCount(); i++) { - IPath tempPath = oldPath.removeLastSegments(i); - IFolder tempFolder = project.getFolder(tempPath); - if (tempFolder.exists() && tempFolder.members().length == 0) { - tempFolder.delete(true, true, null); - } - } - } - } - - /** - * Synchonizies the class path and the lib directories to catch any changes from the last use - * Creation date: (4/17/01 11:48:12 AM) - */ - protected static void synch(IProject project, IProgressMonitor monitor) { - - try { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(ProjectSupportResourceHandler.getString("Sychronize_Class_Path_UI_"), 4); //$NON-NLS-1$ - //$NON-NLS-1$ = "Sychronize Class Path" - - IFolder lib_folder = getWebLibFolder(project); - //Nothing to do if the lib folder does not exist. - if (lib_folder == null || !lib_folder.isAccessible()) - return; - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - IPath lib_path = lib_folder.getProjectRelativePath(); - IPath lib_full_path = lib_folder.getFullPath(); - - IClasspathEntry[] cp = javaProject.getRawClasspath(); - - boolean needsToBeModified = false; - //Create a map of the lib projects in the current project - Hashtable lib_jars = new Hashtable(); - IResource[] children = lib_folder.members(); - monitor.subTask(ProjectSupportResourceHandler.getString("Catalog_Lib_Directory__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Catalog Lib Directory:" - for (int j = 0; j < children.length; j++) { - IResource child = children[j]; - //monitor.setTaskName(ResourceHandler.getString("Catalog_Lib_Directory__UI_") + - // child); //$NON-NLS-1$ = "Catalog Lib Directory:" - //Make sure it is a zip or a jar file - if (child.getType() == IResource.FILE && (child.getFullPath().toString().toLowerCase().endsWith(".jar") //$NON-NLS-1$ - || child.getFullPath().toString().toLowerCase().endsWith(".zip"))) { //$NON-NLS-1$ - lib_jars.put(child.getFullPath(), child); - } - - } - - monitor.worked(1); - monitor.subTask(ProjectSupportResourceHandler.getString("Update_ClassPath__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Update ClassPath:" - //Loop through all the classpath dirs looking for ones that may have - //been deleted - Vector newClassPathVector = new Vector(); - for (int j = 0; j < cp.length; j++) { - - //If it is a lib_path - if (cp[j].getPath().toString().startsWith(lib_path.toString()) || cp[j].getPath().toString().startsWith(lib_full_path.toString())) { - //It was already in the class path - if (lib_jars.get(cp[j].getPath()) != null) { - newClassPathVector.add(cp[j]); - //Remove it from the hash table of paths to add back - //monitor.setTaskName(ResourceHandler.getString("Catalog_Lib_Directory__UI_") - // + cp[j].getPath()); //$NON-NLS-1$ = "Catalog Lib Directory:" - lib_jars.remove(cp[j].getPath()); - - } else { - //You have removed something form the class path you - //will need to re-build - //monitor.setTaskName(ResourceHandler.getString("Catalog_Lib_Directory_Remo_UI_") - // + cp[j].getPath()); //$NON-NLS-1$ = "Catalog Lib Directory:Remove " - needsToBeModified = true; - } - } else { - monitor.subTask(ProjectSupportResourceHandler.getString("Catalog_Lib_Directory__UI_") + cp[j].getPath()); //$NON-NLS-1$ - //$NON-NLS-1$ = "Catalog Lib Directory:" - newClassPathVector.add(cp[j]); - } - } - monitor.worked(1); - monitor.subTask(ProjectSupportResourceHandler.getString("Update_ClassPath__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Update ClassPath:" - - //Add any entries not already found - Enumeration aenum = lib_jars.keys(); - while (aenum.hasMoreElements()) { - IPath path = (IPath) aenum.nextElement(); - newClassPathVector.add(JavaCore.newLibraryEntry(path, null, null)); - //You have added something form the class path you - //will need to re-build - //monitor.setTaskName(ResourceHandler.getString("23concat_UI_", (new Object[] { - // path }))); //$NON-NLS-1$ = "Catalog Lib Directory:Add {0}" - needsToBeModified = true; - } - - monitor.worked(1); - monitor.subTask(ProjectSupportResourceHandler.getString("Set_ClassPath__UI_")); //$NON-NLS-1$ - //$NON-NLS-1$ = "Set ClassPath:" - - //Tansfer the vector to an array - IClasspathEntry[] newClassPathArray = new IClasspathEntry[newClassPathVector.size()]; - - for (int j = 0; j < newClassPathArray.length; j++) { - newClassPathArray[j] = (IClasspathEntry) newClassPathVector.get(j); - } - - //Only change the class path if there has been a modification - if (needsToBeModified) { - - try { - javaProject.setRawClasspath(newClassPathArray, monitor); - } catch (Exception e) { - Logger.getLogger().log(e); - } - } - - } catch (ClassCastException ex) { - Logger.getLogger().log(ex); - } catch (CoreException ex) { - Logger.getLogger().log(ex); - } finally { - monitor.done(); - } - } - - public static void updateContextRoot(IProject project, String contextRoot) { - if (project.exists() && project.isOpen()) { - WebArtifactEdit webEdit = null; - try { - webEdit = (WebArtifactEdit) StructureEdit.getFirstArtifactEditForRead(project); - if (webEdit != null) - webEdit.setServerContextRoot(contextRoot); - } finally { - if (webEdit != null) - webEdit.dispose(); - } - - } - } - - - /** - * @param project - * org.eclipse.core.resources.IProject - */ - /** - * Returns a error message that states whether a context root is valid or not returns null if - * context root is fine - * - * @return java.lang.String - * @param contextRoot - * java.lang.String - */ - public static String validateContextRoot(String contextRoot) { - - if (contextRoot == null) - return null; - - String errorMessage = null; - - String name = contextRoot; - if (name.equals("") || name == null) { //$NON-NLS-1$ - // this was added because the error message shouldnt be shown initially. It should be - // shown only if context root field is edited to - errorMessage = ProjectSupportResourceHandler.getString("Context_Root_cannot_be_empty_2"); //$NON-NLS-1$ - return errorMessage; - } - - /******************************************************************************************* - * // JZ - fix to defect 204264, "/" is valid in context root if (name.indexOf("//") != -1) { - * //$NON-NLS-1$ errorMessage = "// are invalid characters in a resource name"; return - * errorMessage; } - ******************************************************************************************/ - - if (name.trim().equals(name)) { - StringTokenizer stok = new StringTokenizer(name, "."); //$NON-NLS-1$ - outer : while (stok.hasMoreTokens()) { - String token = stok.nextToken(); - for (int i = 0; i < token.length(); i++) { - if (!(token.charAt(i) == '_') && !(token.charAt(i) == '-') && !(token.charAt(i) == '/') && Character.isLetterOrDigit(token.charAt(i)) == false) { - if (Character.isWhitespace(token.charAt(i))) { - //Removed because context roots can contain white space - //errorMessage = - // ResourceHandler.getString("_Context_root_cannot_conta_UI_");//$NON-NLS-1$ - // = " Context root cannot contain whitespaces." - } else { - errorMessage = ProjectSupportResourceHandler.getString("The_character_is_invalid_in_a_context_root", new Object[]{(new Character(token.charAt(i))).toString()}); //$NON-NLS-1$ - break outer; - } - } - } - } - } // en/ end of if(name.trim - else - errorMessage = ProjectSupportResourceHandler.getString("Names_cannot_begin_or_end_with_whitespace_5"); //$NON-NLS-1$ - - return errorMessage; - } - - - /** - * Return true if the string contains any of the characters in the array. - */ - private static boolean contains(String str, char[] chars) { - for (int i = 0; i < chars.length; i++) { - if (str.indexOf(chars[i]) != -1) - return true; - } - return false; - } - - - public static String validateFolderName(String folderName) { - if (folderName.length() == 0) - return ProjectSupportResourceHandler.getString("Folder_name_cannot_be_empty_2"); //$NON-NLS-1$ - - if (contains(folderName, BAD_CHARS)) - return ProjectSupportResourceHandler.getString("Folder_name_is_not_valid", new Object[]{folderName}); //$NON-NLS-1$ - - return null; - } - - - public static String validateWebContentName(String webContentName, IProject project, String javaSourceName) { - - String msg = validateFolderName(webContentName); - if (msg != null) - return msg; - - if (javaSourceName != null && webContentName.equals(javaSourceName)) - return ProjectSupportResourceHandler.getString("Folder_names_cannot_be_equal_4"); //$NON-NLS-1$ - - // If given a java project, check to make sure current package fragment - // root folders do not overlap with new web content name - if (project != null) { - IJavaProject javaProject = JavaProjectUtilities.getJavaProject(project); - if (javaProject != null) { - try { - IPackageFragmentRoot roots[] = javaProject.getPackageFragmentRoots(); - for (int i = 0; i < roots.length; i++) { - IPackageFragmentRoot root = roots[i]; - if (!root.isArchive()) { - IResource resource = root.getCorrespondingResource(); - if (resource.getType() == IResource.FOLDER) { - IPath path = resource.getFullPath(); - String rootFolder = path.segment(1); - if (webContentName.equals(rootFolder)) { - if (root.getKind() == IPackageFragmentRoot.K_SOURCE) - return ProjectSupportResourceHandler.getString("Folder_name_cannot_be_the_same_as_Java_source_folder_5"); //$NON-NLS-1$ - - return ProjectSupportResourceHandler.getString("Folder_name_cannot_be_the_same_as_Java_class_folder_6"); //$NON-NLS-1$ - } - } - } - } - } catch (JavaModelException e) { - return null; - } - } - } - - return null; - } - - - /** - * Update given web nature to the current version if necessary. - * - * @param webNature - * The web Nature that should be examined. - * @return True if successful, false if unnecessary. - * @throws CoreException - * The exception that occured during the version change operation. - */ -/* static public boolean updateNatureToCurrentVersion(J2EEWebNatureRuntime webNature) throws CoreException { - - boolean success = false; - - if (webNature.getVersion() != WEB.CURRENT_VERSION) { - webNature.setVersion(J2EESettings.CURRENT_VERSION); - success = true; - } - ((J2EEModuleWorkbenchURIConverterImpl) webNature.getResourceSet().getURIConverter()).recomputeContainersIfNecessary(); - - return success; - }*/ - - /** - * Move the old source folder to the new default folder. - * - * @param project - * The Web Project we are working with. - * @param oldSourceFolder - * The old "Java Source" folder that will be moved. - * @param javaSourceName - * The new name of the "Java Source" folder, or null for default. - * @return The location of the new folder, or null if no move was necessary. - * @throws CoreException - * The exception that occured during the move operation. - */ - static public IContainer updateJavaSourceName(IProject project, IContainer oldSourceFolder, String javaSourceName, IProgressMonitor progressMonitor) throws CoreException { - IContainer newSourceFolder = null; - if (oldSourceFolder != null) { - IPath newPath; - if (javaSourceName == null) - newPath = new Path(DEFAULT_JAVA_SOURCE_NAME); - else - newPath = new Path(javaSourceName); - - //Make sure new path is different form old path - if (!project.getFolder(newPath).getFullPath().equals(oldSourceFolder.getFullPath())) { - oldSourceFolder.move(newPath, IResource.FORCE | IResource.KEEP_HISTORY, new SubProgressMonitor(progressMonitor, 1)); - JavaProjectUtilities.removeFromJavaClassPath(project, oldSourceFolder); - newSourceFolder = project.getFolder(newPath); - JavaProjectUtilities.appendJavaClassPath(project, JavaCore.newSourceEntry(project.getFolder(newPath).getFullPath())); - } - } - return newSourceFolder; - } - - - /** - * Get the source folder that should be used for migration. - * - * @param project - * The Web Project to examine. - * @return The source folder to use in migration, or null if it should be skipped. - */ - static public IContainer getJavaSourceFolder(IProject project) { - List sourceRoots = JavaProjectUtilities.getSourceContainers(project); - IContainer oldSourceFolder = null; - - if (sourceRoots != null) { - if (sourceRoots.size() == 1) { - IContainer sourceFolder = (IContainer) sourceRoots.get(0); - if (sourceFolder instanceof IFolder) { - oldSourceFolder = sourceFolder; - } - } - } - return oldSourceFolder; - } - - public static IFolder getModuleServerRoot(IProject project) { - //TODO need to implement module server root properly - return project.getFolder("WebContent"); - } - - public static IFolder getWebLibFolder(IProject project) { - //TODO needs to be implemented - return null; - } - - // - // static public boolean isImportedClassesJARFileInLibDir(IResource resource) { - // if (resource == null || !resource.exists()) - // return false; - // return resource.getType() == resource.FILE && - // resource.getName().endsWith(IWebNatureConstants.IMPORTED_CLASSES_SUFFIX) && isZip(resource); - // } - // - // static public boolean isLibDirJARFile(IResource resource) { - // if (resource == null || !resource.exists()) - // return false; - // return resource.getType() == resource.FILE && isZip(resource); - // } - // - // static public boolean isZip(IResource resource) { - // String path = resource.getLocation().toOSString(); - // ZipFile zip = null; - // - // try { - // zip = new ZipFile(path); - // } catch (IOException notAZip) { - // return false; - // } finally { - // if (zip != null) { - // try { - // zip.close(); - // } catch (IOException ex) {} - // } - // } - // return zip != null; - // } - - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebSettingsMigrator.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebSettingsMigrator.java deleted file mode 100644 index 468eb6bce..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebSettingsMigrator.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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 - *******************************************************************************/ -/* - * Created on Mar 11, 2004 - * - * To change the template for this generated file go to Window - Preferences - - * Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.j2ee.internal.web.operations; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jem.util.emf.workbench.JavaProjectUtilities; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.project.IWebNatureConstants; -import org.eclipse.jst.j2ee.internal.project.J2EENature; -import org.eclipse.jst.j2ee.internal.project.J2EESettings; -import org.eclipse.wst.common.frameworks.internal.WTPProjectUtilities; -import org.eclipse.wst.common.internal.migration.IDeprecatedConstants; -import org.eclipse.wst.common.internal.migration.IMigrator; - -/** - * @author vijayb - * - * To change the template for this generated type comment go to Window - Preferences - Java - Code - * Generation - Code and Comments - */ -public class WebSettingsMigrator implements IMigrator { - protected J2EESettings j2eeSettings; - protected String WEBSETINGS_KEY = "j2eesettings"; //$NON-NLS-1$ - - /** - * - */ - public WebSettingsMigrator() { - super(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.common.migration.IMigrator#migrate(org.eclipse.core.resources.IProject) - */ - public boolean migrate(IProject project) { - //TODO: re-implement as necessary in M4 - //migrateProjectFile(project); - if (migrateWebSettingsFile(project)) - return true; - return false; - } - - /** - * @param project - */ - private boolean migrateWebSettingsFile(IProject project) { - // - - /*J2EEWebNatureRuntime webNature = J2EEWebNatureRuntime.getRuntime(project); - if (webNature != null) { - WebSettings webSettings = webNature.getWebSettings(); - IFile webSettingsFile = webNature.getFile(IWebNatureConstants.WEBSETTINGS_FILE_NAME); - try { - if (webSettings != null) { - boolean j2eeSuccesful = performJ2EESettingsMigration(project, webNature); - boolean webSuccessful = performWebSettingsMigration(project, webNature, webSettings, webSettingsFile); - return j2eeSuccesful && webSuccessful; - } - } catch (CoreException ce) { - ce.printStackTrace(); - } - }*/ - return false; - } - - /** - * @param project - * @param webNature - * @param jspVersion - * @return - */ -/* private boolean performWebSettingsMigration(IProject project, J2EEWebNatureRuntime webNature, WebSettings webSettings, IFile webSettingsFile) { - if (!CompatibilityUtils.isPersistedTimestampCurrent(project, webSettingsFile)) { - try { - webSettings.setVersion(J2EESettings.CURRENT_VERSION); - webSettings.setProjectType("J2EE"); //$NON-NLS-1$ - webSettings.setWebContentName(getWebContentOutputFolderName(project)); - webSettings.setContextRoot(webNature.getContextRoot()); - String jspLevel = getJSPLevel(webNature); - if (jspLevel != null) { - webSettings.setJSPLevel(jspLevel); - } - webSettings.write(); - CompatibilityUtils.updateTimestamp(project, webSettingsFile); - return true; - } catch (CoreException ce) { - ce.printStackTrace(); - } - } - return false; - }*/ - - /** - * @param servletLevel - * @return - */ -/* private String getJSPLevel(J2EEWebNatureRuntime webNature) { - String version = webNature.getModuleVersionText(); - if (version.equals(J2EEVersionConstants.VERSION_2_2_TEXT)) - return J2EEVersionConstants.VERSION_1_1_TEXT; - else if (version.equals(J2EEVersionConstants.VERSION_2_3_TEXT)) - return J2EEVersionConstants.VERSION_1_2_TEXT; - else if (version.equals(J2EEVersionConstants.VERSION_2_4_TEXT)) - return J2EEVersionConstants.VERSION_1_3_TEXT; - return null; - } -*/ - /** - * @param project - * @param webNature - * @param jspVersion - * @return - * @throws CoreException - */ -/* private boolean performJ2EESettingsMigration(IProject project, J2EEWebNatureRuntime webNature) throws CoreException { - - IFile j2eeSettingsFile = project.getFile(J2EESettings.J2EE_SETTINGS_FILE_NAME); - if (!CompatibilityUtils.isPersistedTimestampCurrent(project, j2eeSettingsFile)) { - if (j2eeSettingsFile == null && j2eeSettingsFile.exists()) - j2eeSettings = getJ2EESettings(project); - else - j2eeSettings = new J2EESettings(project, webNature); - j2eeSettings.setVersion(J2EESettings.CURRENT_VERSION); - String version = getJSPLevel(webNature); - if (version.equals(J2EEVersionConstants.VERSION_1_1_TEXT)) - j2eeSettings.setModuleVersion(J2EEVersionConstants.VERSION_2_2); - else if (version.equals(J2EEVersionConstants.VERSION_1_2_TEXT)) - j2eeSettings.setModuleVersion(J2EEVersionConstants.VERSION_2_3); - else if (version.equals(J2EEVersionConstants.VERSION_1_3_TEXT)) - j2eeSettings.setModuleVersion(J2EEVersionConstants.VERSION_2_4); - j2eeSettings.write(); - CompatibilityUtils.updateTimestamp(project, j2eeSettingsFile); - return true; - } - return false; - }*/ - - protected J2EESettings getJ2EESettings(IProject project) { - return new J2EESettings(project); - } - - private String getWebContentOutputFolderName(IProject project) { - IPath outputPath = JavaProjectUtilities.getJavaProjectOutputLocation(project); - String[] folders = outputPath.segments(); - for (int i = 0; i < folders.length; i++) { - IContainer container = project.getFolder(folders[i]); - IResource resource = container.findMember(new Path(IWebNatureConstants.INFO_DIRECTORY + "/" + IWebNatureConstants.DEPLOYMENT_DESCRIPTOR_FILE_NAME)); //$NON-NLS-1$ - if (resource != null) { - return container.getFullPath().removeFirstSegments(1).toString(); - } - - } - return ""; //$NON-NLS-1$ - } - - private void migrateProjectFile(IProject project) { - try { - J2EENature nature = J2EENature.getRegisteredRuntime(project); - int j2eeVersion = nature.getJ2EEVersion(); - if (j2eeVersion != J2EEVersionConstants.J2EE_1_4_ID) { - - if (project.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) { - //WTPProjectUtilities.addOldNatureToProject( project, - // IDeprecatedConstants.WEBNATURE ); - WTPProjectUtilities.addOldNatureToProject(project, IDeprecatedConstants.WEBNATURE, 1); - ProjectUtilities.addToBuildSpec(IDeprecatedConstants.LIBCOPYBUILDER, project); - } - } - } catch (CoreException ce) { - ce.printStackTrace(); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebToolingException.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebToolingException.java deleted file mode 100644 index 9594ca2e3..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebToolingException.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - - - -import java.io.IOException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.JavaModelException; -import org.xml.sax.SAXException; - - -/** - * The WebToolingException class is the generic class for exceptions generated by the web tooling. - */ -public class WebToolingException extends Exception { - public static final String SAX_ERROR_MESSAGE = ProjectSupportResourceHandler.getString("Operation_failed_due_to_SA_ERROR_"); //$NON-NLS-1$ = "Operation failed due to SAX error: " - public static final String IO_ERROR_MESSAGE = ProjectSupportResourceHandler.getString("Operation_failed_due_to_IO_ERROR_"); //$NON-NLS-1$ = "Operation failed due to IO error: " - public static final String CORE_ERROR_MESSAGE = ProjectSupportResourceHandler.getString("Operation_failed_due_to_Co_ERROR_"); //$NON-NLS-1$ = "Operation failed due to Core error: " - public static final String JAVA_MODEL_ERROR_MESSAGE = ProjectSupportResourceHandler.getString("Operation_failed_due_to_Ja_ERROR_"); //$NON-NLS-1$ = "Operation failed due to Java Model error: " - - /** - * Create a new WebToolingException with no message. - */ - public WebToolingException() { - super(); - } - - /** - * Create a new instance of the receiver for a supplied IO Exception - * - * @param message - * java.lang.String - */ - public WebToolingException(IOException exception) { - this(IO_ERROR_MESSAGE, exception); - } - - /** - * Create a new WebToolingException with error message of s. - * - * @param s - * java.lang.String - */ - public WebToolingException(String s) { - super(s); - } - - /** - * Create a new instance of the receiver with the supplied preamble and the message of the - * example appended to the end. - * - * @param message - * java.lang.String - */ - public WebToolingException(String preamble, Throwable exception) { - this(preamble + exception.getMessage()); - } - - /** - * Create a new instance of the receiver for a supplied CoreException - * - * @param exception - * CoreException - */ - public WebToolingException(CoreException exception) { - this(CORE_ERROR_MESSAGE, exception); - } - - /** - * Create a new instance of the receiver for a supplied JavaModelException. - * - * @param exception - * JavaModelException - */ - public WebToolingException(JavaModelException exception) { - this(JAVA_MODEL_ERROR_MESSAGE, exception); - } - - /** - * Create a new instance of the receiver for a supplied SAX Exception - * - * @param exception - * SAXException - */ - public WebToolingException(SAXException exception) { - this(SAX_ERROR_MESSAGE, exception); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebToolingTemplate.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebToolingTemplate.java deleted file mode 100644 index 7c9f60725..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebToolingTemplate.java +++ /dev/null @@ -1,19 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.operations; - -public interface WebToolingTemplate { - /** - * Insert the method's description here. Creation date: (12/6/2000 7:35:38 PM) - * - * @param data - * TemplateData - */ - public String generate(TemplateData data); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebArtifactEditOperation.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebArtifactEditOperation.java deleted file mode 100644 index b182f309c..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebArtifactEditOperation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.jst.j2ee.internal.web.util; - -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperation; - -public class WebArtifactEditOperation extends ArtifactEditOperation { - - public WebArtifactEditOperation(WebArtifactEditOperationDataModel operationDataModel) { - super(operationDataModel); - } - - protected ArtifactEdit getArtifactEditForModule(WorkbenchComponent module) { - return WebArtifactEdit.getWebArtifactEditForWrite(module); - } - - protected WebArtifactEdit getWebArtifactEdit() { - return (WebArtifactEdit)getArtifactEdit(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebArtifactEditOperationDataModel.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebArtifactEditOperationDataModel.java deleted file mode 100644 index 5b1d79c43..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebArtifactEditOperationDataModel.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 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.jst.j2ee.internal.web.util; - -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditOperationDataModel; -import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation; - -public class WebArtifactEditOperationDataModel extends ArtifactEditOperationDataModel { - - public WTPOperation getDefaultOperation() { - return new WebArtifactEditOperation(this); - } - - public WebArtifactEdit getWebArtifactEditForRead() { - return WebArtifactEdit.getWebArtifactEditForRead(getWorkbenchModule()); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebEditAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebEditAdapterFactory.java deleted file mode 100644 index 0df39d790..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/util/WebEditAdapterFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.internal.web.util; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jst.j2ee.web.modulecore.util.WebArtifactEdit; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.ArtifactEditModel; - - -/** - * <p> - * Adapts {@see org.eclipse.wst.common.modulecore.ArtifactEditModel}s to - * {@see org.eclipse.jst.j2ee.internal.web.util.WebArtifactEdit} facades. - * </p> - */ -public class WebEditAdapterFactory implements IAdapterFactory { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) - */ - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (adapterType == WebArtifactEdit.ADAPTER_TYPE || adapterType == ArtifactEdit.ADAPTER_TYPE) { - ArtifactEditModel editModel = (ArtifactEditModel) adaptableObject; - if (editModel.getModuleType().equals(WebArtifactEdit.TYPE_ID)) - return new WebArtifactEdit((ArtifactEditModel) adaptableObject); - } - return null; - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() - */ - public Class[] getAdapterList() { - return new Class[]{ArtifactEdit.class, WebArtifactEdit.class}; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/modulecore/util/WebArtifactEdit.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/modulecore/util/WebArtifactEdit.java deleted file mode 100644 index 7e2f45908..000000000 --- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/web/modulecore/util/WebArtifactEdit.java +++ /dev/null @@ -1,501 +0,0 @@ -/*************************************************************************************************** - * Copyright (c) 2003, 2004 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.j2ee.web.modulecore.util; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jst.j2ee.internal.J2EEConstants; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.common.XMLResource; -import org.eclipse.jst.j2ee.internal.modulecore.util.EnterpriseArtifactEdit; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebAppResource; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.j2ee.webapplication.WelcomeFile; -import org.eclipse.jst.j2ee.webapplication.WelcomeFileList; -import org.eclipse.wst.common.componentcore.ArtifactEdit; -import org.eclipse.wst.common.componentcore.ArtifactEditModel; -import org.eclipse.wst.common.componentcore.StructureEdit; -import org.eclipse.wst.common.componentcore.ModuleCoreNature; -import org.eclipse.wst.common.componentcore.UnresolveableURIException; -import org.eclipse.wst.common.componentcore.internal.ReferencedComponent; -import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent; -import org.eclipse.wst.common.componentcore.internal.resources.ComponentHandle; -import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper; - - - -/** - * <p> - * WebArtifactEdit obtains a Web Deployment Descriptor metamodel specifec data from a - * {@see org.eclipse.jst.j2ee.webapplication.WebAppResource} which stores the metamodel. The - * {@see org.eclipse.jst.j2ee.webapplication.WebAppResource} is retrieved from the - * {@see org.eclipse.wst.common.modulecore.ArtifactEditModel} using a constant {@see - * J2EEConstants#WEBAPP_DD_URI_OBJ}. The defined methods extract data or manipulate the contents of - * the underlying resource. - * </p> - */ -public class WebArtifactEdit extends EnterpriseArtifactEdit { - - /** - * <p> - * Identifier used to link WebArtifactEdit to a WebEditAdapterFactory {@see - * WebEditAdapterFactory} stored in an AdapterManger (@see AdapterManager) - * </p> - */ - public static final Class ADAPTER_TYPE = WebArtifactEdit.class; - - /** - * <p> - * Identifier used to group and query common artifact edits. - * </p> - */ - public static String TYPE_ID = "jst.web"; //$NON-NLS-1$ - - private static String LIB = "lib"; //$NON-NLS-1$ - - /** - * @param aHandle - * @param toAccessAsReadOnly - * @throws IllegalArgumentException - */ - public WebArtifactEdit(ComponentHandle aHandle, boolean toAccessAsReadOnly) throws IllegalArgumentException { - super(aHandle, toAccessAsReadOnly); - // TODO Auto-generated constructor stub - } - - - /** - * <p> - * Returns an instance facade to manage the underlying edit model for the given - * {@see WorkbenchComponent}. Instances of ArtifactEdit that are returned through this method - * must be {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Use to acquire an ArtifactEdit facade for a specific {@see WorkbenchComponent} that - * will not be used for editing. Invocations of any save*() API on an instance returned from - * this method will throw exceptions. - * </p> - * <p> - * <b>The following method may return null. </b> - * </p> - * - * @param aModule - * A valid {@see WorkbenchComponent} with a handle that resolves to an - * accessible project in the workspace - * @return An instance of ArtifactEdit that may only be used to read the underlying content - * model - */ - public static WebArtifactEdit getWebArtifactEditForRead(ComponentHandle aHandle) { - WebArtifactEdit artifactEdit = null; - try { - artifactEdit = new WebArtifactEdit(aHandle, true); - } catch (IllegalArgumentException iae) { - artifactEdit = null; - } - return artifactEdit; - } - /** - * <p> - * Returns an instance facade to manage the underlying edit model for the given - * {@see WorkbenchComponent}. Instances of ArtifactEdit that are returned through this method - * must be {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Use to acquire an ArtifactEdit facade for a specific {@see WorkbenchComponent} that - * will be used for editing. - * </p> - * <p> - * <b>The following method may return null. </b> - * </p> - * - * @param aModule - * A valid {@see WorkbenchComponent} with a handle that resolves to an - * accessible project in the workspace - * @return An instance of ArtifactEdit that may be used to modify and persist changes to the - * underlying content model - */ - public static ArtifactEdit getWebArtifactEditForWrite(ComponentHandle aHandle) { - WebArtifactEdit artifactEdit = null; - try { - artifactEdit = new WebArtifactEdit(aHandle, false); - } catch (IllegalArgumentException iae) { - artifactEdit = null; - } - return artifactEdit; - } - - /** - * <p> - * Returns an instance facade to manage the underlying edit model for the given - * {@see WorkbenchComponent}. Instances of WebArtifactEdit that are returned through this method - * must be {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Use to acquire an WebArtifactEdit facade for a specific {@see WorkbenchComponent} that will not - * be used for editing. Invocations of any save*() API on an instance returned from this method - * will throw exceptions. - * </p> - * <p> - * <b>This method may return null. </b> - * </p> - * - * @param aModule - * A valid {@see WorkbenchComponent} with a handle that resolves to an accessible - * project in the workspace - * @return An instance of WebArtifactEdit that may only be used to read the underlying content - * model - * @throws UnresolveableURIException - * could not resolve uri. - */ - public static WebArtifactEdit getWebArtifactEditForRead(WorkbenchComponent aModule) { - try { - if (isValidWebModule(aModule)) { - IProject project = StructureEdit.getContainingProject(aModule); - ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project); - return new WebArtifactEdit(nature, aModule, true); - } - } catch (UnresolveableURIException uue) { - //Ignore - } - return null; - } - - - /** - * <p> - * Returns an instance facade to manage the underlying edit model for the given - * {@see WorkbenchComponent}. Instances of WebArtifactEdit that are returned through this method - * must be {@see #dispose()}ed of when no longer in use. - * </p> - * <p> - * Use to acquire an WebArtifactEdit facade for a specific {@see WorkbenchComponent} that - * will be used for editing. - * </p> - * <p> - * <b>This method may return null. </b> - * </p> - * - * @param aModule - * A valid {@see WorkbenchComponent} with a handle that resolves to an accessible - * project in the workspace - * @return An instance of WebArtifactEdit that may be used to modify and persist changes to the - * underlying content model - */ - public static WebArtifactEdit getWebArtifactEditForWrite(WorkbenchComponent aModule) { - try { - if (isValidWebModule(aModule)) { - IProject project = StructureEdit.getContainingProject(aModule); - ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project); - return new WebArtifactEdit(nature, aModule, false); - } - } catch (UnresolveableURIException uue) { - //Ignore - } - return null; - } - - /** - * @param module - * A {@see WorkbenchComponent} - * @return True if the supplied module - * {@see ArtifactEdit#isValidEditableModule(WorkbenchComponent)}and the moduleTypeId is a - * JST module - */ - public static boolean isValidWebModule(WorkbenchComponent aModule) throws UnresolveableURIException { - if (!isValidEditableModule(aModule)) - return false; - /* and match the JST_WEB_MODULE type */ - if (!TYPE_ID.equals(aModule.getComponentType().getComponentTypeId())) - return false; - return true; - } - - /** - * <p> - * Creates an instance facade for the given {@see ArtifactEditModel}. - * </p> - * - * @param anArtifactEditModel - */ - public WebArtifactEdit(ArtifactEditModel model) { - super(model); - - } - - /** - * <p> - * Creates an instance facade for the given {@see ArtifactEditModel} - * </p> - * - * @param aNature - * A non-null {@see ModuleCoreNature}for an accessible project - * @param aModule - * A non-null {@see WorkbenchComponent}pointing to a module from the given - * {@see ModuleCoreNature} - */ - public WebArtifactEdit(ModuleCoreNature aNature, WorkbenchComponent aModule, boolean toAccessAsReadOnly) { - super(aNature, aModule, toAccessAsReadOnly); - } - - - - /** - * <p> - * Retrieves J2EE version information from WebAppResource. - * </p> - * - * @return an integer representation of a J2EE Spec version - * - */ - public int getJ2EEVersion() { - return ((WebAppResource)getDeploymentDescriptorResource()).getJ2EEVersionID(); - } - - /** - * <p> - * Obtains the WebApp (@see WebApp) root object from the WebAppResource. If the root object does - * not exist, then one is created (@link addWebAppIfNecessary(getWebApplicationXmiResource())). - * The root object contains all other resource defined objects. - * </p> - * - * @return EObject - * - */ - public EObject getDeploymentDescriptorRoot() { - List contents = getDeploymentDescriptorResource().getContents(); - if (contents.size() > 0) - return (EObject) contents.get(0); - addWebAppIfNecessary((WebAppResource)getDeploymentDescriptorResource()); - return (EObject) contents.get(0); - } - - /** - * <p> - * Retrieves the underlying resource from the ArtifactEditModel using defined URI. - * </p> - * - * @return Resource - * - */ - public Resource getDeploymentDescriptorResource() { - return getArtifactEditModel().getResource(J2EEConstants.WEBAPP_DD_URI_OBJ); - } - - /** - * <p> - * Retrieves Servlet version information derived from the {@see WebAppResource}. - * </p> - * - * @return an integer representation of a module version - * - */ - public int getServletVersion() { - return ((WebAppResource)getDeploymentDescriptorResource()).getModuleVersionID(); - } - - /** - * <p> - * Creates a deployment descriptor root object (WebApp) and populates with data. Adds the root - * object to the deployment descriptor resource. - * </p> - * - * <p> - * - * @param aModule - * A non-null pointing to a {@see XMLResource} - * @param version - * Version to be set on resource....if null default is taken - * - * Note: This method is typically used for JUNIT - move? - * </p> - */ - protected void addWebAppIfNecessary(XMLResource aResource) { - if (aResource != null) { - if(aResource.getContents() == null || aResource.getContents().isEmpty()) { - WebApp webAppNew = WebapplicationFactory.eINSTANCE.createWebApp(); - aResource.getContents().add(webAppNew); - aResource.setModified(true); - } - WebApp webApp = (WebApp)aResource.getContents().get(0); - URI moduleURI = getArtifactEditModel().getModuleURI(); - try { - webApp.setDisplayName(StructureEdit.getDeployedName(moduleURI)); - } catch (UnresolveableURIException e) { - //Ignore - } - aResource.setID(webApp, J2EEConstants.WEBAPP_ID); - - WelcomeFileList wList = WebapplicationFactory.eINSTANCE.createWelcomeFileList(); - webApp.setFileList(wList); - List files = wList.getFile(); - WelcomeFile file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("index.html"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("index.htm"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("index.jsp"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("default.html"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("default.htm"); //$NON-NLS-1$ - files.add(file); - file = WebapplicationFactory.eINSTANCE.createWelcomeFile(); - file.setWelcomeFile("default.jsp"); //$NON-NLS-1$ - files.add(file); - - try{ - aResource.saveIfNecessary(); - }catch(Exception e){ - e.printStackTrace(); - } - } - } - - /** - * This method returns the integer representation for the JSP specification level associated with - * the J2EE version for this workbench module. This method will not return null and returns 20 - * as default. - * @see WebArtifactEdit#getServletVersion() - * - * @return an integer representation of the JSP level - */ - public int getJSPVersion() { - int servletVersion = getServletVersion(); - if (servletVersion == J2EEVersionConstants.WEB_2_2_ID) - return J2EEVersionConstants.JSP_1_1_ID; - else if (servletVersion == J2EEVersionConstants.WEB_2_3_ID) - return J2EEVersionConstants.JSP_1_2_ID; - else - return J2EEVersionConstants.JSP_2_0_ID; - } - - /** - * This method returns the full path to the deployment descriptor resource for the associated - * workbench module. This method may return null. - * - * @see WebArtifactEdit#getDeploymentDescriptorResource() - * - * @return the full IPath for the deployment descriptor resource - */ - public IPath getDeploymentDescriptorPath() { - IFile file = WorkbenchResourceHelper.getFile(getDeploymentDescriptorResource()); - if (file!=null) - return file.getFullPath(); - return null; - } - - /** - * This method will retrieve the web app resource, create it if necessary, add get the root object, - * the web app out of that web app resource. It will create the web app instance if need be, and add - * it to the web resource. Then, it returns the web app object as the model root. This method will - * not return null. - * - * @see EnterpriseArtifactEdit#createModelRoot() - * - * @return the eObject instance of the model root - */ - public EObject createModelRoot() { - return createModelRoot(getJ2EEVersion()); - } - /** - * This method will retrieve the web app resource, create it if necessary, add get the root object, set version - * the web app out of that web app resource. It will create the web app instance if need be, and add - * it to the web resource. Then, it returns the web app object as the model root. This method will - * not return null. - * - * @see EnterpriseArtifactEdit#createModelRoot() - * - * @return the eObject instance of the model root - */ - public EObject createModelRoot(int version) { - WebAppResource res = (WebAppResource)getDeploymentDescriptorResource(); - res.setModuleVersionID(version); - addWebAppIfNecessary(res); - return res.getRootObject(); - } - /** - * This method will return the list of dependent modules which are utility jars in the web lib - * folder of the deployed path of the module. It will not return null. - * - * @return array of the web library dependent modules - */ - public ReferencedComponent[] getLibModules() { - List result = new ArrayList(); - List dependentModules = module.getReferencedComponents(); - // Check the deployed path to make sure it has a lib parent folder and matchs the web.xml base path - for (int i=0; i<dependentModules.size(); i++) { - ReferencedComponent child = (ReferencedComponent) dependentModules.get(i); - URI parentFolderURI = URI.createURI(child.getRuntimePath().removeLastSegments(1).toString()); - URI webLib = getDeploymentDescriptorResource().getURI().trimSegments(1).appendSegment(LIB); - if (parentFolderURI.equals(webLib)) - result.add(child); - } - // add results to an array for return - ReferencedComponent[] libModules = new ReferencedComponent[result.size()]; - for (int i=0; i<result.size(); i++) { - ReferencedComponent child = (ReferencedComponent) result.get(i); - libModules[i] = child; - } - return libModules; - } - - /** - * This method will add the dependent modules from the passed in array to the dependentmodules list - * of the associated workbench module. It will ensure a null is not passed and it will ensure the - * dependent modules are not already in the list. - * - * @param libModules array of dependent modules to add as web libraries - */ - public void addLibModules(ReferencedComponent[] libModules) { - if (libModules==null) - return; - for (int i=0; i<libModules.length; i++) { - if (!module.getReferencedComponents().contains(libModules[i])) - module.getReferencedComponents().add(libModules[i]); - } - } - - /** - * This method will retrieve the context root for the associated workbench module which is used - * by the server at runtime. This method is not yet completed as the context root has to be - * abstracted and added to the workbenchModule model. This API will not change though. - * Returns null for now. - * - * @return String value of the context root for runtime of the associated module - */ - public String getServerContextRoot() { - //TODO return the valid context root for the module, needs to be be added to the model - return null; - } - - /** - * This method will set the context root on the associated workbench module with the given string - * value passed in. This context root is used by the server at runtime. This method is not yet - * completed as the context root still needs to be abstracted and added to the workbench module - * model. This API will not change though. - * Does nothing as of now. - * - * @param contextRoot string - */ - public void setServerContextRoot(String contextRoot) { - //TODO set the new context root on the module, needs to be added to the model - } -}
\ No newline at end of file |