Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.server.tomcat.ui')
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/.classpath7
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore7
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/.options4
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/.project28
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF24
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/about.html22
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/build.properties20
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gifbin555 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gifbin579 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gifbin322 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gifbin606 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat.gifbin520 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gifbin588 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gifbin2929 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties14
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml152
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ConfigurationPropertyTester.java35
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java48
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java70
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties79
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java62
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java42
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java306
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java66
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java134
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java54
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java426
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java248
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java416
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java155
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java203
-rw-r--r--plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java288
32 files changed, 0 insertions, 2910 deletions
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.classpath b/plugins/org.eclipse.jst.server.tomcat.ui/.classpath
deleted file mode 100644
index 0dfed31fa..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="tomcatui/"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore b/plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore
deleted file mode 100644
index 59feaea94..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-build.xml
-org.eclipse.jst.server.tomcat.ui_3.0.0.jar
-tomcatui.jar
-temp.folder
-@dot
-src.zip
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.options b/plugins/org.eclipse.jst.server.tomcat.ui/.options
deleted file mode 100644
index d88b03b38..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.options
+++ /dev/null
@@ -1,4 +0,0 @@
-# Debugging options for the org.eclipse.jst.server.tomcat.ui plugin
-
-# Turn on general debugging
-org.eclipse.jst.server.tomcat.ui/debug=true
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/.project b/plugins/org.eclipse.jst.server.tomcat.ui/.project
deleted file mode 100644
index 731f756fa..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.tomcat.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 7b3b31470..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jst.server.tomcat.ui; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.server.tomcat.ui.internal;x-internal:=true,
- org.eclipse.jst.server.tomcat.ui.internal.editor;x-internal:=true
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.expressions,
- org.eclipse.ui,
- org.eclipse.ui.ide,
- org.eclipse.ui.forms,
- org.eclipse.debug.ui,
- org.eclipse.jdt.debug.ui,
- org.eclipse.jdt.launching,
- org.eclipse.wst.server.core,
- org.eclipse.wst.server.ui,
- org.eclipse.jst.server.core,
- org.eclipse.jst.server.tomcat.core
-Eclipse-AutoStart: true
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/about.html b/plugins/org.eclipse.jst.server.tomcat.ui/about.html
deleted file mode 100644
index 6f6b96c4c..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>February 24, 2005</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/build.properties b/plugins/org.eclipse.jst.server.tomcat.ui/build.properties
deleted file mode 100644
index 98321349e..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 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,\
- plugin.properties,\
- icons/,\
- .,\
- META-INF/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-source.. = tomcatui/
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gif
deleted file mode 100644
index c5850103e..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_extension.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gif
deleted file mode 100644
index 0a8e4bf12..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/mime_mapping.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gif
deleted file mode 100644
index 7a354b73f..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/port.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gif
deleted file mode 100644
index 0cb4c163c..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/project_missing.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat.gif
deleted file mode 100644
index a857c0f9b..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/tomcat.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gif
deleted file mode 100644
index bf20f7017..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/obj16/web_module.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gif b/plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gif
deleted file mode 100644
index 63a959985..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/icons/wizban/tomcat_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties b/plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties
deleted file mode 100644
index 37184726f..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-pluginName=Apache Tomcat UI Support
-providerName=Eclipse.org
-
-configurationEditorWebModulesPage=Modules
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml b/plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml
deleted file mode 100644
index a4b40a7ed..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/plugin.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
- <extension point="org.eclipse.wst.server.ui.serverImages">
- <image
- id="org.eclipse.jst.server.tomcat.32"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.32"/>
- <image
- id="org.eclipse.jst.server.tomcat.40"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.40"/>
- <image
- id="org.eclipse.jst.server.tomcat.41"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.41"/>
- <image
- id="org.eclipse.jst.server.tomcat.50"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.50"/>
- <image
- id="org.eclipse.jst.server.tomcat.55"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.runtime.55"/>
-
- <image
- id="org.eclipse.jst.server.tomcat.32"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.32"/>
- <image
- id="org.eclipse.jst.server.tomcat.40"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.40"/>
- <image
- id="org.eclipse.jst.server.tomcat.41"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.41"/>
- <image
- id="org.eclipse.jst.server.tomcat.50"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.50"/>
- <image
- id="org.eclipse.jst.server.tomcat.55"
- icon="icons/obj16/tomcat.gif"
- typeIds="org.eclipse.jst.server.tomcat.55"/>
- </extension>
-
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- id="org.eclipse.jst.server.tomcat.ui.propertyTester"
- namespace="org.eclipse.jst.server.tomcat.ui"
- properties="hasConfiguration"
- type="java.lang.Object"
- class="org.eclipse.jst.server.tomcat.ui.internal.ConfigurationPropertyTester">
- </propertyTester>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.editorPages">
- <page
- id="org.eclipse.jst.server.tomcat.configuration.editor.webmodule"
- order="20"
- name="%configurationEditorWebModulesPage"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ConfigurationWebModuleEditorPart">
- <enablement>
- <test property="org.eclipse.jst.server.tomcat.ui.hasConfiguration" value="true"/>
- </enablement>
- </page>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.editorPageSections">
- <section
- id="org.eclipse.jst.server.tomcat.server.editor.general"
- order="0"
- insertionId="org.eclipse.wst.server.editor.overview.left"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ServerGeneralEditorSection"/>
- <section
- id="org.eclipse.jst.server.tomcat.configuration.editor.port"
- order="10"
- insertionId="org.eclipse.wst.server.editor.overview.right"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ConfigurationPortEditorSection">
- <enablement>
- <test property="org.eclipse.jst.server.tomcat.ui.hasConfiguration" value="true"/>
- </enablement>
- </section>
- <section
- id="org.eclipse.jst.server.tomcat.configuration.editor.mime"
- order="20"
- insertionId="org.eclipse.wst.server.editor.overview.right"
- typeIds="org.eclipse.jst.server.tomcat.*"
- class="org.eclipse.jst.server.tomcat.ui.internal.editor.ConfigurationMimeEditorSection">
- <enablement>
- <test property="org.eclipse.jst.server.tomcat.ui.hasConfiguration" value="true"/>
- </enablement>
- </section>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.32"
- typeIds="org.eclipse.jst.server.tomcat.runtime.32"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.40"
- typeIds="org.eclipse.jst.server.tomcat.runtime.40"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.41"
- typeIds="org.eclipse.jst.server.tomcat.runtime.41"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.50"
- typeIds="org.eclipse.jst.server.tomcat.runtime.50"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- <fragment
- id="org.eclipse.jst.server.tomcat.runtime.55"
- typeIds="org.eclipse.jst.server.tomcat.runtime.55"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatRuntimeWizardFragment"/>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- id="org.eclipse.jst.server.tomcat.ui.launchConfigurationTypeImage"
- configTypeID="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- icon="icons/obj16/tomcat.gif">
- </launchConfigurationTypeImage>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- id="org.eclipse.jst.server.tomcat.ui.launchConfigurationTabGroup"
- type="org.eclipse.jst.server.tomcat.core.launchConfigurationType"
- class="org.eclipse.jst.server.tomcat.ui.internal.TomcatLaunchConfigurationTabGroup">
- </launchConfigurationTabGroup>
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.ui.images">
- <image runtime-component-type="org.eclipse.jst.server.tomcat"
- path="icons/obj16/tomcat.gif"/>
- </extension>
-
- <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
- <adapter>
- <runtime-component id="org.eclipse.jst.server.tomcat"/>
- <factory class="org.eclipse.jst.server.ui.internal.RuntimeLabelProvider$Factory"/>
- <type class="org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider"/>
- </adapter>
- </extension>
-</plugin> \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ConfigurationPropertyTester.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ConfigurationPropertyTester.java
deleted file mode 100644
index 892b2d071..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ConfigurationPropertyTester.java
+++ /dev/null
@@ -1,35 +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.server.tomcat.ui.internal;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.wst.server.core.IServerAttributes;
-/**
- *
- */
-public class ConfigurationPropertyTester extends PropertyTester {
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- try {
- IServerAttributes server = (IServerAttributes) receiver;
- TomcatServer tomcatServer = (TomcatServer) server.loadAdapter(ITomcatServer.class, null);
- if (tomcatServer != null)
- return tomcatServer.getServerConfiguration() != null;
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java
deleted file mode 100644
index 7957cc170..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,48 +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.server.tomcat.ui.internal;
-/**
- * Constant ids for context help.
- */
-public interface ContextIds {
- public static final String SERVER_EDITOR = TomcatUIPlugin.PLUGIN_ID + ".teig0000";
- public static final String SERVER_EDITOR_TEST_ENVIRONMENT = TomcatUIPlugin.PLUGIN_ID + ".teig0002";
- public static final String SERVER_EDITOR_SECURE = TomcatUIPlugin.PLUGIN_ID + ".teig0004";
- public static final String SERVER_EDITOR_DEBUG_MODE = TomcatUIPlugin.PLUGIN_ID + ".teig0006";
-
- public static final String CONFIGURATION_EDITOR_WEBMODULES = TomcatUIPlugin.PLUGIN_ID + ".tecw0000";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_LIST = TomcatUIPlugin.PLUGIN_ID + ".tecw0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT = TomcatUIPlugin.PLUGIN_ID + ".tecw0004";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL = TomcatUIPlugin.PLUGIN_ID + ".tecw0006";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_EDIT = TomcatUIPlugin.PLUGIN_ID + ".tecw0008";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_REMOVE = TomcatUIPlugin.PLUGIN_ID + ".tecw0010";
-
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG = TomcatUIPlugin.PLUGIN_ID + ".tdwm0000";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT = TomcatUIPlugin.PLUGIN_ID + ".tdpr0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH = TomcatUIPlugin.PLUGIN_ID + ".tdpr0004";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE = TomcatUIPlugin.PLUGIN_ID + ".tdpr0006";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_RELOAD = TomcatUIPlugin.PLUGIN_ID + ".tdpr0008";
-
- public static final String CONFIGURATION_EDITOR_MAPPINGS = TomcatUIPlugin.PLUGIN_ID + ".tecm0000";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_LIST = TomcatUIPlugin.PLUGIN_ID + ".tecm0002";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_ADD = TomcatUIPlugin.PLUGIN_ID + ".tecm0004";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_EDIT = TomcatUIPlugin.PLUGIN_ID + ".tecm0006";
- public static final String CONFIGURATION_EDITOR_MAPPINGS_REMOVE = TomcatUIPlugin.PLUGIN_ID + ".tecm0008";
-
- public static final String CONFIGURATION_EDITOR_MAPPING_DIALOG = TomcatUIPlugin.PLUGIN_ID + ".tdmm0000";
- public static final String CONFIGURATION_EDITOR_MAPPING_DIALOG_TYPE = TomcatUIPlugin.PLUGIN_ID + ".tdmm0002";
- public static final String CONFIGURATION_EDITOR_MAPPING_DIALOG_EXTENSION = TomcatUIPlugin.PLUGIN_ID + ".tdmm0004";
-
- public static final String CONFIGURATION_EDITOR_PORTS = TomcatUIPlugin.PLUGIN_ID + ".tecp0000";
- public static final String CONFIGURATION_EDITOR_PORTS_LIST = TomcatUIPlugin.PLUGIN_ID + ".tecp0002";
-
- public static final String RUNTIME_COMPOSITE = TomcatUIPlugin.PLUGIN_ID + ".twnr0000";
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java
deleted file mode 100644
index a3bb1c805..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- **********************************************************************/
-package org.eclipse.jst.server.tomcat.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
- * Translated messages.
- */
-public class Messages extends NLS {
- public static String wizardTitle;
- public static String wizardDescription;
- public static String runtimeName;
- public static String installDir;
- public static String browse;
- public static String install;
- public static String selectInstallDir;
- public static String installedJRE;
- public static String installedJREs;
- public static String runtimeDefaultJRE;
- public static String editorAdd;
- public static String editorEdit;
- public static String editorRemove;
- public static String errorMissingWebModule;
- public static String configurationEditorMimeMappingsSection;
- public static String configurationEditorMimeMappingsDescription;
- public static String configurationEditorPortsSection;
- public static String configurationEditorPortsDescription;
- public static String configurationEditorPortNameColumn;
- public static String configurationEditorPortValueColumn;
- public static String configurationEditorWebModulesPageTitle;
- public static String configurationEditorWebModulesSection;
- public static String configurationEditorWebModulesDescription;
- public static String configurationEditorPathColumn;
- public static String configurationEditorDocBaseColumn;
- public static String configurationEditorProjectColumn;
- public static String configurationEditorReloadColumn;
- public static String configurationEditorAddProjectModule;
- public static String configurationEditorAddExternalModule;
- public static String configurationEditorProjectMissing;
- public static String configurationEditorReloadEnabled;
- public static String configurationEditorReloadDisabled;
- public static String configurationEditorMimeMapppingDialogTitleEdit;
- public static String configurationEditorMimeMapppingDialogTitleAdd;
- public static String configurationEditorMimeMapppingDialogMimeType;
- public static String configurationEditorMimeMapppingDialogMimeExtension;
- public static String serverEditorGeneralSection;
- public static String serverEditorGeneralDescription;
- public static String serverEditorTestEnvironment;
- public static String serverEditorSecure;
- public static String serverEditorDebugMode;
- public static String configurationEditorWebModuleDialogTitleEdit;
- public static String configurationEditorWebModuleDialogTitleAdd;
- public static String configurationEditorWebModuleDialogProjects;
- public static String configurationEditorWebModuleDialogDocumentBase;
- public static String configurationEditorWebModuleDialogSelectDirectory;
- public static String configurationEditorWebModuleDialogPath;
- public static String configurationEditorWebModuleDialogReloadEnabled;
-
- static {
- NLS.initializeMessages(TomcatUIPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties
deleted file mode 100644
index 2541b79cb..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties
+++ /dev/null
@@ -1,79 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-
-# --------------- General UI ---------------
-
-runtimeName=Na&me:
-browse=B&rowse...
-install=Download and Ins&tall...
-installDir=Tomcat installation &directory:
-installedJRE=&JRE:
-installedJREs=&Installed JREs...
-selectInstallDir=Select Tomcat installation directory.
-runtimeDefaultJRE=Workbench default JRE
-
-# New Tomcat server wizard
-wizardTitle=Tomcat Server
-wizardDescription=Specify the installation directory
-
-# --------------- Editors ---------------
-
-# General text used in both editors
-editorRemove=Remove
-editorAdd=Add...
-editorEdit=Edit...
-
-# --- Configuration Editor ---
-configurationEditorWebModulesPageTitle=Web Modules
-configurationEditorWebModulesSection=Web Modules
-configurationEditorWebModulesDescription=Configure the Web Modules on this server.
-configurationEditorMimeMappingsSection=MIME Mappings
-configurationEditorMimeMappingsDescription=Configure MIME type mappings.
-configurationEditorPortsSection=Ports
-configurationEditorPortsDescription=Modify the server ports.
-
-# Fields
-configurationEditorPortNameColumn=Port Name
-configurationEditorPortValueColumn=Port Number
-configurationEditorPathColumn=Path
-configurationEditorDocBaseColumn=Document Base
-configurationEditorProjectColumn=Module
-configurationEditorReloadColumn=Auto Reload
-configurationEditorProjectMissing={0} missing
-configurationEditorReloadEnabled=Enabled
-configurationEditorReloadDisabled=Disabled
-configurationEditorAddProjectModule=Add Web Module...
-configurationEditorAddExternalModule=Add External Web Module...
-
-# Add/Edit Mime Mapping dialog
-configurationEditorMimeMapppingDialogTitleEdit=Edit MIME Mapping
-configurationEditorMimeMapppingDialogTitleAdd=Add MIME Mapping
-configurationEditorMimeMapppingDialogMimeType=MIME &type:
-configurationEditorMimeMapppingDialogMimeExtension=MIME &extension:
-
-# Add/Edit Web Module dialog
-configurationEditorWebModuleDialogTitleEdit=Edit Web Module
-configurationEditorWebModuleDialogTitleAdd=Add Web Module
-configurationEditorWebModuleDialogProjects=&Modules:
-configurationEditorWebModuleDialogPath=P&ath:
-configurationEditorWebModuleDialogDocumentBase=&Document base:
-configurationEditorWebModuleDialogReloadEnabled=Auto r&eloading enabled
-configurationEditorWebModuleDialogSelectDirectory=Select the Web module directory.
-errorMissingWebModule=The Web module at the following location cannot be found: {0}.
-
-# --- Server Editor ---
-serverEditorGeneralSection=Server
-serverEditorGeneralDescription=Enter settings for the server.
-
-# Fields
-serverEditorSecure=Enable security
-serverEditorDebugMode=Enable Tomcat debug mode (v4.x and above only)
-serverEditorTestEnvironment=Run modules directly from the workspace (do not modify the Tomcat installation)
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java
deleted file mode 100644
index cbe03c563..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,62 +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.server.tomcat.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- /**
- * Create a new button with the standard size.
- *
- * @param comp the component to add the button to
- * @param label the button label
- * @return a button
- */
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = getButtonWidthHint(b);
- b.setLayoutData(data);
- return b;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java
deleted file mode 100644
index 4c6f725a2..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,42 +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.server.tomcat.ui.internal;
-
-import org.eclipse.debug.ui.*;
-import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
-
-import org.eclipse.wst.server.ui.ServerLaunchConfigurationTab;
-/**
- * A debug tab group for launching Tomcat.
- */
-public class TomcatLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
- /*
- * @see ILaunchConfigurationTabGroup#createTabs(ILaunchConfigurationDialog, String)
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[6];
- tabs[0] = new ServerLaunchConfigurationTab(new String[] { "org.eclipse.jst.server.tomcat" });
- tabs[0].setLaunchConfigurationDialog(dialog);
- tabs[1] = new JavaArgumentsTab();
- tabs[1].setLaunchConfigurationDialog(dialog);
- tabs[2] = new JavaClasspathTab();
- tabs[2].setLaunchConfigurationDialog(dialog);
- tabs[3] = new SourceLookupTab();
- tabs[3].setLaunchConfigurationDialog(dialog);
- tabs[4] = new EnvironmentTab();
- tabs[4].setLaunchConfigurationDialog(dialog);
- tabs[5] = new CommonTab();
- tabs[5].setLaunchConfigurationDialog(dialog);
- setTabs(tabs);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
deleted file mode 100644
index 020a75acb..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
+++ /dev/null
@@ -1,306 +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.server.tomcat.ui.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.internal.IInstallableRuntime;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- * Wizard page to set the server install directory.
- */
-public class TomcatRuntimeComposite extends Composite {
- protected IRuntimeWorkingCopy runtimeWC;
- protected ITomcatRuntimeWorkingCopy runtime;
-
- protected IWizardHandle wizard;
-
- protected Text installDir;
- protected Text name;
- protected Combo combo;
- protected List installedJREs;
- protected String[] jreNames;
-
- /**
- * TomcatRuntimeWizardPage constructor comment.
- *
- * @param parent the parent composite
- * @param wizard the wizard handle
- */
- protected TomcatRuntimeComposite(Composite parent, IWizardHandle wizard) {
- super(parent, SWT.NONE);
- this.wizard = wizard;
-
- wizard.setTitle(Messages.wizardTitle);
- wizard.setDescription(Messages.wizardDescription);
- wizard.setImageDescriptor(TomcatUIPlugin.getImageDescriptor(TomcatUIPlugin.IMG_WIZ_TOMCAT));
-
- createControl();
- }
-
- protected void setRuntime(IRuntimeWorkingCopy newRuntime) {
- if (newRuntime == null) {
- runtimeWC = null;
- runtime = null;
- } else {
- runtimeWC = newRuntime;
- runtime = (ITomcatRuntimeWorkingCopy) newRuntime.loadAdapter(ITomcatRuntimeWorkingCopy.class, null);
- }
-
- init();
- validate();
- }
-
- /**
- * Provide a wizard page to change the Tomcat installation directory.
- */
- protected void createControl() {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- setLayout(layout);
- setLayoutData(new GridData(GridData.FILL_BOTH));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.RUNTIME_COMPOSITE);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(Messages.runtimeName);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- name = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- name.setLayoutData(data);
- name.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- runtimeWC.setName(name.getText());
- validate();
- }
- });
-
- label = new Label(this, SWT.NONE);
- label.setText(Messages.installDir);
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- installDir = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- installDir.setLayoutData(data);
- installDir.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- runtimeWC.setLocation(new Path(installDir.getText()));
- validate();
- }
- });
-
- Button browse = SWTUtil.createButton(this, Messages.browse);
- browse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- DirectoryDialog dialog = new DirectoryDialog(TomcatRuntimeComposite.this.getShell());
- dialog.setMessage(Messages.selectInstallDir);
- dialog.setFilterPath(installDir.getText());
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null)
- installDir.setText(selectedDirectory);
- }
- });
-
- final IInstallableRuntime ir = ServerPlugin.findInstallableRuntime("org.eclipse.jst.server.timcat.runtime.32");
- if (ir != null) {
- label = new Label(this, SWT.NONE);
-
- Button install = SWTUtil.createButton(this, Messages.install);
- install.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- DirectoryDialog dialog = new DirectoryDialog(TomcatRuntimeComposite.this.getShell());
- dialog.setMessage(Messages.selectInstallDir);
- dialog.setFilterPath(installDir.getText());
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- ir.install(new Path(selectedDirectory));
- installDir.setText(selectedDirectory);
- }
- }
- });
- }
-
- updateJREs();
-
- // JDK location
- label = new Label(this, SWT.NONE);
- label.setText(Messages.installedJRE);
- data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- combo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setItems(jreNames);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- combo.setLayoutData(data);
-
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- int sel = combo.getSelectionIndex();
- IVMInstall vmInstall = null;
- if (sel > 0)
- vmInstall = (IVMInstall) installedJREs.get(sel - 1);
-
- runtime.setVMInstall(vmInstall);
- validate();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Button button = SWTUtil.createButton(this, Messages.installedJREs);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String currentVM = combo.getText();
- if (showPreferencePage()) {
- updateJREs();
- combo.setItems(jreNames);
- combo.setText(currentVM);
- if (combo.getSelectionIndex() == -1)
- combo.select(0);
- }
- }
- });
-
- init();
- validate();
-
- Dialog.applyDialogFont(this);
-
- name.forceFocus();
- }
-
- protected void updateJREs() {
- // get all installed JVMs
- installedJREs = new ArrayList();
- IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
- int size = vmInstallTypes.length;
- for (int i = 0; i < size; i++) {
- IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
- int size2 = vmInstalls.length;
- for (int j = 0; j < size2; j++) {
- installedJREs.add(vmInstalls[j]);
- }
- }
-
- // get names
- size = installedJREs.size();
- jreNames = new String[size+1];
- jreNames[0] = Messages.runtimeDefaultJRE;
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- jreNames[i+1] = vmInstall.getName();
- }
- }
-
- protected boolean showPreferencePage() {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode("org.eclipse.jdt.debug.ui.preferences.VMPreferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
- final PreferenceDialog dialog = new PreferenceDialog(getShell(), manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
- protected void init() {
- if (name == null || runtime == null)
- return;
-
- if (runtimeWC.getName() != null)
- name.setText(runtimeWC.getName());
- else
- name.setText("");
-
- if (runtimeWC.getLocation() != null)
- installDir.setText(runtimeWC.getLocation().toOSString());
- else
- installDir.setText("");
-
- // set selection
- if (runtime.isUsingDefaultJRE())
- combo.select(0);
- else {
- boolean found = false;
- int size = installedJREs.size();
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- if (vmInstall.equals(runtime.getVMInstall())) {
- combo.select(i + 1);
- found = true;
- }
- }
- if (!found)
- combo.select(0);
- }
- }
-
- protected void validate() {
- if (runtime == null) {
- wizard.setMessage("", IMessageProvider.ERROR);
- return;
- }
-
- IStatus status = runtimeWC.validate(null);
- if (status == null || status.isOK())
- wizard.setMessage(null, IMessageProvider.NONE);
- else if (status.getSeverity() == IStatus.WARNING)
- wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
- else
- wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
- wizard.update();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java
deleted file mode 100644
index 57fd3605f..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeWizardFragment.java
+++ /dev/null
@@ -1,66 +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.server.tomcat.ui.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-/**
- *
- */
-public class TomcatRuntimeWizardFragment extends WizardFragment {
- protected TomcatRuntimeComposite comp;
-
- public TomcatRuntimeWizardFragment() {
- // do nothing
- }
-
- public boolean hasComposite() {
- return true;
- }
-
- public boolean isComplete() {
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
-
- if (runtime == null)
- return false;
- IStatus status = runtime.validate(null);
- return (status == null || status.getSeverity() != IStatus.ERROR);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.task.WizardFragment#createComposite()
- */
- public Composite createComposite(Composite parent, IWizardHandle wizard) {
- comp = new TomcatRuntimeComposite(parent, wizard);
- return comp;
- }
-
- public void enter() {
- if (comp != null) {
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- comp.setRuntime(runtime);
- }
- }
-
- public void exit() {
- IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- IPath path = runtime.getLocation();
- if (runtime.validate(null).getSeverity() != IStatus.ERROR)
- TomcatPlugin.setPreference("location" + runtime.getRuntimeType().getId(), path.toString());
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java
deleted file mode 100644
index eb8b6c4c0..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatUIPlugin.java
+++ /dev/null
@@ -1,134 +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.server.tomcat.ui.internal;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-/**
- * The actual Tomcat plugin. It allows the rest of the classes
- * to load images and get a handle to the desktop.
- */
-public class TomcatUIPlugin extends AbstractUIPlugin {
- protected static TomcatUIPlugin singleton;
-
- protected Map imageDescriptors = new HashMap();
-
- // base url for icons
- private static URL ICON_BASE_URL;
-
- private static final String URL_OBJ = "obj16/";
- private static final String URL_WIZBAN = "wizban/";
-
- public static final String PLUGIN_ID = "org.eclipse.jst.server.tomcat.ui";
-
- public static final String IMG_WIZ_TOMCAT = "wizTomcat";
-
- public static final String IMG_WEB_MODULE = "webModule";
- public static final String IMG_MIME_MAPPING = "mimeMapping";
- public static final String IMG_MIME_EXTENSION = "mimeExtension";
- public static final String IMG_PORT = "port";
- public static final String IMG_PROJECT_MISSING = "projectMissing";
-
- public static final String PREF_TOMCAT32_INSTALL_DIR = "tomcat32install";
- public static final String PREF_TOMCAT40_INSTALL_DIR = "tomcat40install";
- public static final String PREF_TOMCAT41_INSTALL_DIR = "tomcat41install";
- public static final String PREF_TOMCAT50_INSTALL_DIR = "tomcat50install";
- public static final String PREF_JDK_INSTALL_DIR = "jdkinstall";
-
- /**
- * TomcatUIPlugin constructor comment.
- */
- public TomcatUIPlugin() {
- super();
- singleton = this;
- }
-
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = new ImageRegistry();
-
- registerImage(registry, IMG_WIZ_TOMCAT, URL_WIZBAN + "tomcat_wiz.gif");
-
- registerImage(registry, IMG_WEB_MODULE, URL_OBJ + "web_module.gif");
- registerImage(registry, IMG_MIME_MAPPING, URL_OBJ + "mime_mapping.gif");
- registerImage(registry, IMG_MIME_EXTENSION, URL_OBJ + "mime_extension.gif");
- registerImage(registry, IMG_PORT, URL_OBJ + "port.gif");
- registerImage(registry, IMG_PROJECT_MISSING, URL_OBJ + "project_missing.gif");
-
- return registry;
- }
-
- /**
- * Return the image with the given key from the image registry.
- * @param key java.lang.String
- * @return org.eclipse.jface.parts.IImage
- */
- public static Image getImage(String key) {
- return getInstance().getImageRegistry().get(key);
- }
-
- /**
- * Return the image with the given key from the image registry.
- * @param key java.lang.String
- * @return org.eclipse.jface.parts.IImage
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- try {
- getInstance().getImageRegistry();
- return (ImageDescriptor) getInstance().imageDescriptors.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Returns the singleton instance of this plugin.
- * @return org.eclipse.jst.server.tomcat.internal.TomcatUIPlugin
- */
- public static TomcatUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Convenience method for logging.
- *
- * @param status org.eclipse.core.runtime.IStatus
- */
- public static void log(IStatus status) {
- getInstance().getLog().log(status);
- }
-
- /**
- * Register an image with the registry.
- * @param key java.lang.String
- * @param partialURL java.lang.String
- */
- private void registerImage(ImageRegistry registry, String key, String partialURL) {
- if (ICON_BASE_URL == null) {
- String pathSuffix = "icons/";
- ICON_BASE_URL = singleton.getBundle().getEntry(pathSuffix);
- }
-
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- registry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error registering image", e);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java
deleted file mode 100644
index c2163b854..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Trace.java
+++ /dev/null
@@ -1,54 +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.server.tomcat.ui.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
- public static byte CONFIG = 0;
- public static byte WARNING = 1;
- public static byte SEVERE = 2;
- public static byte FINEST = 3;
- public static byte FINER = 4;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param level the trace level
- * @param s a message
- */
- public static void trace(byte level, String s) {
- Trace.trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param level the trace level
- * @param s a message
- * @param t a throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!TomcatUIPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(TomcatUIPlugin.PLUGIN_ID + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java
deleted file mode 100644
index 625e295e3..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationMimeEditorSection.java
+++ /dev/null
@@ -1,426 +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.server.tomcat.ui.internal.editor;
-
-import java.beans.*;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jst.server.tomcat.core.internal.MimeMapping;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.command.*;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.Messages;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.ui.*;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * Tomcat configuration mime editor section.
- */
-public class ConfigurationMimeEditorSection extends ServerEditorSection {
- protected TomcatConfiguration tomcatConfiguration;
-
- protected boolean updating;
-
- protected PropertyChangeListener listener;
-
- protected Tree mimeTypes;
- protected int index = -1;
- protected List mappings;
- protected Button add;
- protected Button remove;
- protected Button edit;
-
- /**
- * ConfigurationMimeEditorSection constructor comment.
- */
- public ConfigurationMimeEditorSection() {
- super();
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (TomcatConfiguration.ADD_MAPPING_PROPERTY.equals(event.getPropertyName())) {
- Integer in = (Integer) event.getOldValue();
- MimeMapping mapping = (MimeMapping) event.getNewValue();
- addMimeMapping(in.intValue(), mapping);
- } else if (TomcatConfiguration.REMOVE_MAPPING_PROPERTY.equals(event.getPropertyName())) {
- Integer in = (Integer) event.getNewValue();
- removeMimeMapping(in.intValue());
- } else if (TomcatConfiguration.MODIFY_MAPPING_PROPERTY.equals(event.getPropertyName())) {
- Integer in = (Integer) event.getOldValue();
- MimeMapping mapping = (MimeMapping) event.getNewValue();
- modifyMimeMapping(in.intValue(), mapping);
- }
- }
- };
- tomcatConfiguration.addPropertyChangeListener(listener);
- }
-
- public void createSection(Composite parent) {
- super.createSection(parent);
-
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR
- | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(Messages.configurationEditorMimeMappingsSection);
- section.setDescription(Messages.configurationEditorMimeMappingsDescription);
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_MAPPINGS);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- mimeTypes = toolkit.createTree(composite, SWT.V_SCROLL | SWT.SINGLE | SWT.H_SCROLL);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 220;
- data.heightHint = 200;
- mimeTypes.setLayoutData(data);
- whs.setHelp(mimeTypes, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_LIST);
-
- // add listener to the table
- mimeTypes.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectMimeMapping();
- }
- });
-
- Composite buttonComp = toolkit.createComposite(composite);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttonComp.setLayout(layout);
- buttonComp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- add = toolkit.createButton(buttonComp, Messages.editorAdd, SWT.PUSH);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- add.setLayoutData(data);
-
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MimeMappingDialog dialog = new MimeMappingDialog(getShell());
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- execute(new AddMimeMappingCommand(tomcatConfiguration, dialog.getMimeMapping()));
- }
- }
- });
- whs.setHelp(add, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_ADD);
-
- edit = toolkit.createButton(buttonComp, Messages.editorEdit, SWT.PUSH);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- edit.setLayoutData(data);
- edit.setEnabled(false);
-
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (index < 0)
- return;
- MimeMappingDialog dialog = new MimeMappingDialog(getShell(), (MimeMapping) tomcatConfiguration.getMimeMappings().get(index));
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- execute(new ModifyMimeMappingCommand(tomcatConfiguration, index, dialog.getMimeMapping()));
- }
- }
- });
- whs.setHelp(edit, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_EDIT);
-
- remove = toolkit.createButton(buttonComp, Messages.editorRemove, SWT.PUSH);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 75;
- remove.setLayoutData(data);
- remove.setEnabled(false);
-
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (index < 0)
- return;
- execute(new RemoveMimeMappingCommand(tomcatConfiguration, index));
- index = -1;
- edit.setEnabled(false);
- remove.setEnabled(false);
- }
- });
- whs.setHelp(remove, ContextIds.CONFIGURATION_EDITOR_MAPPINGS_REMOVE);
-
- initialize();
- }
-
- public void dispose() {
- if (tomcatConfiguration != null)
- tomcatConfiguration.removePropertyChangeListener(listener);
- }
-
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- tomcatConfiguration = ts.getTomcatConfiguration();
- } catch (Exception e) {
- // ignore
- }
- addChangeListener();
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (mimeTypes == null)
- return;
-
- mimeTypes.removeAll();
-
- mappings = tomcatConfiguration.getMimeMappings();
-
- // sort mappings
- int size = mappings.size();
- int[] map = new int[size];
- for (int i = 0; i < size; i++)
- map[i] = i;
-
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- MimeMapping mappingA = (MimeMapping) mappings.get(map[i]);
- MimeMapping mappingB = (MimeMapping) mappings.get(map[j]);
- if (mappingA.getMimeType().compareTo(mappingB.getMimeType()) > 0 ||
- ((mappingA.getMimeType().equals(mappingB.getMimeType())) &&
- mappingA.getExtension().compareTo(mappingB.getExtension()) > 0)) {
- int temp = map[i];
- map[i] = map[j];
- map[j] = temp;
- }
- }
- }
-
- // display them
- Map hash = new HashMap();
-
- for (int i = 0; i < size; i++) {
- MimeMapping mapping = (MimeMapping) mappings.get(map[i]);
- // get parent node
- TreeItem parent = (TreeItem) hash.get(mapping.getMimeType());
- if (parent == null) {
- parent = new TreeItem(mimeTypes, SWT.NONE);
- parent.setText(mapping.getMimeType());
- parent.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_MAPPING));
- hash.put(mapping.getMimeType(), parent);
- }
-
- // add node
- TreeItem item = new TreeItem(parent, SWT.NONE);
- item.setText(mapping.getExtension());
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_EXTENSION));
- item.setData(new Integer(map[i]));
- }
-
- if (readOnly) {
- add.setEnabled(false);
- edit.setEnabled(false);
- remove.setEnabled(false);
- } else {
- add.setEnabled(true);
- selectMimeMapping();
- }
- }
-
- /**
- * Add a mime mapping.
- *
- * @param index2
- * @param map
- */
- protected void addMimeMapping(int index2, MimeMapping map) {
- mappings.add(index2, map);
-
- // correct all index numbers
- int size = mimeTypes.getItemCount();
- TreeItem[] parents = mimeTypes.getItems();
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() >= index2)
- children[j].setData(new Integer(in.intValue() + 1));
- }
- }
-
- // check if there is a parent. If so, just add a new child
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
- if (parent.getText().equals(map.getMimeType())) {
- TreeItem item = new TreeItem(parent, SWT.NONE);
- item.setText(map.getExtension());
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_EXTENSION));
- item.setData(new Integer(index2));
- mimeTypes.showItem(item);
- return;
- }
- }
-
- // if not, add a new parent and child to the end
- TreeItem parent = new TreeItem(mimeTypes, SWT.NONE);
- parent.setText(map.getMimeType());
- parent.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_MAPPING));
-
- TreeItem item = new TreeItem(parent, SWT.NONE);
- item.setText(map.getExtension());
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_EXTENSION));
- item.setData(new Integer(index2));
- mimeTypes.showItem(item);
- }
-
- /**
- *
- * @param index2
- * @param map
- */
- protected void modifyMimeMapping(int index2, MimeMapping map) {
- MimeMapping oldMap = (MimeMapping) mappings.get(index2);
- mappings.set(index2, map);
-
- int size = mimeTypes.getItemCount();
- TreeItem[] parents = mimeTypes.getItems();
-
- if (oldMap.getMimeType().equals(map.getMimeType())) {
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- if (parent.getText().equals(map.getMimeType())) {
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() == index2) {
- children[j].setText(map.getExtension());
- children[j].setData(new Integer(index2));
- mimeTypes.showItem(children[j]);
- return;
- }
- }
- }
- }
- return;
- }
-
- // otherwise, let's try a remove and an add
- removeMimeMapping(index2);
- addMimeMapping(index2, map);
- }
-
- /**
- * Remove the mime mapping at the given index.
- *
- * @param index2
- */
- protected void removeMimeMapping(int index2) {
- mappings.remove(index2);
-
- // remove item
- int size = mimeTypes.getItemCount();
- TreeItem[] parents = mimeTypes.getItems();
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() == index2) {
- children[j].dispose();
- if (size2 == 1)
- parent.dispose();
- i += size;
- j += size2;
- }
- }
- }
-
- // correct all index numbers
- size = mimeTypes.getItemCount();
- parents = mimeTypes.getItems();
- for (int i = 0; i < size; i++) {
- TreeItem parent = parents[i];
-
- int size2 = parent.getItemCount();
- TreeItem[] children = parent.getItems();
- for (int j = 0; j < size2; j++) {
- Integer in = (Integer) children[j].getData();
- if (in.intValue() > index2)
- children[j].setData(new Integer(in.intValue() - 1));
- }
- }
- }
-
- /**
- *
- */
- protected void selectMimeMapping() {
- if (readOnly)
- return;
-
- try {
- TreeItem item = mimeTypes.getSelection()[0];
- Integer in = (Integer) item.getData();
- if (in == null) {
- index = -1;
- remove.setEnabled(false);
- edit.setEnabled(false);
- return;
- }
- index = in.intValue();
-
- remove.setEnabled(true);
- edit.setEnabled(true);
- } catch (Exception e) {
- index = -1;
- remove.setEnabled(false);
- edit.setEnabled(false);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java
deleted file mode 100644
index 67bfcb1c7..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationPortEditorSection.java
+++ /dev/null
@@ -1,248 +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.server.tomcat.ui.internal.editor;
-
-import java.beans.*;
-import java.util.Iterator;
-
-import org.eclipse.wst.server.core.ServerPort;
-import org.eclipse.wst.server.ui.editor.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.command.*;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.Messages;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.ui.*;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * Tomcat configuration port editor page.
- */
-public class ConfigurationPortEditorSection extends ServerEditorSection {
- protected TomcatConfiguration tomcatConfiguration;
-
- protected boolean updating;
-
- protected Table ports;
- protected TableViewer viewer;
-
- protected PropertyChangeListener listener;
-
- /**
- * ConfigurationPortEditorSection constructor comment.
- */
- public ConfigurationPortEditorSection() {
- super();
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (TomcatConfiguration.MODIFY_PORT_PROPERTY.equals(event.getPropertyName())) {
- String id = (String) event.getOldValue();
- Integer i = (Integer) event.getNewValue();
- changePortNumber(id, i.intValue());
- }
- }
- };
- tomcatConfiguration.addPropertyChangeListener(listener);
- }
-
- /**
- *
- * @param id java.lang.String
- * @param port int
- */
- protected void changePortNumber(String id, int port) {
- TableItem[] items = ports.getItems();
- int size = items.length;
- for (int i = 0; i < size; i++) {
- ServerPort sp = (ServerPort) items[i].getData();
- if (sp.getId().equals(id)) {
- items[i].setData(new ServerPort(id, sp.getName(), port, sp.getProtocol()));
- items[i].setText(1, port + "");
- /*if (i == selection) {
- selectPort();
- }*/
- return;
- }
- }
- }
-
- /**
- * Creates the SWT controls for this workbench part.
- *
- * @param parent the parent control
- */
- public void createSection(Composite parent) {
- super.createSection(parent);
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(Messages.configurationEditorPortsSection);
- section.setDescription(Messages.configurationEditorPortsDescription);
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- // ports
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 8;
- layout.marginWidth = 8;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL));
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_PORTS);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- ports = toolkit.createTable(composite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
- ports.setHeaderVisible(true);
- ports.setLinesVisible(true);
- whs.setHelp(ports, ContextIds.CONFIGURATION_EDITOR_PORTS_LIST);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn col = new TableColumn(ports, SWT.NONE);
- col.setText(Messages.configurationEditorPortNameColumn);
- ColumnWeightData colData = new ColumnWeightData(15, 150, true);
- tableLayout.addColumnData(colData);
-
- col = new TableColumn(ports, SWT.NONE);
- col.setText(Messages.configurationEditorPortValueColumn);
- colData = new ColumnWeightData(8, 80, true);
- tableLayout.addColumnData(colData);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 230;
- data.heightHint = 100;
- ports.setLayoutData(data);
- ports.setLayout(tableLayout);
-
- viewer = new TableViewer(ports);
- viewer.setColumnProperties(new String[] {"name", "port"});
-
- initialize();
- }
-
- protected void setupPortEditors() {
- viewer.setCellEditors(new CellEditor[] {null, new TextCellEditor(ports)});
-
- ICellModifier cellModifier = new ICellModifier() {
- public Object getValue(Object element, String property) {
- ServerPort sp = (ServerPort) element;
- if (sp.getPort() < 0)
- return "-";
- return sp.getPort() + "";
- }
-
- public boolean canModify(Object element, String property) {
- if ("port".equals(property))
- return true;
-
- return false;
- }
-
- public void modify(Object element, String property, Object value) {
- try {
- Item item = (Item) element;
- ServerPort sp = (ServerPort) item.getData();
- int port = Integer.parseInt((String) value);
- execute(new ModifyPortCommand(tomcatConfiguration, sp.getId(), port));
- } catch (Exception ex) {
- // ignore
- }
- }
- };
- viewer.setCellModifier(cellModifier);
-
- // preselect second column (Windows-only)
- String os = System.getProperty("os.name");
- if (os != null && os.toLowerCase().indexOf("win") >= 0) {
- ports.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- int n = ports.getSelectionIndex();
- viewer.editElement(ports.getItem(n).getData(), 1);
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
- }
-
- public void dispose() {
- if (tomcatConfiguration != null)
- tomcatConfiguration.removePropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * Initializes the editor part with a site and input.
- */
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
- try {
- tomcatConfiguration = ts.getTomcatConfiguration();
- } catch (Exception e) {
- // ignore
- }
- addChangeListener();
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (ports == null)
- return;
-
- ports.removeAll();
-
- Iterator iterator = tomcatConfiguration.getServerPorts().iterator();
- while (iterator.hasNext()) {
- ServerPort port = (ServerPort) iterator.next();
- TableItem item = new TableItem(ports, SWT.NONE);
- String portStr = "-";
- if (port.getPort() >= 0)
- portStr = port.getPort() + "";
- String[] s = new String[] {port.getName(), portStr};
- item.setText(s);
- item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_PORT));
- item.setData(port);
- }
-
- if (readOnly) {
- viewer.setCellEditors(new CellEditor[] {null, null});
- viewer.setCellModifier(null);
- } else {
- setupPortEditors();
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java
deleted file mode 100644
index 3867e9bc2..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ConfigurationWebModuleEditorPart.java
+++ /dev/null
@@ -1,416 +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.server.tomcat.ui.internal.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServerWorkingCopy;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-import org.eclipse.jst.server.tomcat.core.internal.command.AddModuleCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.AddWebModuleCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.ModifyWebModuleCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.RemoveModuleCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.RemoveWebModuleCommand;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.Messages;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.editor.ServerEditorPart;
-/**
- * Tomcat configuration web module editor page.
- */
-public class ConfigurationWebModuleEditorPart extends ServerEditorPart {
- protected ITomcatServerWorkingCopy server2;
- protected TomcatConfiguration configuration;
-
- protected Table webAppTable;
- protected int selection = -1;
- protected Button addProject;
- protected Button addExtProject;
- protected Button remove;
- protected Button edit;
-
- protected PropertyChangeListener listener;
-
- /**
- * ConfigurationWebModuleEditorPart constructor comment.
- */
- public ConfigurationWebModuleEditorPart() {
- super();
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (TomcatConfiguration.MODIFY_WEB_MODULE_PROPERTY.equals(event.getPropertyName())) {
- initialize();
- } else if (TomcatConfiguration.ADD_WEB_MODULE_PROPERTY.equals(event.getPropertyName())) {
- initialize();
- } else if (TomcatConfiguration.REMOVE_WEB_MODULE_PROPERTY.equals(event.getPropertyName())) {
- initialize();
- }
- }
- };
- configuration.addPropertyChangeListener(listener);
- }
-
- /**
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- ScrolledForm form = toolkit.createScrolledForm(parent);
- form.setText(Messages.configurationEditorWebModulesPageTitle);
- form.getBody().setLayout(new GridLayout());
-
- Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(Messages.configurationEditorWebModulesSection);
- section.setDescription(Messages.configurationEditorWebModulesDescription);
- section.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_WEBMODULES);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- webAppTable = toolkit.createTable(composite, SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
- webAppTable.setHeaderVisible(true);
- webAppTable.setLinesVisible(true);
- whs.setHelp(webAppTable, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_LIST);
- //toolkit.paintBordersFor(webAppTable);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn col = new TableColumn(webAppTable, SWT.NONE);
- col.setText(Messages.configurationEditorPathColumn);
- ColumnWeightData colData = new ColumnWeightData(8, 85, true);
- tableLayout.addColumnData(colData);
-
- TableColumn col2 = new TableColumn(webAppTable, SWT.NONE);
- col2.setText(Messages.configurationEditorDocBaseColumn);
- colData = new ColumnWeightData(13, 135, true);
- tableLayout.addColumnData(colData);
-
- TableColumn col3 = new TableColumn(webAppTable, SWT.NONE);
- col3.setText(Messages.configurationEditorProjectColumn);
- colData = new ColumnWeightData(8, 85, true);
- tableLayout.addColumnData(colData);
-
- TableColumn col4 = new TableColumn(webAppTable, SWT.NONE);
- col4.setText(Messages.configurationEditorReloadColumn);
- colData = new ColumnWeightData(7, 75, true);
- tableLayout.addColumnData(colData);
-
- webAppTable.setLayout(tableLayout);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 450;
- data.heightHint = 120;
- webAppTable.setLayoutData(data);
- webAppTable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectWebApp();
- }
- });
-
- Composite rightPanel = toolkit.createComposite(composite);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- rightPanel.setLayout(layout);
- data = new GridData();
- rightPanel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
- //toolkit.paintBordersFor(rightPanel);
-
- // buttons still to add:
- // add project, add external module, remove module
- addProject = toolkit.createButton(rightPanel, Messages.configurationEditorAddProjectModule, SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- addProject.setLayoutData(data);
- whs.setHelp(addProject, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT);
-
- // disable the add project module button if there are no
- // web projects in the workbench
- if (!canAddWebModule())
- addProject.setEnabled(false);
- else {
- addProject.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(), getServer(), server2, configuration, true);
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- execute(new AddModuleCommand(getServer(), dialog.module4));
- }
- }
- });
- }
-
- addExtProject = toolkit.createButton(rightPanel, Messages.configurationEditorAddExternalModule, SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- addExtProject.setLayoutData(data);
- addExtProject.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(), getServer(), server2, configuration, false);
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- execute(new AddWebModuleCommand(configuration, dialog.getWebModule()));
- }
- }
- });
- whs.setHelp(addExtProject, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL);
-
- edit = toolkit.createButton(rightPanel, Messages.editorEdit, SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- edit.setLayoutData(data);
- edit.setEnabled(false);
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (selection < 0)
- return;
- WebModule module = (WebModule) configuration.getWebModules().get(selection);
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(), getServer(), server2, configuration, module);
- dialog.open();
- if (dialog.getReturnCode() == IDialogConstants.OK_ID) {
- execute(new ModifyWebModuleCommand(configuration, selection, dialog.getWebModule()));
- }
- }
- });
- whs.setHelp(edit, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_EDIT);
-
- remove = toolkit.createButton(rightPanel, Messages.editorRemove, SWT.PUSH);
- data = new GridData(GridData.FILL_HORIZONTAL);
- remove.setLayoutData(data);
- remove.setEnabled(false);
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (selection < 0)
- return;
- TableItem item = webAppTable.getItem(selection);
- if (item.getData() != null) {
- IModule module = (IModule) item.getData();
- execute(new RemoveModuleCommand(getServer(), module));
- } else {
- execute(new RemoveWebModuleCommand(configuration, selection));
- }
- remove.setEnabled(false);
- edit.setEnabled(false);
- selection = -1;
- }
- });
- whs.setHelp(remove, ContextIds.CONFIGURATION_EDITOR_WEBMODULES_REMOVE);
-
- form.setContent(section);
- form.reflow(true);
-
- initialize();
- }
-
- protected boolean canAddWebModule() {
- IModule[] modules = ServerUtil.getModules(server.getServerType().getRuntimeType().getModuleTypes());
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- IWebModule webModule = (IWebModule) modules[i].loadAdapter(IWebModule.class, null);
- if (webModule != null) {
- IStatus status = server.canModifyModules(new IModule[] { modules[i] }, null, null);
- if (status != null && status.isOK())
- return true;
- }
- }
- }
- return false;
- }
-
- public void dispose() {
- if (configuration != null)
- configuration.removePropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * Initializes the editor part with a site and input.
- */
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- TomcatServer ts = (TomcatServer) server.loadAdapter(TomcatServer.class, null);
- try {
- configuration = ts.getTomcatConfiguration();
- } catch (Exception e) {
- // ignore
- }
- if (configuration != null)
- addChangeListener();
-
- if (server != null)
- server2 = (ITomcatServerWorkingCopy) server.loadAdapter(ITomcatServerWorkingCopy.class, null);
-
- initialize();
- }
-
- /**
- *
- */
- protected void initialize() {
- if (webAppTable == null)
- return;
-
- webAppTable.removeAll();
- setErrorMessage(null);
-
- List list = configuration.getWebModules();
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- WebModule module = (WebModule) iterator.next();
- TableItem item = new TableItem(webAppTable, SWT.NONE);
-
- // FIX-ME
- String memento = module.getMemento();
- String projectName = "";
- Image projectImage = null;
- if (memento != null && memento.length() > 0) {
- projectName = NLS.bind(Messages.configurationEditorProjectMissing, new String[] {memento});
- projectImage = TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_PROJECT_MISSING);
- IModule module2 = ServerUtil.getModule(memento);
- if (module2 != null) {
- projectName = ServerUICore.getLabelProvider().getText(module2);
- projectImage = ServerUICore.getLabelProvider().getImage(module2);
- item.setData(module2);
- }
- }
-
- String reload = module.isReloadable() ? Messages.configurationEditorReloadEnabled : Messages.configurationEditorReloadDisabled;
- String[] s = new String[] {module.getPath(), module.getDocumentBase(), projectName, reload};
- item.setText(s);
- item.setImage(0, TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_WEB_MODULE));
- if (projectImage != null)
- item.setImage(2, projectImage);
-
- if (!isDocumentBaseValid(module.getDocumentBase())) {
- item.setImage(1, TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_PROJECT_MISSING));
- setErrorMessage(NLS.bind(Messages.errorMissingWebModule, module.getDocumentBase()));
- }
- }
-
- if (readOnly) {
- addProject.setEnabled(false);
- addExtProject.setEnabled(false);
- edit.setEnabled(false);
- remove.setEnabled(false);
- } else {
- addProject.setEnabled(canAddWebModule());
- addExtProject.setEnabled(true);
- }
- }
-
- /**
- *
- */
- protected void selectWebApp() {
- if (readOnly)
- return;
-
- try {
- selection = webAppTable.getSelectionIndex();
- remove.setEnabled(true);
- edit.setEnabled(true);
- } catch (Exception e) {
- selection = -1;
- remove.setEnabled(false);
- edit.setEnabled(false);
- }
- }
-
- protected boolean isDocumentBaseValid(String s) {
- if (s == null || s.length() < 2)
- return true;
-
- // check absolute path
- File f = new File(s);
- if (f.exists())
- return true;
-
- // check workspace
- try {
- if (ResourcesPlugin.getWorkspace().getRoot().getProject(s).exists())
- return true;
- } catch (Exception e) {
- // bad path
- }
-
- // check server relative path
- try {
- f = server.getRuntime().getLocation().append(s).toFile();
- if (f.exists())
- return true;
- } catch (Exception e) {
- // bad path
- }
-
- return false;
- }
-
- /*
- * @see IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (webAppTable != null)
- webAppTable.setFocus();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java
deleted file mode 100644
index cf65ff871..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/MimeMappingDialog.java
+++ /dev/null
@@ -1,155 +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.server.tomcat.ui.internal.editor;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jst.server.tomcat.core.internal.MimeMapping;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.Messages;
-import org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-/**
- * Dialog to add or modify mime mappings.
- */
-public class MimeMappingDialog extends Dialog {
- protected MimeMapping map;
- protected boolean isEdit;
-
- /**
- * MimeMappingDialog constructor comment.
- * @param parentShell org.eclipse.swt.widgets.Shell
- */
- public MimeMappingDialog(Shell parentShell) {
- this(parentShell, new MimeMapping("", ""));
- isEdit = false;
- }
-
- /**
- * MimeMappingDialog constructor.
- *
- * @param parentShell a shell
- * @param map a mime mapping
- */
- public MimeMappingDialog(Shell parentShell, MimeMapping map) {
- super(parentShell);
- this.map = map;
- isEdit = true;
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_MIME_MAPPING));
- if (isEdit)
- newShell.setText(Messages.configurationEditorMimeMapppingDialogTitleEdit);
- else
- newShell.setText(Messages.configurationEditorMimeMapppingDialogTitleAdd);
- }
-
- /**
- * Creates and returns the contents of the upper part
- * of this dialog (above the button bar).
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * creates and returns a new <code>Composite</code> with
- * standard margins and spacing. Subclasses should override.
- * </p>
- *
- * @param parent the parent composite to contain the dialog area
- * @return the dialog area control
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_MAPPING_DIALOG);
-
- new Label(composite, SWT.NONE).setText(Messages.configurationEditorMimeMapppingDialogMimeType);
- final Text type = new Text(composite, SWT.BORDER);
- GridData data = new GridData();
- data.widthHint = 150;
- type.setLayoutData(data);
- type.setText(map.getMimeType());
- type.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- map = new MimeMapping(map.getExtension(), type.getText());
- validate();
- }
- });
- whs.setHelp(type, ContextIds.CONFIGURATION_EDITOR_MAPPING_DIALOG_TYPE);
-
- new Label(composite, SWT.NONE).setText(Messages.configurationEditorMimeMapppingDialogMimeExtension);
- final Text extension = new Text(composite, SWT.BORDER);
- data = new GridData();
- data.widthHint = 150;
- extension.setLayoutData(data);
- extension.setText(map.getExtension());
- extension.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- map = new MimeMapping(extension.getText(), map.getMimeType());
- validate();
- }
- });
- whs.setHelp(extension, ContextIds.CONFIGURATION_EDITOR_MAPPING_DIALOG_EXTENSION);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- protected Control createButtonBar(Composite parent) {
- Control control = super.createButtonBar(parent);
- validate();
-
- return control;
- }
-
- protected void validate() {
- boolean ok = true;
- if (map.getExtension() == null || map.getExtension().length() < 1)
- ok = false;
- if (map.getMimeType() == null || map.getMimeType().length() < 1)
- ok = false;
- getButton(IDialogConstants.OK_ID).setEnabled(ok);
- }
-
- /**
- * Return the mime mapping.
- *
- * @return org.eclipse.jst.server.tomcat.MimeMapping
- */
- public MimeMapping getMimeMapping() {
- return map;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
deleted file mode 100644
index b6c0a253d..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
+++ /dev/null
@@ -1,203 +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.server.tomcat.ui.internal.editor;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.TomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.command.SetDebugModeCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.SetSecureCommand;
-import org.eclipse.jst.server.tomcat.core.internal.command.SetTestEnvironmentCommand;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-import org.eclipse.wst.server.ui.editor.*;
-/**
- * Tomcat server general editor page.
- */
-public class ServerGeneralEditorSection extends ServerEditorSection {
- protected TomcatServer tomcatServer;
-
- protected Button secure;
- protected Button debug;
- protected Button testEnvironment;
- protected boolean updating;
-
- protected PropertyChangeListener listener;
-
- /**
- * ServerGeneralEditorPart constructor comment.
- */
- public ServerGeneralEditorSection() {
- // do nothing
- }
-
- /**
- *
- */
- protected void addChangeListener() {
- listener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (updating)
- return;
- updating = true;
- if (TomcatServer.PROPERTY_SECURE.equals(event.getPropertyName())) {
- Boolean b = (Boolean) event.getNewValue();
- ServerGeneralEditorSection.this.secure.setSelection(b.booleanValue());
- } else if (TomcatServer.PROPERTY_DEBUG.equals(event.getPropertyName())) {
- Boolean b = (Boolean) event.getNewValue();
- ServerGeneralEditorSection.this.debug.setSelection(b.booleanValue());
- } else if (ITomcatServer.PROPERTY_TEST_ENVIRONMENT.equals(event.getPropertyName())) {
- Boolean b = (Boolean) event.getNewValue();
- ServerGeneralEditorSection.this.testEnvironment.setSelection(b.booleanValue());
- }
- updating = false;
- }
- };
- server.addPropertyChangeListener(listener);
- }
-
- /**
- * Creates the SWT controls for this workbench part.
- *
- * @param parent the parent control
- */
- public void createSection(Composite parent) {
- super.createSection(parent);
- FormToolkit toolkit = getFormToolkit(parent.getDisplay());
-
- Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED
- | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.FOCUS_TITLE);
- section.setText(Messages.serverEditorGeneralSection);
- section.setDescription(Messages.serverEditorGeneralDescription);
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
-
- Composite composite = toolkit.createComposite(section);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginHeight = 5;
- layout.marginWidth = 10;
- layout.verticalSpacing = 5;
- layout.horizontalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.SERVER_EDITOR);
- toolkit.paintBordersFor(composite);
- section.setClient(composite);
-
- // test environment
- testEnvironment = toolkit.createButton(composite, Messages.serverEditorTestEnvironment, SWT.CHECK);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- testEnvironment.setLayoutData(data);
- testEnvironment.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (updating)
- return;
- updating = true;
- execute(new SetTestEnvironmentCommand(tomcatServer, testEnvironment.getSelection()));
- updating = false;
- }
- });
- whs.setHelp(testEnvironment, ContextIds.SERVER_EDITOR_TEST_ENVIRONMENT);
-
- // security
- secure = toolkit.createButton(composite, Messages.serverEditorSecure, SWT.CHECK);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- secure.setLayoutData(data);
- secure.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (updating)
- return;
- updating = true;
- execute(new SetSecureCommand(tomcatServer, secure.getSelection()));
- updating = false;
- }
- });
- whs.setHelp(secure, ContextIds.SERVER_EDITOR_SECURE);
-
- // debug mode
- debug = toolkit.createButton(composite, Messages.serverEditorDebugMode, SWT.CHECK);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 3;
- debug.setLayoutData(data);
- debug.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- if (updating)
- return;
- updating = true;
- execute(new SetDebugModeCommand(tomcatServer, debug.getSelection()));
- updating = false;
- }
- });
- whs.setHelp(debug, ContextIds.SERVER_EDITOR_DEBUG_MODE);
-
- initialize();
- }
-
- public void dispose() {
- if (server != null)
- server.removePropertyChangeListener(listener);
- }
-
- public void init(IEditorSite site, IEditorInput input) {
- super.init(site, input);
-
- if (server != null) {
- tomcatServer = (TomcatServer) server.loadAdapter(TomcatServer.class, null);
- addChangeListener();
- }
- initialize();
- }
-
- /**
- * Initialize the fields in this editor.
- */
- protected void initialize() {
- if (secure == null || tomcatServer == null)
- return;
- updating = true;
-
- testEnvironment.setSelection(tomcatServer.isTestEnvironment());
- secure.setSelection(tomcatServer.isSecure());
- if (server.getRuntime() != null && server.getRuntime().getRuntimeType().getId().indexOf("32") >= 0 || readOnly)
- debug.setEnabled(false);
- else {
- debug.setEnabled(true);
- debug.setSelection(tomcatServer.isDebug());
- }
-
- if (readOnly)
- secure.setEnabled(false);
- else
- secure.setEnabled(true);
-
- updating = false;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java
deleted file mode 100644
index 1b8dab7b2..000000000
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/WebModuleDialog.java
+++ /dev/null
@@ -1,288 +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.server.tomcat.ui.internal.editor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatConfiguration;
-import org.eclipse.jst.server.tomcat.core.internal.ITomcatServer;
-import org.eclipse.jst.server.tomcat.core.internal.WebModule;
-import org.eclipse.jst.server.tomcat.ui.internal.ContextIds;
-import org.eclipse.jst.server.tomcat.ui.internal.Messages;
-import org.eclipse.jst.server.tomcat.ui.internal.Trace;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.ui.ServerUICore;
-/**
- * Dialog to add or modify web modules.
- */
-public class WebModuleDialog extends Dialog {
- protected IModule module4;
- protected WebModule module;
- protected boolean isEdit;
- protected boolean isProject;
- protected Text docBase;
- protected IServerAttributes server2;
- protected ITomcatServer server;
- protected ITomcatConfiguration config;
-
- protected Table projTable;
-
- /**
- * WebModuleDialog constructor comment.
- *
- * @param parentShell a shell
- * @param server2 a server
- * @param server a Tomcat server
- * @param config a Tomcat server configuration
- * @param module a module
- */
- public WebModuleDialog(Shell parentShell, IServerAttributes server2, ITomcatServer server, ITomcatConfiguration config, WebModule module) {
- super(parentShell);
- this.module = module;
- this.server2 = server2;
- this.server = server;
- this.config = config;
- isEdit = true;
- }
-
- /**
- * WebModuleDialog constructor comment.
- *
- * @param parentShell a shell
- * @param server2 a server
- * @param server a Tomcat server
- * @param config a Tomcat server configuration
- * @param isProject true if it is a project
- */
- public WebModuleDialog(Shell parentShell, IServerAttributes server2, ITomcatServer server, ITomcatConfiguration config, boolean isProject) {
- this(parentShell, server2, server, config, new WebModule("/", "", null, true));
- isEdit = false;
- this.isProject = isProject;
- }
-
- /**
- *
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- if (isEdit)
- newShell.setText(Messages.configurationEditorWebModuleDialogTitleEdit);
- else
- newShell.setText(Messages.configurationEditorWebModuleDialogTitleAdd);
- }
-
- /**
- * Creates and returns the contents of the upper part
- * of this dialog (above the button bar).
- * <p>
- * The <code>Dialog</code> implementation of this framework method
- * creates and returns a new <code>Composite</code> with
- * standard margins and spacing. Subclasses should override.
- * </p>
- *
- * @param parent the parent composite to contain the dialog area
- * @return the dialog area control
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
- whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG);
- // add project field if we are adding a project
- if (!isEdit && isProject) {
- Label l = new Label(composite, SWT.NONE);
- l.setText(Messages.configurationEditorWebModuleDialogProjects);
- GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- l.setLayoutData(data);
-
- projTable = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- data = new GridData();
- data.widthHint = 150;
- data.heightHint = 75;
- projTable.setLayoutData(data);
- whs.setHelp(projTable, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT);
-
- // fill table with web module projects
- IModule[] modules = ServerUtil.getModules(server2.getServerType().getRuntimeType().getModuleTypes());
- if (modules != null) {
- int size = modules.length;
- for (int i = 0; i < size; i++) {
- IModule module3 = modules[i];
- if ("jst.web".equals(module3.getModuleType().getId())) {
- IStatus status = server2.canModifyModules(new IModule[] { module3 }, null, null);
- if (status != null && status.isOK()) {
- TableItem item = new TableItem(projTable, SWT.NONE);
- item.setText(0, ServerUICore.getLabelProvider().getText(module3));
- item.setImage(0, ServerUICore.getLabelProvider().getImage(module3));
- item.setData(module3);
- }
- }
- }
- }
- new Label(composite, SWT.NONE).setText(" ");
- }
-
- new Label(composite, SWT.NONE).setText(Messages.configurationEditorWebModuleDialogDocumentBase);
- docBase = new Text(composite, SWT.BORDER);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- docBase.setLayoutData(data);
- docBase.setText(module.getDocumentBase());
- whs.setHelp(docBase, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE);
-
- // disable document base for project modules
- if (isProject || (module.getMemento() != null && module.getMemento().length() > 0))
- docBase.setEditable(false);
- else {
- docBase.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- module = new WebModule(module.getPath(), docBase.getText(), module.getMemento(), module.isReloadable());
- validate();
- }
- });
- }
-
- if (isEdit || isProject)
- new Label(composite, SWT.NONE).setText(" ");
- else {
- Button browse = new Button(composite, SWT.NONE);
- browse.setText(Messages.browse);
- browse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent se) {
- try {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(Messages.configurationEditorWebModuleDialogSelectDirectory);
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null)
- docBase.setText(selectedDirectory);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error browsing", e);
- }
- }
- });
- }
-
- // path (context-root)
- new Label(composite, SWT.NONE).setText(Messages.configurationEditorWebModuleDialogPath);
- final Text path = new Text(composite, SWT.BORDER);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.widthHint = 150;
- path.setLayoutData(data);
- path.setText(module.getPath());
- /*if (module.getMemento() != null && module.getMemento().length() > 0)
- path.setEditable(false);
- else*/
- path.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- module = new WebModule(path.getText(), module.getDocumentBase(), module.getMemento(), module.isReloadable());
- }
- });
- whs.setHelp(path, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH);
-
- new Label(composite, SWT.NONE).setText("");
-
- if (!isProject) {
- // auto reload
- new Label(composite, SWT.NONE).setText("");
- final Button reloadable = new Button(composite, SWT.CHECK);
- reloadable.setText(Messages.configurationEditorWebModuleDialogReloadEnabled);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- reloadable.setLayoutData(data);
- reloadable.setSelection(module.isReloadable());
- reloadable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- module = new WebModule(module.getPath(), module.getDocumentBase(), module.getMemento(), reloadable.getSelection());
- }
- });
- whs.setHelp(reloadable, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_RELOAD);
- }
-
- if (!isEdit && isProject) {
- projTable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- IModule module3 = (IModule) projTable.getSelection()[0].getData();
- IWebModule module2 = (IWebModule) module3.loadAdapter(IWebModule.class, null);
- String contextRoot = module2.getContextRoot();
- if (contextRoot != null && !contextRoot.startsWith("/") && contextRoot.length() > 0)
- contextRoot = "/" + contextRoot;
- module = new WebModule(contextRoot, module3.getName(), module3.getId(), module.isReloadable());
- docBase.setText(module3.getName());
- path.setText(contextRoot);
- module4 = module3;
- } catch (Exception e) {
- // ignore
- }
- validate();
- }
- });
- new Label(composite, SWT.NONE).setText("");
- }
-
- Dialog.applyDialogFont(composite);
- return composite;
- }
-
- protected Control createButtonBar(Composite parent) {
- Control control = super.createButtonBar(parent);
- validate();
-
- return control;
- }
-
- protected void validate() {
- boolean ok = true;
- if (module.getDocumentBase() == null || module.getDocumentBase().length() < 1)
- ok = false;
-
- getButton(IDialogConstants.OK_ID).setEnabled(ok);
- }
-
- /**
- * Return the mime mapping.
- *
- * @return org.eclipse.jst.server.tomcat.WebModule
- */
- public WebModule getWebModule() {
- return module;
- }
-} \ No newline at end of file

Back to the top