This commit was manufactured by cvs2svn to create tag 'v20041220'.
diff --git a/plugins/org.eclipse.jst.server.generic.ui/.classpath b/plugins/org.eclipse.jst.server.generic.ui/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.server.generic.ui/.cvsignore b/plugins/org.eclipse.jst.server.generic.ui/.cvsignore
deleted file mode 100644
index 058a1b7..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-genericui.jar
-org.eclipse.jst.server.generic.ui_1.0.0.jar
-temp.folder
diff --git a/plugins/org.eclipse.jst.server.generic.ui/.project b/plugins/org.eclipse.jst.server.generic.ui/.project
deleted file mode 100644
index af14ba8..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.server.generic.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.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.server.generic.ui/build.properties b/plugins/org.eclipse.jst.server.generic.ui/build.properties
deleted file mode 100644
index 6b4a2a0..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.genericui.jar = src/
-output.genericui.jar = bin/
-bin.includes = plugin.xml,\
- genericui.jar,\
- icons/,\
- plugin.properties
-src.includes = icons/,\
- plugin.xml,\
- plugin.properties,\
- src/
diff --git a/plugins/org.eclipse.jst.server.generic.ui/icons/obj16/lomboz.gif b/plugins/org.eclipse.jst.server.generic.ui/icons/obj16/lomboz.gif
deleted file mode 100644
index 5b3a198..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/icons/obj16/lomboz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.generic.ui/icons/wizban/logo.gif b/plugins/org.eclipse.jst.server.generic.ui/icons/wizban/logo.gif
deleted file mode 100644
index 854d525..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/icons/wizban/logo.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.generic.ui/plugin.properties b/plugins/org.eclipse.jst.server.generic.ui/plugin.properties
deleted file mode 100644
index 8a61dcb..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/plugin.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-pluginName=Generic Server Plugin UI
-providerName=Eteration.com
-pluginDescription=UI Components for the generic server plugin.
-
diff --git a/plugins/org.eclipse.jst.server.generic.ui/plugin.xml b/plugins/org.eclipse.jst.server.generic.ui/plugin.xml
deleted file mode 100644
index bda1669..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/plugin.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.jst.server.generic.ui"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.jst.server.generic.ui.GenericUiPlugin"
- description="%pluginDescription">
-
- <runtime>
- <library name="genericui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.server.ui"/>
- <import plugin="org.eclipse.debug.ui"/>
- <import plugin="org.eclipse.jdt.debug.ui"/>
- <import plugin="org.eclipse.jst.server.generic.core"/>
- <import plugin="org.eclipse.wst.server.core" />
- </requires>
-
- <extension
- point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- id="org.eclipse.jst.server.generic.runtime"
- typeIds="org.eclipse.jst.server.generic.runtime"
- class="org.eclipse.jst.server.generic.internal.ui.GenericServerRuntimeWizardFragment"/>
- </extension>
-
-<extension
- point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- id="org.eclipse.jst.server.generic.server"
- typeIds="org.eclipse.jst.server.generic"
- class="org.eclipse.jst.server.generic.internal.ui.GenericServerWizardFragment"/>
- </extension>
- <extension point="org.eclipse.wst.server.ui.editorPages">
- <page
- id="org.eclipse.jst.server.generic.configuration.editor.webmodule"
- order="20"
- name="Lomboz server Edit"
- typeIds="org.eclipse.jst.server.generic.*"
- class="org.eclipse.jst.server.generic.internal.ui.GenericServerEditorPartFactory"/>
- </extension>
-
- <extension point="org.eclipse.wst.server.ui.editorPageSections">
- <section
- id="org.eclipse.jst.server.generic.editor.general"
- order="0"
- insertionId="org.eclipse.wst.server.editor.overview.left"
- typeIds="org.eclipse.jst.server.generic.*"
- class="org.eclipse.jst.server.generic.internal.ui.GenericServerEditorSectionFactory"/>
- </extension>
- <extension point="org.eclipse.wst.server.ui.serverImages">
- <image
- id="org.eclipse.jst.server.generic.image"
- icon="icons/obj16/lomboz.gif"
- typeIds="org.eclipse.jst.server.generic.runtime"/>
- <image
- id="org.eclipse.jst.server.generic.image"
- icon="icons/obj16/lomboz.gif"
- typeIds="org.eclipse.jst.server.generic"/>
- </extension>
- <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- id="org.eclipse.jst.server.generic.image.ui.launchConfigurationTypeImage"
- configTypeID="org.eclipse.jst.server.generic.core.launchConfigurationType"
- icon="icons/obj16/lomboz.gif">
- </launchConfigurationTypeImage>
- </extension>
-
- <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- id="org.eclipse.jst.server.generic.internal.ui.launchConfigurationTabGroup"
- type="org.eclipse.jst.server.generic.core.launchConfigurationType"
- class="org.eclipse.jst.server.generic.internal.ui.GenericLaunchConfigurationTabGroup">
- </launchConfigurationTabGroup>
- </extension>
-
-
-</plugin>
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericLaunchConfigurationTabGroup.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericLaunchConfigurationTabGroup.java
deleted file mode 100644
index b217b1f..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-package org.eclipse.jst.server.generic.internal.ui;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.EnvironmentTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-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.jdt.debug.ui.launchConfigurations.JavaJRETab;
-import org.eclipse.wst.server.ui.ServerLaunchConfigurationTab;
-
-
-public class GenericLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup{
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup ILaunchConfigurationTabGroup#createTabs(ILaunchConfigurationDialog, String)
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[7];
- tabs[0] = new ServerLaunchConfigurationTab(new String[] { "org.eclipse.jst.server.generic" });
- 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 JavaJRETab();
- tabs[5].setLaunchConfigurationDialog(dialog);
- tabs[6] = new CommonTab();
- tabs[6].setLaunchConfigurationDialog(dialog);
- setTabs(tabs);
- }}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerEditorPartFactory.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerEditorPartFactory.java
deleted file mode 100644
index 6db0bc0..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerEditorPartFactory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-package org.eclipse.jst.server.generic.internal.ui;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.editor.ServerEditorPartFactoryDelegate;
-
-
-public class GenericServerEditorPartFactory extends
- ServerEditorPartFactoryDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.editor.IServerEditorPartFactoryDelegate#shouldCreatePage(org.eclipse.wst.server.core.IServer, org.eclipse.wst.server.core.IServerConfiguration)
- */
- public boolean shouldCreatePage(IServer server) {
- // TODO Auto-generated method stub
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.editor.IServerEditorPartFactoryDelegate#createPage()
- */
- public IEditorPart createPage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerEditorSectionFactory.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerEditorSectionFactory.java
deleted file mode 100644
index d7ad817..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerEditorSectionFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.eclipse.jst.server.generic.internal.ui;
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.editor.IServerEditorSection;
-import org.eclipse.wst.server.ui.editor.ServerEditorPageSectionFactoryDelegate;
-
-public class GenericServerEditorSectionFactory extends
- ServerEditorPageSectionFactoryDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.editor.IServerEditorPageSectionFactoryDelegate#shouldCreateSection(org.eclipse.wst.server.core.IServer, org.eclipse.wst.server.core.IServerConfiguration)
- */
- public boolean shouldCreateSection(IServer server) {
- // TODO Auto-generated method stub
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.editor.IServerEditorPageSectionFactoryDelegate#createSection()
- */
- public IServerEditorSection createSection() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerRuntimeWizardFragment.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerRuntimeWizardFragment.java
deleted file mode 100644
index 7b4d5df..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerRuntimeWizardFragment.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-package org.eclipse.jst.server.generic.internal.ui;
-
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jst.server.generic.internal.core.GenericServerRuntime;
-import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
-import org.eclipse.jst.server.generic.ui.GenericServerUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ITaskModel;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-
-/**
- * A serverDefinitionType aware wizard for defining runtimes.
- *
- * @author Gorkem Ercan
- */
-public class GenericServerRuntimeWizardFragment extends ServerDefinitionTypeAwareWizardFragment {
-
-
- private Group selectionBar;
- private Combo fServerCombo;
- private ServerTypeDefinitionGroup fServerPanel;
- private RuntimeDelegate fRuntimeDelegate;
- private Map fServerRuntimeProperties;
- private String fSelectedServerType;
-
-
- /**
- * Constructor
- */
- public GenericServerRuntimeWizardFragment() {
- super();
- }
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.ui.wizard.IWizardFragment#isComplete()
- */
- public boolean isComplete() {
- RuntimeDelegate runtime = getRuntimeDelegate();
- if (runtime == null)
- return false;
- IStatus status = runtime.validate();
- return (status != null && status.isOK());
- }
-
- public void createContent(Composite parent, IWizardHandle handle) {
- fRuntimeDelegate=null;
- createSelectionBar(parent);
- createServerDefinitionTypeComposite(parent);
- }
-
-
- private void swapBody()
- {
- this.fRuntimeDelegate=null;
- String selected = fServerCombo == null ? null : fServerCombo
- .getItem(fServerCombo.getSelectionIndex());
- Map properties = null;
- ServerRuntime definition = getServerTypeDefinition(selected,properties);
- fServerPanel.reset(definition,ServerTypeDefinitionGroup.CONTEXT_RUNTIME, properties);
- }
- /**
- * @param selected
- */
- private void createServerDefinitionTypeComposite(Composite parent) {
- String selected = fServerCombo==null?null:fServerCombo.getItem(fServerCombo.getSelectionIndex());
- if(getServerDefinitionId()!=null)
- selected=getServerDefinitionId();
- Map properties= null;
- if(getRuntimeDelegate()!=null)
- properties = getRuntimeDelegate().getAttribute(GenericServerRuntime.SERVER_INSTANCE_PROPERTIES,(Map)null);
- ServerRuntime definition = getServerTypeDefinition(selected,properties);
- fServerPanel = new ServerTypeDefinitionGroup(this,definition,ServerTypeDefinitionGroup.CONTEXT_RUNTIME,properties,parent);
- }
- private void createSelectionBar(Composite content) {
- selectionBar = new Group(content, SWT.SHADOW_ETCHED_IN);
- selectionBar.setLayout(new GridLayout(2,false));
- selectionBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Label label = new Label(selectionBar, SWT.NONE);
- label.setText(GenericServerUIMessages.getString("runtimeWizard.label.serverType"));
- label.setLayoutData(new GridData());
- fServerCombo = new Combo(selectionBar, SWT.BORDER |SWT.READ_ONLY);
- ServerRuntime[] servers = getAllServerDefinitionTypes();
- for(int i=0; i<servers.length; i++){
- fServerCombo.add(servers[i].getName());
- }
- fServerCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- if(fServerCombo.getItemCount()>0)
- {
- if(getServerDefinitionId()!=null)
- {
- selectServerDefinition();
- }
- fServerCombo.select(0);
- }
- fServerCombo.addSelectionListener(
- new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- swapBody();
- serverDefinitionTypePropertiesChanged();
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- }
- );
- }
-
-
- private String getServerDefinitionId()
- {
- String currentDefinition= null;
- if(getRuntimeDelegate()!=null)
- currentDefinition = getRuntimeDelegate().getAttribute(GenericServerRuntime.SERVER_DEFINITION_ID,"");
- if(currentDefinition!= null && currentDefinition.length()>0)
- {
- return currentDefinition;
- }
- return null;
- }
-
- private void selectServerDefinition()
- {
- String currentDefinition = getServerDefinitionId();
- int selectIndex = 0;
- if(currentDefinition != null)
- {
- selectIndex = fServerCombo.indexOf(currentDefinition);
- if(selectIndex<0)
- selectIndex =0;
- }
- fServerCombo.select(selectIndex);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.wizard.IWizardFragment#enter()
- */
- public void enter() {
- String serverDefinition = getServerDefinitionId();
- if(serverDefinition!=null && serverDefinition.length()>0)
- {
- selectServerDefinition();
- Map properties = null;
- if (getRuntimeDelegate() != null) {
- properties = getRuntimeDelegate().getAttribute(GenericServerRuntime.SERVER_INSTANCE_PROPERTIES,(Map) null);
- }
- ServerRuntime definition = getServerTypeDefinition(serverDefinition,properties);
- fServerPanel.reset(definition,ServerTypeDefinitionGroup.CONTEXT_RUNTIME, properties);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.ui.wizard.IWizardFragment#exit()
- */
- public void exit() {
- try {
- getRuntimeDelegate().getRuntimeWorkingCopy().save(true,new NullProgressMonitor());
- }
- catch(Exception e){//unhandled
- }
- fRuntimeDelegate=null;
-
- }
- protected String getSelectedServerType(){
- return fSelectedServerType;
- }
- protected Map getServerRuntimeProperties(){
- return fServerRuntimeProperties;
- }
-
- private String createName()
- {
- String selected = getSelectedServerType();
- RuntimeDelegate dl = getRuntimeDelegate();
- IRuntimeType runtimeType = dl.getRuntime().getRuntimeType();
- String name = GenericServerUIMessages.getFormattedString("runtimeName", new String[] {selected,runtimeType.getName()});
-
-
- IRuntime[] list = ServerCore.getRuntimes();
-
- int suffix = 1;
- String suffixName=name;
- for(int i=0;i<list.length;i++)
- {
- if(list[i].getName().equals(name)|| list[i].getName().equals(suffixName))
- suffix++;
- suffixName= name+" "+suffix;
- }
-
- if(suffix>1)
- return suffixName;
- return name;
- }
-
- private RuntimeDelegate getRuntimeDelegate()
- {
- if(fRuntimeDelegate == null)
- {
- IRuntimeWorkingCopy wc = (IRuntimeWorkingCopy)getTaskModel().getObject(ITaskModel.TASK_RUNTIME);
- if(wc==null)
- return null;
- fRuntimeDelegate = (RuntimeDelegate)wc.getAdapter(RuntimeDelegate.class);
- }
- return fRuntimeDelegate;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.server.generic.internal.ui.ServerDefinitionTypeAwareWizardFragment#description()
- */
- public String description() {
- return GenericServerUIMessages.getString("runtimeWizardDescription");
- }
- /* (non-Javadoc)
- * @see org.eclipse.jst.server.generic.internal.ui.ServerDefinitionTypeAwareWizardFragment#title()
- */
- public String title() {
- return GenericServerUIMessages.getString("runtimeWizardTitle");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.server.generic.internal.ui.ServerDefinitionTypeAwareWizardFragment#serverDefinitionTypePropertiesChanged()
- */
- public void serverDefinitionTypePropertiesChanged() {
- fSelectedServerType = fServerCombo.getItem(fServerCombo.getSelectionIndex());
- fServerRuntimeProperties = fServerPanel.getProperties();
- String selected = getSelectedServerType();
- Map properties = getServerRuntimeProperties();
- RuntimeDelegate dl = getRuntimeDelegate();
- dl.setAttribute(GenericServerRuntime.SERVER_DEFINITION_ID, selected);
- dl.setAttribute(GenericServerRuntime.SERVER_INSTANCE_PROPERTIES,properties);
- dl.getRuntimeWorkingCopy().setName(createName());
-
- validate();
- }
-
- private void validate()
- {
- if (getRuntimeDelegate() == null) {
- this.getWizard().setMessage("", IMessageProvider.ERROR);
- return;
- }
- IStatus status = getRuntimeDelegate().validate();
- if (status == null || status.isOK())
- getWizard().setMessage(null, IMessageProvider.NONE);
- else
- getWizard().setMessage(status.getMessage(), IMessageProvider.ERROR);
- getWizard().update();
- }
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerWizardFragment.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerWizardFragment.java
deleted file mode 100644
index 96af454..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/GenericServerWizardFragment.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-package org.eclipse.jst.server.generic.internal.ui;
-
-import java.util.Map;
-import org.eclipse.jst.server.generic.internal.core.GenericServerRuntime;
-import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
-import org.eclipse.jst.server.generic.ui.GenericServerUIMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ITaskModel;
-import org.eclipse.wst.server.core.model.RuntimeDelegate;
-import org.eclipse.wst.server.core.model.ServerDelegate;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-/**
- *
- *
- * @author Gorkem Ercan
- */
-public class GenericServerWizardFragment extends ServerDefinitionTypeAwareWizardFragment
-{
-
- private ServerTypeDefinitionGroup fComposite;
- private Map fProperties;
- /* (non-Javadoc)
- * @see com.ibm.wtp.server.ui.wizard.IWizardFragment#isComplete()
- */
- public boolean isComplete() {
-
- ServerRuntime serverRuntime = getServerTypeDefinitionFor(getServer());
- if(serverRuntime==null)
- return false;
- return true;
- }
-
- public void createContent(Composite parent, IWizardHandle handle){
- createBody(parent,handle);
- }
- /**
- *
- */
- private void createBody(Composite parent, IWizardHandle handle)
- {
- IServerWorkingCopy server = getServer();
- ServerRuntime definition = getServerTypeDefinitionFor(server);
- fComposite = new ServerTypeDefinitionGroup(this, definition,ServerTypeDefinitionGroup.CONTEXT_SERVER, null,parent);
-
- }
-
- /**
- * @param server
- * @return
- */
- private ServerRuntime getServerTypeDefinitionFor(IServerWorkingCopy server) {
-
- RuntimeDelegate runtime = (RuntimeDelegate)server.getRuntime().getAdapter(RuntimeDelegate.class);
- if(runtime==null){
- IRuntimeWorkingCopy wc = (IRuntimeWorkingCopy)getTaskModel().getObject(ITaskModel.TASK_RUNTIME);
-
- runtime= (RuntimeDelegate)wc.getAdapter(RuntimeDelegate.class);
- }
- String id = runtime.getAttribute(GenericServerRuntime.SERVER_DEFINITION_ID,(String)null);
- if(id==null){
- return null;
- }
- Map runtimeProperties = runtime.getAttribute(GenericServerRuntime.SERVER_INSTANCE_PROPERTIES,(Map)null);
- ServerRuntime definition = getServerTypeDefinition(id,runtimeProperties);
- return definition;
- }
-
- /**
- * @return
- */
- private IServerWorkingCopy getServer() {
- IServerWorkingCopy server = (IServerWorkingCopy)getTaskModel().getObject(ITaskModel.TASK_SERVER);
- return server;
- }
-
- public void enter() {
- IServerWorkingCopy server = getServer();
- ServerRuntime definition = getServerTypeDefinitionFor(server);
- if(definition != null && fComposite!=null)
- fComposite.reset(definition,ServerTypeDefinitionGroup.CONTEXT_SERVER,null);
- }
- public void exit(){
- fProperties = fComposite.getProperties();
- serverDefinitionTypePropertiesChanged();
- }
-
- protected Map getServerProperties(){
- return fProperties;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.server.generic.internal.ui.ServerDefinitionTypeAwareWizardFragment#description()
- */
- public String description() {
- return GenericServerUIMessages.getString("serverWizardDescription");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.server.generic.internal.ui.ServerDefinitionTypeAwareWizardFragment#title()
- */
- public String title() {
- return GenericServerUIMessages.getString("serverWizardTitle");
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.server.generic.internal.ui.ServerDefinitionTypeAwareWizardFragment#serverDefinitionTypePropertiesChanged()
- */
- public void serverDefinitionTypePropertiesChanged() {
- fProperties = fComposite.getProperties();
- IServerWorkingCopy serverWorkingCopy = getServer();
- ServerRuntime definition = getServerTypeDefinitionFor(serverWorkingCopy);
-
- serverWorkingCopy.setName(GenericServerUIMessages.getFormattedString("serverName",new String[] {definition.getName()}));
- ServerDelegate dl= (ServerDelegate)serverWorkingCopy.getAdapter(ServerDelegate.class);
- dl.setAttribute(GenericServerRuntime.SERVER_INSTANCE_PROPERTIES,getServerProperties());
- }
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/ServerDefinitionTypeAwareWizardFragment.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/ServerDefinitionTypeAwareWizardFragment.java
deleted file mode 100644
index 2b8413c..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/ServerDefinitionTypeAwareWizardFragment.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Created on Oct 19, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.server.generic.internal.ui;
-
-import java.util.Map;
-import org.eclipse.jst.server.generic.core.CorePlugin;
-import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
-import org.eclipse.jst.server.generic.ui.GenericUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-
-/**
- *
- *
- * @author Gorkem Ercan
- */
-public abstract class ServerDefinitionTypeAwareWizardFragment extends WizardFragment {
-
- private IWizardHandle fWizard;
- public boolean hasComposite() {
- return true;
- }
-
- public Composite createComposite(Composite parent, IWizardHandle handle) {
-
- this.fWizard = handle;
- Composite container = new Composite(parent, SWT.NONE);
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout grid = new GridLayout(1,false);
- container.setLayout(grid);
- handle.setImageDescriptor(GenericUiPlugin.getDefault().imageDescriptor(GenericUiPlugin.WIZBAN_IMAGE));
- handle.setTitle(title());
- handle.setDescription(description());
- createContent(container,handle);
- return container;
- }
- public IWizardHandle getWizard(){
- return fWizard;
- }
- /**
- * Returns the description to be displayed on the wizard head.
- * @return
- */
- public abstract String description();
- /**
- * Returns the title of the wizard.
- * @return
- */
- public abstract String title();
-
- public abstract void createContent(Composite parent, IWizardHandle handle);
-
- public abstract void serverDefinitionTypePropertiesChanged();
-
- protected ServerRuntime getServerTypeDefinition(String definitionID, Map properties)
- {
- return CorePlugin.getDefault().getServerTypeDefinitionManager().getServerRuntimeDefinition(definitionID,properties);
- }
-
- protected ServerRuntime[] getAllServerDefinitionTypes()
- {
- return CorePlugin.getDefault().getServerTypeDefinitionManager().getServerTypeDefinitions();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/ServerTypeDefinitionGroup.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/ServerTypeDefinitionGroup.java
deleted file mode 100644
index 8d1b91b..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/internal/ui/ServerTypeDefinitionGroup.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-package org.eclipse.jst.server.generic.internal.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jst.server.generic.servertype.definition.Property;
-import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
-import org.eclipse.jst.server.generic.ui.GenericServerUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-
-public class ServerTypeDefinitionGroup
-{
- public static final String CONTEXT_SERVER = Property.CONTEXT_SERVER;
- public static final String CONTEXT_RUNTIME = Property.CONTEXT_RUNTIME;
-
- private ServerRuntime fServerTypeDefinition;
- private List fPropertyControls = new ArrayList();
- private Map fPropertyMap =new HashMap();
- private String fContext="undefined";
- private Group fDefinitionGroup;
- private ServerDefinitionTypeAwareWizardFragment fAwareWizardFragment;
- private class PropertyModifyListener implements ModifyListener
- {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- fAwareWizardFragment.serverDefinitionTypePropertiesChanged();
-
- }
-
- }
-
- /**
- * Construct a composite for the given ServerTypeDefinition
- *
- * @param definition
- * @param initialProperties initial values null means use default
- * @param parent
- * @param style
- */
- public ServerTypeDefinitionGroup(ServerDefinitionTypeAwareWizardFragment fragment, ServerRuntime definition, String context, Map initialProperties, Composite parent)
- {
- fAwareWizardFragment = fragment;
- initServerTypeDefinition(definition,context,initialProperties);
- createControl(parent);
- }
- private void initProperties(Map initialProperties)
- {
- if(initialProperties!= null)
- this.fPropertyMap=initialProperties;
- else
- fPropertyMap=new HashMap();
- }
- /**
- * Changes the values with the given ones. Renders the UI
- * with the given new values.
- *
- * @param definition
- * @param context
- * @param initialProperties
- */
- public void reset(ServerRuntime definition, String context, Map initialProperties)
- {
- initServerTypeDefinition(definition, context, initialProperties);
- fDefinitionGroup.setText(definition.getName());
- Control[] allControls = fDefinitionGroup.getChildren();
- for(int i= 0; i<allControls.length;i++)
- {
- Control c = allControls[i];
- c.dispose();
- }
- fPropertyControls.clear();
- createPropertyControls(fDefinitionGroup);
-
- fDefinitionGroup.layout(true);
-
- }
-
- /**
- * @param definition
- * @param context
- * @param initialProperties
- */
- private void initServerTypeDefinition(ServerRuntime definition, String context, Map initialProperties) {
- fServerTypeDefinition = definition;
- initProperties(initialProperties);
- this.fContext = context;
- }
- /**
- * @param parent
- */
- private void createControl(Composite parent) {
-
- fDefinitionGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
- fDefinitionGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
- fDefinitionGroup.setLayout(new GridLayout(3,false));
- if(fServerTypeDefinition!=null)
- {
- fDefinitionGroup.setText(fServerTypeDefinition.getName());
-
- createPropertyControls(fDefinitionGroup);
- }
- }
- /**
- * @param defPanel
- */
- private void createPropertyControls(Composite definitionComposite) {
- List properties = fServerTypeDefinition.getProperty();
- for(int i = 0; i<properties.size(); i++)
- {
- Property property = (Property)properties.get(i);
- if(this.fContext.equals(property.getContext()))
- createPropertyControl(definitionComposite,property);
- }
-
- }
-
- private void createPropertyControl(Composite parent, Property property)
- {
- if( "directory".equals(property.getType())) {
- Text path = createLabeledPath(property.getLabel(),getPropertyValue(property),parent);
- path.setData(property);
- fPropertyControls.add(path);
- } else if( "file".equals(property.getType())) {
- Text file = createLabeledFile(property.getLabel(),getPropertyValue(property),parent);
- file.setData(property);
- fPropertyControls.add(file);
- } else if( "string".equals(property.getType())) {
- Text str = createLabeledText(property.getLabel(),getPropertyValue(property),parent);
- str.setData(property);
- fPropertyControls.add(str);
- } else if( "boolean".equals(property.getType())) {
- Button bool =createLabeledCheck(property.getLabel(),("true".equals( getPropertyValue(property))), parent);
- bool.setData(property);
- fPropertyControls.add(bool);
- } else {
- Text defaultText= createLabeledText(property.getLabel(),getPropertyValue(property),parent);
- defaultText.setData(property);
- fPropertyControls.add(defaultText);
- }
- }
- private String getPropertyValue(Property property)
- {
- String value = property.getDefault();
- if(fPropertyMap!=null && fPropertyMap.isEmpty()==false)
- value=(String)fPropertyMap.get(property.getId());
- return value;
- }
- protected Button createLabeledCheck(String title, boolean value,
- Composite defPanel) {
- GridData gridData;
- Label label = new Label(defPanel, SWT.WRAP);
- gridData = new GridData();
- label.setLayoutData(gridData);
- label.setText(title);
-
- Button fButton = new Button(defPanel, SWT.CHECK);
-
- gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- gridData.horizontalSpan = 2;
- fButton.setLayoutData(gridData);
- fButton.setSelection(value);
- fButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- fAwareWizardFragment.serverDefinitionTypePropertiesChanged();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- });
-
- return fButton;
- }
- protected Text createLabeledFile(String title, String value,
- Composite defPanel) {
- GridData gridData;
- Label label = new Label(defPanel, SWT.WRAP);
- gridData = new GridData();
- label.setLayoutData(gridData);
- label.setText(title);
-
- final Text fText = new Text(defPanel, SWT.SHADOW_IN | SWT.BORDER);
- gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- gridData.horizontalSpan = 1;
- fText.setLayoutData(gridData);
- fText.setText(value);
- fText.addModifyListener(new PropertyModifyListener());
- Button fButton = new Button(defPanel, SWT.PUSH);
- fButton.setText(GenericServerUIMessages.getString("serverTypeGroup.label.browse"));
- fButton.setLayoutData(new GridData());
- fButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- FileDialog dlg = new FileDialog(fDefinitionGroup.getShell());
- dlg.setFileName(fText.getText());
- String res = dlg.open();
- if (res != null) {
- fText.setText(res);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- });
-
- return fText;
- }
- protected Text createLabeledPath(String title, String value,
- Composite parent) {
- GridData gridData;
- Label label = new Label(parent, SWT.WRAP);
- gridData = new GridData();
- label.setLayoutData(gridData);
- label.setText(title);
-
- final Text fText = new Text(parent, SWT.SHADOW_IN | SWT.BORDER);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
- fText.setLayoutData(gridData);
- fText.setText(value);
- fText.addModifyListener(new PropertyModifyListener());
- Button fButton = new Button(parent, SWT.PUSH);
- fButton.setText(GenericServerUIMessages.getString("serverTypeGroup.label.browse"));
- fButton.setLayoutData(new GridData());
- fButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dlg = new DirectoryDialog(fDefinitionGroup.getShell());
- dlg.setFilterPath(fText.getText());
- String res = dlg.open();
- if (res != null) {
- fText.setText(res);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- });
-
- return fText;
- }
- protected Text createLabeledText(String title, String value,
- Composite defPanel) {
- GridData gridData;
- Label label = new Label(defPanel, SWT.WRAP);
- gridData = new GridData();
- label.setLayoutData(gridData);
- label.setText(title);
-
- Text fText = new Text(defPanel, SWT.SHADOW_IN | SWT.BORDER);
- gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- gridData.horizontalSpan = 2;
- fText.setLayoutData(gridData);
- fText.setText(value);
- fText.addModifyListener(new PropertyModifyListener());
- return fText;
- }
- public Map getProperties()
- {
- for(int i=0; i<fPropertyControls.size();i++)
- {
- if(fPropertyControls.get(i)instanceof Button)
- {
- Button button = (Button)fPropertyControls.get(i);
- Property prop = (Property)button.getData();
- fPropertyMap.put(prop.getId(),Boolean.toString(button.getSelection()));
- }
- else
- {
- Text text = (Text)fPropertyControls.get(i);
- Property prop = (Property)text.getData();
- fPropertyMap.put(prop.getId(),text.getText());
- }
- }
- return fPropertyMap;
- }
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericServerUIMessages.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericServerUIMessages.java
deleted file mode 100644
index b1a5537..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericServerUIMessages.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.jst.server.generic.ui;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Helper class to get messages
- *
- * @author Gorkem Ercan
- */
-public class GenericServerUIMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.jst.server.generic.ui.GenericServerUIMessages";//$NON-NLS-1$
-
- private static ResourceBundle fResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private GenericServerUIMessages() {
- }
-
- /**
- * Return string from the resource bundle.
- *
- * @param key the string used to get the bundle value, must not be <code>null</code>
- * @return the string from the resource bundle
- */
- public static String getString(String key) {
- try {
- return fResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Gets a string from the resource bundle that is
- * formatted it with the given argument.
- *
- * @param key the string used to get the bundle value, must not be null
- * @param arg the argument used to format the string
- * @return the formatted string
- */
- public static String getFormattedString(String key, Object[] arg) {
- String format= null;
- try {
- format= fResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";
- }
- if (arg == null)
- arg= new Object[0];
- return MessageFormat.format(format,arg );
- }
-
- /**
- * Returns a resource bundle.
- *
- * @return the resource bundle
- */
- public static ResourceBundle getResourceBundle() {
- return fResourceBundle;
- }
-}
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericServerUIMessages.properties b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericServerUIMessages.properties
deleted file mode 100644
index 7d6b62a..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericServerUIMessages.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-serverWizardTitle=New Generic Server
-serverWizardDescription=Create a new server of the selected server type
-runtimeWizardTitle=New Generic Server Runtime
-runtimeWizardDescription=Define a new Generic Runtime for your server type
-runtimeWizard.label.serverType=Server types:
-serverTypeGroup.label.browse=Browse...
-serverName = {0}(Generic)
-runtimeName= {0}({1})
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericUiPlugin.java b/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericUiPlugin.java
deleted file mode 100644
index 0de4415..0000000
--- a/plugins/org.eclipse.jst.server.generic.ui/src/org/eclipse/jst/server/generic/ui/GenericUiPlugin.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Eteration Bilisim A.S.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Gorkem Ercan - initial API and implementation
- * Naci M. Dai
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ETERATION A.S. OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Eteration Bilisim A.S. For more
- * information on eteration, please see
- * <http://www.eteration.com/>.
- ***************************************************************************/
-package org.eclipse.jst.server.generic.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.ui.plugin.*;
-import org.osgi.framework.BundleContext;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- *
- * @author Gorkem Ercan
- */
-public class GenericUiPlugin extends AbstractUIPlugin {
-
- public static final String WIZBAN_IMAGE = "genericlogo";
- //The shared instance.
- private static GenericUiPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public GenericUiPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.server.generic.ui.GenericUiPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
- public static GenericUiPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = GenericUiPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = new ImageRegistry();
- ImageDescriptor desc = ImageDescriptor.createFromURL(getDefault().getBundle().getEntry("/icons/wizban/logo.gif"));
- registry.put(WIZBAN_IMAGE,desc);
- return registry;
- }
- public ImageDescriptor imageDescriptor(String key){
- return getImageRegistry().getDescriptor(key);
- }
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.classpath b/plugins/org.eclipse.wst.internet.monitor.core/.classpath
deleted file mode 100644
index 1d974a9..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="monitorcore/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore b/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore
deleted file mode 100644
index 8ca260d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-monitorcore.jar
-build.xml
-temp.folder
-org.eclipse.wst.internet.monitor.core_3.0.0.jar
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.options b/plugins/org.eclipse.wst.internet.monitor.core/.options
deleted file mode 100644
index 3d70459..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.options
+++ /dev/null
@@ -1,6 +0,0 @@
-# Debugging options for the org.eclipse.wst.internet.monitor.core plugin
-
-# Turn on general debugging
-org.eclipse.wst.internet.monitor.core/debug=false
-
-org.eclipse.wst.internet.monitor.core/parsing=false
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/.project b/plugins/org.eclipse.wst.internet.monitor.core/.project
deleted file mode 100644
index 93b239c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.monitor.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/build.properties b/plugins/org.eclipse.wst.internet.monitor.core/build.properties
deleted file mode 100644
index f8cb62c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/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,\
- *.jar,\
- monitorcore.jar,\
- plugin.properties,\
- .options
-jars.compile.order =
-src.includes = build.properties,\
- schema/
-output.monitorcore.jar = bin/
-source.monitorcore.jar = monitorcore/
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ContentFilterDelegate.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ContentFilterDelegate.java
deleted file mode 100644
index 2137876..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ContentFilterDelegate.java
+++ /dev/null
@@ -1,36 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-
-import java.io.IOException;
-/**
- * A content filter that filters contents from the monitor traffic on a request.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>contentFilters</code> extension point.
- * </p>
- *
- * @since 1.0
- */
-public abstract class ContentFilterDelegate {
- /**
- * Filter the given content from the given request. The content that has been filtered out will
- * not be shown to clients of the TCP/IP monitor.
- *
- * @param request the request that the filter will be performed on
- * @param isRequest set to true if the content filter applies to request monitor traffic,
- * or set to false if the content filter applies to the response monitor traffic
- * @param content the message content to be filtered out
- * @return the filtered content
- * @throws IOException if there is an error while parsing or filtering the content
- */
- public abstract byte[] filter(IRequest request, boolean isRequest, byte[] content) throws IOException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IContentFilter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IContentFilter.java
deleted file mode 100644
index 894787e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IContentFilter.java
+++ /dev/null
@@ -1,62 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-
-import java.io.IOException;
-/**
- * A content filter that filters specific contents from the monitor traffic
- * of a request.
- * The global list of known content filters is available via
- * {@link MonitorCore.getContentFilters()}.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 1.0
- */
-public interface IContentFilter {
- /**
- * Returns the id of this filter.
- * Each filter has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the displayable (translated) name for this filter.
- *
- * @return a displayable name
- */
- public String getName();
-
- /**
- * Returns the relative order for this filter.
- * Each filter has a relative order that allows them to be applied in the correct
- * order relative to each other. Lower orders are processed first.
- *
- * @return the relative order
- */
- public int getOrder();
-
- /**
- * Filter the given content from the given request. The content that has been filtered out will
- * not be shown to clients of the TCP/IP monitor.
- *
- * @param request the request that the filter will be performed on
- * @param isRequest set to true if the content filter applies to request monitor traffic,
- * or set to false if the content filter applies to the response monitor traffic
- * @param content the message content to be filtered out
- * @return the filtered content
- * @throws IOException if there is an error while parsing or filtering the content
- */
- public byte[] filter(IRequest request, boolean isRequest, byte[] content) throws IOException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitor.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitor.java
deleted file mode 100644
index f07de72..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitor.java
+++ /dev/null
@@ -1,88 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-/**
- * Represents the monitor that monitors the network traffic between a server and a client.
- * The global list of known monitors is available via {@link MonitorCore.getMonitors()}.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IMonitorWorkingCopy
- * @since 1.0
- */
-public interface IMonitor {
- /**
- * Returns the id of this monitor.
- * Each monitor has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the remote host name of the server to be monitored.
- *
- * @return the remote host name
- */
- public String getRemoteHost();
-
- /**
- * Returns the remote port number of the server to be monitored.
- *
- * @return the remote port number
- */
- public int getRemotePort();
-
- /**
- * Returns the local port number of the client that monitor traffic will used.
- *
- * @return the local port number
- */
- public int getLocalPort();
-
- /**
- * Returns the protocol adapter that the monitor will be used to read the monitor traffic.
- *
- * @return the protocol adapter
- */
- public IProtocolAdapter getProtocolAdapter();
-
- /**
- * Returns whether this monitor is currently running.
- *
- * @return <code>true</code> if the monitor is currently running; otherwise, return <code>false</code>.
- */
- public boolean isRunning();
-
- /**
- * Deletes this monitor. The monitor will no longer be available to users.
- * This method has no effect if the monitor has already been deleted.
- */
- public void delete();
-
- /**
- * Returns whether this monitor is a working copy. Monitors which return
- * <code>true</code> to this method can be safely cast to
- * <code>org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy</code>
- *
- * @return whether this monitor is a working copy
- */
- public boolean isWorkingCopy();
-
- /**
- * Returns a working copy of this monitor. Changes to the working copy will be
- * applied to this monitor when saved.
- *
- * @return a working copy of this monitor
- */
- public IMonitorWorkingCopy getWorkingCopy();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorListener.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorListener.java
deleted file mode 100644
index 3e4d107..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorListener.java
+++ /dev/null
@@ -1,38 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-/**
- * Listener that listen to the monitor add, remove and changes.
- *
- * @since 1.0
- */
-public interface IMonitorListener {
- /**
- * This method is being called when a monitor is added.
- *
- * @param monitor the monitor that has been added
- */
- public void monitorAdded(IMonitor monitor);
-
- /**
- * This method is being called when a monitor is changed.
- *
- * @param monitor the monitor that has been changed
- */
- public void monitorChanged(IMonitor monitor);
-
- /**
- * This method is being called when a monitor is removed.
- *
- * @param monitor the monitor that has been removed
- */
- public void monitorRemoved(IMonitor monitor);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorWorkingCopy.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorWorkingCopy.java
deleted file mode 100644
index ab49196..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IMonitorWorkingCopy.java
+++ /dev/null
@@ -1,57 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-/**
- * Represents a working copy of a monitor. A working copy is a copy that the attributes can be changed.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @see IMonitor
- * @since 1.0
- */
-public interface IMonitorWorkingCopy extends IMonitor {
- /**
- * Set the remote (server) host name.
- *
- * @param host the new host name
- */
- public void setRemoteHost(String host);
-
- /**
- * Set the remote (server) host port number.
- *
- * @param port the new port number
- */
- public void setRemotePort(int port);
-
- /**
- * Set the local (client) port number.
- *
- * @param port the local (client) port number
- */
- public void setLocalPort(int port);
-
- /**
- * Set the protocol adapter. This protocol adapter is responsible for translating
- * network traffic between the server and the client.
- *
- * @param type the protocol adapter.
- *
- */
- public void setProtocolAdapter(IProtocolAdapter protocolAdapter);
-
- /**
- * Saves the changes to this working copy and returns the resulting monitor.
- *
- * @return the modified or created monitor
- */
- public IMonitor save();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IProtocolAdapter.java
deleted file mode 100644
index 62f1105..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IProtocolAdapter.java
+++ /dev/null
@@ -1,38 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-/**
- * A protocol adapter allows the monitor to support a new protocol between a client
- * and server, and manages the message passing between the two.
- * The global list of known protocol adapters is available via
- * {@link MonitorCore.getProtocolAdapters()}.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 1.0
- */
-public interface IProtocolAdapter {
- /**
- * Returns the id of this adapter.
- * Each adapter has a distinct, fixed id. Ids are intended to be used internally as keys;
- * they are not intended to be shown to end users.
- *
- * @return the element id
- */
- public String getId();
-
- /**
- * Returns the displayable (translated) name for this adapter.
- *
- * @return a displayable name
- */
- public String getName();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequest.java
deleted file mode 100644
index ab7e3de..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequest.java
+++ /dev/null
@@ -1,167 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-
-import java.util.Date;
-
-import org.eclipse.core.runtime.IAdaptable;
-/**
- * Represents a request that has been made between the client and a server.
- * The global list of known requests is available via {@link MonitorCore.getRequests()}.
- *
- * @since 1.0
- */
-public interface IRequest extends IAdaptable {
- /**
- * Request content type (value 1) for the transport (header) of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int TRANSPORT = 1;
-
- /**
- * Request content type (value 2) for the content (body) of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int CONTENT = 2;
-
- /**
- * Request content type (value 3) for the entire content of a request
- * or response.
- *
- * @see #getRequest(int)
- * @see #getResponse(int)
- */
- public static final int ALL = 3;
-
- /**
- * Return the protocol adapter of the request.
- *
- * @return org.eclipse.wst.internet.monitor.core.IProtocolAdapter
- */
- public IProtocolAdapter getProtocolAdapter();
-
- /**
- * Return the date/time of this request.
- *
- * @return the timestamp
- */
- public Date getDate();
-
- /**
- * Returns the local (client) port.
- *
- * @return the local port number
- */
- public int getLocalPort();
-
- /**
- * Returns the remote (server) host.
- *
- * @return the remote host
- */
- public String getRemoteHost();
-
- /**
- * Returns the remote (server) port.
- *
- * @return the remote port number
- */
- public int getRemotePort();
-
- /**
- * Returns the request as a byte array.
- *
- * @param type the content type (IRequest.X)
- * @return the request content
- */
- public byte[] getRequest(int type);
-
- /**
- * Returns the response as a byte array.
- *
- * @param type the content type (IRequest.X)
- * @return the response content
- */
- public byte[] getResponse(int type);
-
- /**
- * Returns the response time in milliseconds.
- *
- * @return the server's response time
- */
- public long getResponseTime();
-
- /**
- * Returns a label for this request.
- *
- * @return the label
- */
- public String getLabel();
-
- /**
- * Add a property to the request.
- *
- * @param key the key of the property to be added
- * @param value the value of the property to be added
- */
- public void addProperty(String key, Object value);
-
- /**
- * Get a string property with a given key from the request.
- *
- * @param key the key of the property
- * @return the value of property
- */
- public String getStringProperty(String key);
-
- /**
- * Get a integer property with a given key from the request.
- *
- * @param key the key of the property
- * @return the value of property
- */
- public Integer getIntegerProperty(String key);
-
- /**
- * Get a property with a given key from the request.
- *
- * @param key the key of the property
- * @return the value of property
- */
- public Object getObjectProperty(String key);
-
- /**
- * Hook to allow other plugins that implement IRequest to fire a change event.
- * After the internal values have changed, call this method to invoke a request
- * change event to all registered listeners.
- */
- public void fireChangedEvent();
-
- /**
- * Add a resend request to this request.
- *
- * @param request the resend request to add
- */
- public void addResendRequest(IRequest request);
-
- /**
- * Returns an array of resend requests based on this request.
- *
- * @return The array of resend requests based on this request
- */
- public IResendRequest[] getResendRequests();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequestListener.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequestListener.java
deleted file mode 100644
index 02dbb08..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IRequestListener.java
+++ /dev/null
@@ -1,38 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-/**
- * A listener for changes to the requests.
- *
- * @since 1.0
- */
-public interface IRequestListener {
- /**
- * The given request has been added to the list.
- *
- * @param request the request that has been added
- */
- public void requestAdded(IRequest request);
-
- /**
- * The given request has been changed.
- *
- * @param request the request that has been changed
- */
- public void requestChanged(IRequest request);
-
- /**
- * The given request is been removed from the list.
- *
- * @param request the request that has been removed
- */
- public void requestRemoved(IRequest request);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IResendRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IResendRequest.java
deleted file mode 100644
index 6a6baaa..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/IResendRequest.java
+++ /dev/null
@@ -1,51 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-/**
- * A representation of a request that is to be resent. This interface is not
- * meant to be implemented by clients.
- * <p>
- * Resend requests are used when a client wants to modify and resend a previously
- * monitored request back to the server.
- * </p>
- *
- * @since 1.0
- */
-public interface IResendRequest extends IRequest {
- /**
- * Send the request
- */
- public void sendRequest();
-
- /**
- * Returns <code>true</code> if this request has been sent, and
- * <code>false</code> otherwise.
- *
- * @return <code>true</code> if this request has been sent, <code>false</code> otherwise
- */
- public boolean hasBeenSent();
-
- /**
- * Set the request.
- *
- * @param request the request to set
- * @param type the type of the request to set
- */
- public void setRequest(byte[] request, int type);
-
- /**
- * Get the original request that this request is based on.
- *
- * @return the original request that this request is based on, or
- * <code>null</code> if there is none
- */
- public IRequest getOriginalRequest();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/MonitorCore.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/MonitorCore.java
deleted file mode 100644
index a8c58f5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/MonitorCore.java
+++ /dev/null
@@ -1,268 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.InputStreamReader;
-import java.util.List;
-
-import org.eclipse.wst.internet.monitor.core.internal.MonitorManager;
-import org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-import org.eclipse.wst.internet.monitor.core.internal.http.ResendHTTPRequest;
-/**
- * Base class for obtaining references to monitor models. This class also provide methods
- * to do operations on a monitor.
- *
- * @since 1.0
- */
-public class MonitorCore {
- /**
- * Protocol adapter id (value "TCPIP") for TCP/IP. Provided here for convenience;
- * other protocol adapters may be available.
- *
- * @see #findProtocolAdapter(String)
- */
- public static String TCPIP_PROTOCOL_ID = "TCPIP";
-
- /**
- * Protocol adapter id (value "HTTP") for HTTP. Provided here for convenience;
- * other protocol adapters may be available.
- *
- * @see #findProtocolAdapter(String)
- */
- public static String HTTP_PROTOCOL_ID = "HTTP";
-
- private static MonitorManager manager = MonitorManager.getInstance();
-
- private static final String lineSeparator = System.getProperty("line.separator");
-
- /**
- * Returns an array of all known monitor instances. The list will not contain any
- * working copies.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of monitor instances {@link IMonitor}
- */
- public static IMonitor[] getMonitors() {
- List list = manager.getMonitors();
- IMonitor[] m = new IMonitor[list.size()];
- list.toArray(m);
- return m;
- }
-
- /**
- * Create a new monitor. The monitor will not exist for use until
- * the save() method has been called.
- *
- * @return a working copy of the created monitor
- */
- public static IMonitorWorkingCopy createMonitor() {
- return manager.createMonitor();
- }
-
- /**
- * Start the given monitor listening on it's client port.
- * The monitor must not be null.
- *
- * @param monitor the monitor to be started
- * @throws Exception thrown if the monitor fails to start because the port
- * is in use or another problem occurs
- */
- public static void startMonitor(IMonitor monitor) throws Exception {
- if (monitor == null)
- throw new IllegalArgumentException();
- manager.startMonitor(monitor);
- }
-
- /**
- * Stop the given monitor and removes all resources.
- * The monitor must not be null.
- *
- * @param monitor the monitor to be stopped
- */
- public static void stopMonitor(IMonitor monitor) {
- if (monitor == null)
- throw new IllegalArgumentException();
- manager.stopMonitor(monitor);
- }
-
- /**
- * Returns an array of all known protocol adapter instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of protocol adapter instances {@link IProtocolAdater}
- */
- public static IProtocolAdapter[] getProtocolAdapters() {
- return MonitorPlugin.getInstance().getProtocolAdapters();
- }
-
- /**
- * Returns the protocol adapter with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * protocol adapter ({@link #getProtocolAdapters()}) for the one with a
- * matching id ({@link IProtocolAdater#getId()}). The id may not be null.
- *
- * @param the protocol adapter id
- * @return the protocol adapter instance, or <code>null</code> if there
- * is no protocol adapter with the given id
- */
- public static IProtocolAdapter findProtocolAdapter(String id) {
- return MonitorPlugin.getInstance().getProtocolAdapter(id);
- }
-
- /**
- * Returns an array of all known content filters.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of content filter instances {@link IContentFilter}
- */
- public static IContentFilter[] getContentFilters() {
- return MonitorPlugin.getInstance().getContentFilters();
- }
-
- /**
- * Returns the content filter with the given id, or <code>null</code>
- * if none. This convenience method searches the list of known
- * content filters ({@link #getContentFilters()}) for the one with a
- * matching id ({@link IContentFilter#getId()}). The id may not be null.
- *
- * @param the content filter id
- * @return the content filter instance, or <code>null</code> if there
- * is no content filter with the given id
- */
- public static IContentFilter findContentFilter(String id) {
- return MonitorPlugin.getInstance().getContentFilter(id);
- }
-
- /**
- * Add a monitor listener.
- * Once registered, a listener starts receiving notification of
- * changes to the monitors. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the monitor listener
- * @see #removeMonitorListener(IMonitorListener)
- */
- public static void addMonitorListener(IMonitorListener listener) {
- manager.addMonitorListener(listener);
- }
-
- /**
- * Removes the given monitor listener. Has no
- * effect if the listener is not registered.
- *
- * @param listener the listener
- * @see #addMonitorListener(IMonitorListener)
- */
- public static void removeMonitorListener(IMonitorListener listener) {
- manager.removeMonitorListener(listener);
- }
-
- /**
- * Returns an array of all known request instances.
- * <p>
- * A new array is returned on each call, so clients may store or modify the result.
- * </p>
- *
- * @return a possibly-empty array of request instances {@link IRequest}
- */
- public static IRequest[] getRequests() {
- List list = manager.getRequests();
- IRequest[] r = new IRequest[list.size()];
- list.toArray(r);
- return r;
- }
-
- /**
- * Remove all requests. This method clears all requests and their data
- * from the buffer and notifies the request listeners.
- */
- public static void removeAllRequests() {
- manager.removeAllRequests();
- }
-
- /**
- * Add a request listener.
- * Once registered, a listener starts receiving notification of
- * changes to the requests. The listener continues to receive
- * notifications until it is removed.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener the request listener
- * @see #removeRequestListener(IRequestListener)
- */
- public static void addRequestListener(IRequestListener listener) {
- manager.addRequestListener(listener);
- }
-
- /**
- * Removes the given request listener. Has no
- * effect if the listener is not registered.
- *
- * @param listener the listener
- * @see #addRequestListener(IRequestListener)
- */
- public static void removeRequestListener(IRequestListener listener) {
- manager.removeRequestListener(listener);
- }
-
- /**
- * Convenience method to parse the given bytes into String form. The bytes
- * are parsed into a line delimited string. The byte array must not be null.
- *
- * @param b a byte array
- * @return the string after the conversion
- */
- public static String parse(byte[] b) {
- if (b == null)
- throw new IllegalArgumentException();
-
- ByteArrayInputStream bin = new ByteArrayInputStream(b);
- BufferedReader br = new BufferedReader(new InputStreamReader(bin));
- StringBuffer sb = new StringBuffer();
- try {
- String s = br.readLine();
-
- while (s != null) {
- sb.append(s);
- s = br.readLine();
- if (s != null)
- sb.append(lineSeparator);
- }
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error parsing input", e);
- }
-
- return sb.toString();
- }
-
- /**
- * Create and return an new IResendRequest from the specified request.
- * The request may not be null.
- *
- * @param request the request that is to be resent
- * @return a new IResendRequest based on the specified request
- */
- public static IResendRequest createResendRequest(IRequest request) {
- if (request == null)
- throw new IllegalArgumentException();
- return new ResendHTTPRequest(request);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ProtocolAdapterDelegate.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ProtocolAdapterDelegate.java
deleted file mode 100644
index 7b10e7c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/ProtocolAdapterDelegate.java
+++ /dev/null
@@ -1,42 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core;
-
-import java.io.IOException;
-import java.net.Socket;
-/**
- * A protocol adapter allows the monitor to support a new protocol between a client
- * and server, and manages the message passing between the two.
- * <p>
- * This abstract class is intended to be extended only by clients
- * to extend the <code>protocolAdapters</code> extension point.
- * </p>
- *
- * @since 1.0
- */
-public abstract class ProtocolAdapterDelegate {
- /**
- * Attaches the protocol adapter to the given monitor using the input and output socket.
- * The adapter is responsible for:
- * * opening the input & output streams to pass information from the input socket
- * (the client) to the output socket (server).
- * * passing information from the output socket (server) back to the client.
- * * creating and populating new org.eclipse.wst.internet.monitor.core.IRequest objects as necessary.
- * * closing/cleanup on the input and output sockets.
- *
- * @param monitor the monitor that uses this protocol adapter
- * @param in the input socket of the monitor client
- * @param out the output socket of the monitor server
- * @throws IOException if an exception occur when opening the streams of the input or
- * output sockets.
- */
- public abstract void connect(IMonitor monitor, Socket in, Socket out) throws IOException;
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java
deleted file mode 100644
index 6f1eccb..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/AcceptThread.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.InterruptedIOException;
-import java.net.*;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-/**
- * The actual TCP/IP monitoring server. This is a thread that
- * listens on a port and relays a call to another server.
- */
-public class AcceptThread {
- protected IMonitor monitor;
-
- protected boolean alive = true;
- protected ServerSocket serverSocket;
-
- protected Thread thread;
-
- class ServerThread extends Thread {
- /**
- * Actual running of the server proxy.
- */
- public void run() {
- // create a new server socket
- try {
- serverSocket = new ServerSocket(monitor.getLocalPort());
- serverSocket.setSoTimeout(2000);
-
- Trace.trace(Trace.FINEST, "Monitoring localhost:" + monitor.getLocalPort() + " -> " + monitor.getRemoteHost() + ":" + monitor.getRemotePort());
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not start monitoring");
- return;
- }
-
- while (alive) {
- try {
- // accept the connection from the client
- Socket localSocket = serverSocket.accept();
-
- // connect to the remote server
- Socket remoteSocket = new Socket(monitor.getRemoteHost(), monitor.getRemotePort());
-
- // relay the call through
- ProtocolAdapter adapter = (ProtocolAdapter) monitor.getProtocolAdapter();
- adapter.parse(monitor, localSocket, remoteSocket);
- } catch (InterruptedIOException e) {
- // do nothing
- } catch (Exception e) {
- if (alive)
- Trace.trace(Trace.SEVERE, "Error while monitoring", e);
- }
- }
- }
- }
-
- /**
- * ServerMonitorThread constructor comment.
- */
- public AcceptThread(IMonitor monitor) {
- super();
- this.monitor = monitor;
- }
-
- public void startServer() {
- if (thread != null)
- return;
- thread = new ServerThread();
- thread.setDaemon(true);
- thread.start();
- }
-
- public boolean isRunning() {
- return (thread != null);
- }
-
- /**
- * Correctly close the server socket and shut down the server.
- */
- public void stopServer() {
- try {
- alive = false;
- thread = null;
- serverSocket.close();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error stopping server", e);
- }
- }
-
- /**
- * Returns true if this port is in use.
- *
- * @return boolean
- * @param port int
- */
- public static boolean isPortInUse(int port) {
- ServerSocket s = null;
- try {
- s = new ServerSocket(port);
- } catch (SocketException e) {
- return true;
- } catch (Exception e) {
- return true;
- } finally {
- if (s != null) {
- try {
- s.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java
deleted file mode 100644
index a11526d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Connection.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.net.Socket;
-/**
- *
- */
-public class Connection {
- protected Socket in;
- protected Socket out;
-
- public Connection(Socket in, Socket out) {
- this.in = in;
- this.out = out;
- }
-
- public void close() {
- Trace.trace(Trace.FINEST, "Closing connection");
- try {
- in.getOutputStream().flush();
- in.shutdownInput();
- in.shutdownOutput();
-
- out.getOutputStream().flush();
- out.shutdownInput();
- out.shutdownOutput();
- Trace.trace(Trace.FINEST, "Connection closed");
- } catch (Exception ex) {
- Trace.trace(Trace.WARNING, "Error closing connection " + this + " " + ex.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java
deleted file mode 100644
index 43a0a60..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ContentFilter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.ContentFilterDelegate;
-import org.eclipse.wst.internet.monitor.core.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-/**
- *
- */
-public class ContentFilter implements IContentFilter {
- protected IConfigurationElement element;
- protected ContentFilterDelegate delegate;
-
- protected ContentFilter(IConfigurationElement element) {
- this.element = element;
- }
-
- public String getId() {
- return element.getAttribute("id");
- }
-
- /*
- * [issue: I couldn't find any place that is using the order]
- */
- public int getOrder() {
- try {
- return Integer.parseInt(element.getAttribute("order"));
- } catch (Exception e) {
- return 0;
- }
- }
-
- public String getName() {
- return element.getAttribute("name");
- }
-
- public byte[] filter(IRequest request, boolean isRequest, byte[] content) throws IOException {
- if (delegate == null) {
- try {
- delegate = (ContentFilterDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create content filter delegate: " + getId(), e);
- return new byte[0];
- }
- }
- return delegate.filter(request, isRequest, content);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/DefaultThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/DefaultThread.java
deleted file mode 100644
index 78481a0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/DefaultThread.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.*;
-/**
- * Monitor server I/O thread.
- */
-public class DefaultThread extends Thread {
- private static final int BUFFER = 2048;
- protected InputStream in;
- protected OutputStream out;
- protected boolean isRequest;
-
- protected Connection conn;
- protected Request request;
-
- /**
- * MonitorThread constructor comment.
- */
- public DefaultThread(Connection conn, Request request, InputStream in, OutputStream out, boolean isRequest) {
- super();
- this.conn = conn;
- this.request = request;
- this.in = in;
- this.out = out;
- this.isRequest = isRequest;
- setPriority(Thread.NORM_PRIORITY + 1);
- setDaemon(true);
- }
-
- /**
- * Listen for input, save it, and pass to the output stream.
- */
- public void run() {
- try {
- byte[] b = new byte[BUFFER];
- int n = in.read(b);
- while (n > 0) {
- out.write(b, 0, n);
- if (b != null && n > 0) {
- byte[] x = null;
- if (n == BUFFER)
- x = b;
- else {
- x = new byte[n];
- System.arraycopy(b, 0, x, 0, n);
- }
- if (isRequest)
- request.addToRequest(x);
- else
- request.addToResponse(x);
- }
- n = in.read(b);
- Thread.yield();
- }
- out.flush();
- } catch (IOException e) {
- // ignore
- } finally {
- request.fireChangedEvent();
- if (!isRequest)
- conn.close();
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java
deleted file mode 100644
index 40ad571..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/IMemento.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.util.List;
-/**
- * Interface to a memento used for saving the important state of an object
- * in a form that can be persisted in the file system.
- * <p>
- * Mementos were designed with the following requirements in mind:
- * <ol>
- * <li>Certain objects need to be saved and restored across platform sessions.
- * </li>
- * <li>When an object is restored, an appropriate class for an object might not
- * be available. It must be possible to skip an object in this case.</li>
- * <li>When an object is restored, the appropriate class for the object may be
- * different from the one when the object was originally saved. If so, the
- * new class should still be able to read the old form of the data.</li>
- * </ol>
- * </p>
- * <p>
- * Mementos meet these requirements by providing support for storing a
- * mapping of arbitrary string keys to primitive values, and by allowing
- * mementos to have other mementos as children (arranged into a tree).
- * A robust external storage format based on XML is used.
- * </p><p>
- * The key for an attribute may be any alpha numeric value. However, the
- * value of <code>TAG_ID</code> is reserved for internal use.
- * </p><p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @see IPersistableElement
- * @see IElementFactory
- */
-public interface IMemento {
- /**
- * Special reserved key used to store the memento id
- * (value <code>"org.eclipse.ui.id"</code>).
- *
- * @see #getId
- */
- public static final String TAG_ID = "IMemento.internal.id"; //$NON-NLS-1$
-
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Creates a new child of this memento with the given type and id.
- * The id is stored in the child memento (using a special reserved
- * key, <code>TAG_ID</code>) and can be retrieved using <code>getId</code>.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @param id the child id
- * @return a new child memento with the given type and id
- * @see #getId
- */
- public IMemento createChild(String type, String id);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the floating point value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a floating point number
- */
- public Float getFloat(String key);
-
- /**
- * Returns the id for this memento.
- *
- * @return the memento id, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getId();
-
- /**
- * Returns the name for this memento.
- *
- * @return the memento name, or <code>null</code> if none
- * @see #createChild(java.lang.String,java.lang.String)
- */
- public String getName();
-
- /**
- * Returns the integer value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public Integer getInteger(String key);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Returns the boolean value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a boolean
- */
- public Boolean getBoolean(String key);
-
- public List getNames();
-
- /**
- * Sets the value of the given key to the given floating point number.
- *
- * @param key the key
- * @param value the value
- */
- public void putFloat(String key, float value);
-
- /**
- * Sets the value of the given key to the given integer.
- *
- * @param key the key
- * @param value the value
- */
- public void putInteger(String key, int value);
-
- /**
- * Sets the value of the given key to the given boolean value.
- *
- * @param key the key
- * @param value the value
- */
- public void putBoolean(String key, boolean value);
-
- /**
- * Copy the attributes and children from <code>memento</code>
- * to the receiver.
- *
- * @param memento the IMemento to be copied.
- */
- public void putMemento(IMemento memento);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java
deleted file mode 100644
index b191bc5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Monitor.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import org.eclipse.wst.internet.monitor.core.*;
-/**
- *
- */
-public class Monitor implements IMonitor {
- private static final String MEMENTO_ID = "id";
- private static final String MEMENTO_LOCAL_PORT = "local-port";
- private static final String MEMENTO_REMOTE_HOST = "remote-host";
- private static final String MEMENTO_REMOTE_PORT = "remote-port";
- private static final String MEMENTO_TYPE_ID = "type-id";
-
- protected String id;
- protected String remoteHost;
- protected int remotePort = 80;
- protected int localPort = 80;
- protected IProtocolAdapter type;
-
- public Monitor() {
- type = MonitorPlugin.getInstance().getDefaultType();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getId()
- */
- public String getId() {
- return id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getRemoteHost()
- */
- public String getRemoteHost() {
- return remoteHost;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getRemotePort()
- */
- public int getRemotePort() {
- return remotePort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#getLocalPort()
- */
- public int getLocalPort() {
- return localPort;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#isHTTPEnabled()
- */
- public IProtocolAdapter getProtocolAdapter() {
- return type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitor#isRunning()
- */
- public boolean isRunning() {
- return MonitorManager.getInstance().isRunning(this);
- }
-
- public void delete() {
- MonitorManager.getInstance().removeMonitor(this);
- }
-
- public boolean isWorkingCopy() {
- return false;
- }
-
- public IMonitorWorkingCopy getWorkingCopy() {
- return new MonitorWorkingCopy(this);
- }
-
- protected void setInternal(IMonitor monitor) {
- id = monitor.getId();
- remoteHost = monitor.getRemoteHost();
- remotePort = monitor.getRemotePort();
- localPort = monitor.getLocalPort();
- type = monitor.getProtocolAdapter();
- }
-
- protected void save(IMemento memento) {
- memento.putString(MEMENTO_ID, id);
- memento.putString(MEMENTO_TYPE_ID, type.getId());
- memento.putInteger(MEMENTO_LOCAL_PORT, localPort);
- memento.putString(MEMENTO_REMOTE_HOST, remoteHost);
- memento.putInteger(MEMENTO_REMOTE_PORT, remotePort);
- }
-
- protected void load(IMemento memento) {
- id = memento.getString(MEMENTO_ID);
- type = MonitorPlugin.getInstance().getProtocolAdapter(memento.getString(MEMENTO_TYPE_ID));
- Integer temp = memento.getInteger(MEMENTO_LOCAL_PORT);
- if (temp != null)
- localPort = temp.intValue();
- remoteHost = memento.getString(MEMENTO_REMOTE_HOST);
- temp = memento.getInteger(MEMENTO_REMOTE_PORT);
- if (temp != null)
- remotePort = temp.intValue();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java
deleted file mode 100644
index 2e87eba..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorManager.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.internet.monitor.core.*;
-/**
- *
- */
-public class MonitorManager {
- private static final int ADD = 0;
- private static final int CHANGE = 1;
- private static final int REMOVE = 2;
-
- // monitors
- protected List monitors;
- protected Map threads = new HashMap();
-
- protected List monitorListeners = new ArrayList();
-
- // requests
- protected List requests = new ArrayList();
-
- protected List requestListeners = new ArrayList();
-
- private Preferences.IPropertyChangeListener pcl;
- protected boolean ignorePreferenceChanges = false;
-
- protected static MonitorManager instance;
-
- public static MonitorManager getInstance() {
- if (instance == null)
- instance = new MonitorManager();
- return instance;
- }
-
- private MonitorManager() {
- loadMonitors();
-
- pcl = new Preferences.IPropertyChangeListener() {
- public void propertyChange(Preferences.PropertyChangeEvent event) {
- if (ignorePreferenceChanges)
- return;
- String property = event.getProperty();
- if (property.equals("monitors")) {
- loadMonitors();
- }
- }
- };
-
- MonitorPlugin.getInstance().getPluginPreferences().addPropertyChangeListener(pcl);
- }
-
- protected void dispose() {
- MonitorPlugin.getInstance().getPluginPreferences().removePropertyChangeListener(pcl);
- }
-
- public IMonitorWorkingCopy createMonitor() {
- return new MonitorWorkingCopy();
- }
-
- public List getMonitors() {
- return new ArrayList(monitors);
- }
-
- protected void addMonitor(IMonitor monitor) {
- if (!monitors.contains(monitor))
- monitors.add(monitor);
- fireMonitorEvent(monitor, ADD);
- saveMonitors();
- }
-
- protected boolean isRunning(IMonitor monitor) {
- return (threads.get(monitor) != null);
- }
-
- public void startMonitor(IMonitor monitor) throws Exception {
- if (!monitors.contains(monitor))
- return;
-
- if (AcceptThread.isPortInUse(monitor.getLocalPort()))
- throw new Exception(MonitorPlugin.getString("%errorPortInUse"));
-
- AcceptThread thread = new AcceptThread(monitor);
- thread.startServer();
- threads.put(monitor, thread);
- }
-
- public void stopMonitor(IMonitor monitor) {
- if (!monitors.contains(monitor))
- return;
-
- AcceptThread thread = (AcceptThread) threads.get(monitor);
- if (thread != null) {
- thread.stopServer();
- threads.remove(monitor);
- }
- }
-
- protected void removeMonitor(IMonitor monitor) {
- if (monitor.isRunning())
- stopMonitor(monitor);
- monitors.remove(monitor);
- fireMonitorEvent(monitor, REMOVE);
- saveMonitors();
- }
-
- protected void monitorChanged(IMonitor monitor) {
- fireMonitorEvent(monitor, CHANGE);
- saveMonitors();
- }
-
- /**
- * Add monitor listener.
- *
- * @param listener
- */
- public void addMonitorListener(IMonitorListener listener) {
- monitorListeners.add(listener);
- }
-
- /**
- * Remove monitor listener.
- *
- * @param listener
- */
- public void removeMonitorListener(IMonitorListener listener) {
- monitorListeners.remove(listener);
- }
-
- /**
- * Fire a monitor event.
- * @param rr
- * @param type
- */
- protected void fireMonitorEvent(IMonitor monitor, int type) {
- Object[] obj = monitorListeners.toArray();
-
- int size = obj.length;
- for (int i = 0; i < size; i++) {
- IMonitorListener listener = (IMonitorListener) obj[i];
- if (type == ADD)
- listener.monitorAdded(monitor);
- else if (type == CHANGE)
- listener.monitorChanged(monitor);
- else if (type == REMOVE)
- listener.monitorRemoved(monitor);
- }
- }
-
- /**
- * Returns a list of the current requests.
- *
- * @return java.util.List
- */
- public List getRequests() {
- return requests;
- }
-
- /**
- * Add a new request response pair.
- *
- * @param pair org.eclipse.tcpip.monitor.RequestResponse
- */
- public void addRequest(IRequest rr) {
- if (requests.contains(rr))
- return;
-
- requests.add(rr);
- fireRequestEvent(rr, ADD);
- }
-
- public void requestChanged(IRequest rr) {
- fireRequestEvent(rr, CHANGE);
- }
-
- public void removeRequest(IRequest rr) {
- if (!requests.contains(rr))
- return;
-
- requests.remove(rr);
- fireRequestEvent(rr, REMOVE);
- }
-
- public void removeAllRequests() {
- int size = requests.size();
- IRequest[] rrs = new IRequest[size];
- requests.toArray(rrs);
-
- for (int i = 0; i < size; i++) {
- removeRequest(rrs[i]);
- }
- }
-
- /**
- * Add request listener.
- *
- * @param listener
- */
- public void addRequestListener(IRequestListener listener) {
- requestListeners.add(listener);
- }
-
- /**
- * Remove request listener.
- *
- * @param listener
- */
- public void removeRequestListener(IRequestListener listener) {
- requestListeners.remove(listener);
- }
-
- /**
- * Fire a request event.
- * @param rr
- * @param type
- */
- protected void fireRequestEvent(IRequest rr, int type) {
- int size = requestListeners.size();
- IRequestListener[] xrl = MonitorPlugin.getInstance().getRequestListeners();
- int size2 = xrl.length;
-
- IRequestListener[] rl = new IRequestListener[size + size2];
- System.arraycopy(xrl, 0, rl, 0, size2);
- for (int i = 0; i < size; i++)
- rl[size2 + i] = (IRequestListener) requestListeners.get(i);
-
- for (int i = 0; i < size + size2; i++) {
- IRequestListener listener = rl[i];
- if (type == ADD)
- listener.requestAdded(rr);
- else if (type == CHANGE)
- listener.requestChanged(rr);
- else if (type == REMOVE)
- listener.requestRemoved(rr);
- }
- }
-
- protected void loadMonitors() {
- Trace.trace(Trace.FINEST, "Loading monitors");
-
- monitors = new ArrayList();
- Preferences prefs = MonitorPlugin.getInstance().getPluginPreferences();
- String xmlString = prefs.getString("monitors");
- if (xmlString != null && xmlString.length() > 0) {
- try {
- ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes());
- IMemento memento = XMLMemento.loadMemento(in);
-
- IMemento[] children = memento.getChildren("monitor");
- if (children != null) {
- int size = children.length;
- for (int i = 0; i < size; i++) {
- Monitor monitor = new Monitor();
- monitor.load(children[i]);
- monitors.add(monitor);
- }
- }
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Could not load monitors: " + e.getMessage());
- }
- }
- }
-
- protected void saveMonitors() {
- try {
- ignorePreferenceChanges = true;
- XMLMemento memento = XMLMemento.createWriteRoot("monitors");
-
- Iterator iterator = monitors.iterator();
- while (iterator.hasNext()) {
- Monitor monitor = (Monitor) iterator.next();
- IMemento child = memento.createChild("monitor");
- monitor.save(child);
- }
-
- String xmlString = memento.saveToString();
- Preferences prefs = MonitorPlugin.getInstance().getPluginPreferences();
- prefs.setValue("monitors", xmlString);
- MonitorPlugin.getInstance().savePluginPreferences();
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not save browsers", e);
- }
- ignorePreferenceChanges = false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java
deleted file mode 100644
index 370920f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorPlugin.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.util.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.wst.internet.monitor.core.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.IRequestListener;
-/**
- * The monitor core plugin.
- */
-public class MonitorPlugin extends Plugin {
- public static final String PLUGIN_ID = "org.eclipse.wst.internet.monitor.core";
-
- private static MonitorPlugin singleton;
-
- protected Map protocolAdapters;
- protected Map contentFilters;
- protected IRequestListener[] requestListeners;
-
- /**
- * MonitorPlugin constructor comment.
- */
- public MonitorPlugin() {
- super();
- singleton = this;
- loadProtocolAdapters();
- loadContentFilters();
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return org.eclipse.wst.internet.monitor.core.MonitorPlugin
- */
- public static MonitorPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @return java.lang.String
- * @param key java.lang.String
- */
- public static String getString(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- public IProtocolAdapter getDefaultType() {
- return (ProtocolAdapter) protocolAdapters.get("HTTP");
- }
-
- public IProtocolAdapter getProtocolAdapter(String id) {
- return (ProtocolAdapter) protocolAdapters.get(id);
- }
-
- public IProtocolAdapter[] getProtocolAdapters() {
- List list = new ArrayList();
- Iterator iterator = protocolAdapters.values().iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- IProtocolAdapter[] types = new IProtocolAdapter[list.size()];
- list.toArray(types);
- return types;
- }
-
- public IContentFilter[] getContentFilters() {
- List list = new ArrayList();
- Iterator iterator = contentFilters.values().iterator();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- IContentFilter[] cf = new IContentFilter[list.size()];
- list.toArray(cf);
- return cf;
- }
-
- public IContentFilter getContentFilter(String id) {
- return (IContentFilter) contentFilters.get(id);
- }
-
- public IRequestListener[] getRequestListeners() {
- if (requestListeners == null)
- loadRequestListeners();
- return requestListeners;
- }
-
- protected synchronized void loadProtocolAdapters() {
- if (protocolAdapters != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading protocol adapters");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "protocolAdapters");
-
- int size = cf.length;
- protocolAdapters = new HashMap(size);
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading adapter: " + id);
- protocolAdapters.put(id, new ProtocolAdapter(cf[i]));
- }
- }
-
- protected synchronized void loadContentFilters() {
- if (contentFilters != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading content filters");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "contentFilters");
-
- int size = cf.length;
- contentFilters = new HashMap(size);
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading filter: " + id);
- contentFilters.put(id, new ContentFilter(cf[i]));
- }
- }
-
- protected synchronized void loadRequestListeners() {
- if (requestListeners != null)
- return;
- Trace.trace(Trace.CONFIG, "Loading request listeners");
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorPlugin.PLUGIN_ID, "requestListeners");
-
- int size = cf.length;
- List list = new ArrayList();
- for (int i = 0; i < size; i++) {
- String id = cf[i].getAttribute("id");
- Trace.trace(Trace.CONFIG, "Loading request listener: " + id);
- try {
- IRequestListener rl = (IRequestListener) cf[i].createExecutableExtension("class");
- list.add(rl);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create request listener: " + id, e);
- return;
- }
- }
-
- size = list.size();
- requestListeners = new IRequestListener[size];
- list.toArray(requestListeners);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java
deleted file mode 100644
index 460ef28..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/MonitorWorkingCopy.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import org.eclipse.wst.internet.monitor.core.*;
-/**
- *
- */
-public class MonitorWorkingCopy extends Monitor implements IMonitorWorkingCopy {
- protected Monitor monitor;
-
- // creation
- public MonitorWorkingCopy() {
- // do nothing
- }
-
- // working copy
- public MonitorWorkingCopy(Monitor monitor) {
- this.monitor = monitor;
- setInternal(monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
- */
- public void setId(String newId) {
- id = newId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
- */
- public void setRemoteHost(String host) {
- remoteHost = host;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setRemotePort(int)
- */
- public void setRemotePort(int port) {
- remotePort = port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setLocalPort(int)
- */
- public void setLocalPort(int port) {
- localPort = port;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.IMonitorWorkingCopy#setProtocolAdapter(IProtocolAdapter)
- */
- public void setProtocolAdapter(IProtocolAdapter protocolAdapter) {
- type = protocolAdapter;
- }
-
- public boolean isWorkingCopy() {
- return true;
- }
-
- public IMonitorWorkingCopy getWorkingCopy() {
- return this;
- }
-
- public IMonitor save() {
- MonitorManager mm = MonitorManager.getInstance();
- if (monitor != null) {
- //boolean restart = false;
- if (monitor.isRunning()) {
- //restart = true;
- mm.stopMonitor(monitor);
- }
- monitor.setInternal(this);
- mm.monitorChanged(monitor);
- //if (restart)
- // mm.startMonitor(monitor);
- } else {
- monitor = new Monitor();
- monitor.setInternal(this);
- mm.addMonitor(monitor);
- }
- return monitor;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java
deleted file mode 100644
index bf8da15..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/ProtocolAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate;
-/**
- *
- */
-public class ProtocolAdapter implements IProtocolAdapter {
- protected IConfigurationElement element;
- protected ProtocolAdapterDelegate delegate;
-
- protected ProtocolAdapter(IConfigurationElement element) {
- this.element = element;
- }
-
- public String getId() {
- return element.getAttribute("id");
- }
-
- public String getName() {
- return element.getAttribute("name");
- }
-
- public void parse(IMonitor monitor, Socket in, Socket out) throws IOException {
- if (delegate == null) {
- try {
- delegate = (ProtocolAdapterDelegate) element.createExecutableExtension("class");
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not create protocol adapter delegate: " + getId(), e);
- return;
- }
- }
- delegate.connect(monitor, in, out);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Request.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Request.java
deleted file mode 100644
index b483973..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Request.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.internet.monitor.core.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-/**
- * A single TCP/IP request/response pair.
- */
-public class Request implements IRequest {
- protected Date date;
- protected long responseTime = -1;
- protected int localPort;
- protected String remoteHost;
- protected int remotePort;
- protected byte[] request;
- protected byte[] response;
-
- protected String label;
- protected IProtocolAdapter type;
-
- protected Properties properties;
-
- protected List resendRequests = new ArrayList();
-
-
- /**
- * RequestResponse constructor comment.
- */
- public Request(IProtocolAdapter type, int localPort, String remoteHost, int remotePort) {
- super();
- this.type = type;
- this.localPort = localPort;
- this.remoteHost = remoteHost;
- this.remotePort = remotePort;
- date = new Date();
- properties = new Properties();
- MonitorManager.getInstance().addRequest(this);
- }
-
- public IProtocolAdapter getProtocolAdapter() {
- return type;
- }
-
- /**
- * Add to the request.
- *
- * @param addRequest byte[]
- */
- public void addToRequest(byte[] addRequest) {
- if (addRequest == null || addRequest.length == 0)
- return;
-
- if (request == null || request.length == 0) {
- setRequest(addRequest);
- return;
- }
-
- int size = request.length + addRequest.length;
- byte[] b = new byte[size];
- System.arraycopy(request, 0, b, 0, request.length);
- System.arraycopy(addRequest, 0, b, request.length, addRequest.length);
- request = b;
- }
-
- /**
- * Add to the response.
- *
- * @param addResponse byte[]
- */
- public void addToResponse(byte[] addResponse) {
- if (addResponse == null || addResponse.length == 0)
- return;
-
- if (response == null || response.length == 0) {
- setResponse(addResponse);
- return;
- }
-
- int size = response.length + addResponse.length;
- byte[] b = new byte[size];
- System.arraycopy(response, 0, b, 0, response.length);
- System.arraycopy(addResponse, 0, b, response.length, addResponse.length);
- response = b;
- }
-
- /**
- * Return the date/time of this request.
- *
- * @return java.util.Date
- */
- public Date getDate() {
- return date;
- }
-
- /**
- * Returns the local port.
- *
- * @return int
- */
- public int getLocalPort() {
- return localPort;
- }
-
- /**
- * Returns the remote host.
- *
- * @return java.lang.String
- */
- public String getRemoteHost() {
- return remoteHost;
- }
-
- /**
- * Returns the remote port.
- *
- * @return int
- */
- public int getRemotePort() {
- return remotePort;
- }
-
- /**
- * Returns the request as a byte array.
- *
- * @return byte[]
- */
- public byte[] getRequest(int type2) {
- return request;
- }
-
- /**
- * Returns the response as a byte array.
- *
- * @return byte[]
- */
- public byte[] getResponse(int type2) {
- return response;
- }
-
- /**
- * Returns the response time in milliseconds.
- *
- * @return long
- */
- public long getResponseTime() {
- return responseTime;
- }
-
- /**
- * Returns the title, if one exists.
- *
- * @return java.lang.String
- */
- public String getLabel() {
- if (label == null)
- return getRemoteHost() + ":" + getRemotePort();
-
- return label;
- }
-
- /**
- * Set the request.
- *
- * @param request byte[]
- */
- protected void setRequest(byte[] request) {
- if (request == null || request.length == 0)
- return;
-
- this.request = request;
-
- MonitorManager.getInstance().requestChanged(this);
- }
-
- /**
- * Set the response.
- *
- * @param response byte[]
- */
- protected void setResponse(byte[] response) {
- if (response == null || response.length == 0)
- return;
-
- this.response = response;
-
- responseTime = System.currentTimeMillis() - date.getTime();
-
- MonitorManager.getInstance().requestChanged(this);
- }
-
- /**
- * Sets the title.
- *
- * @param s java.lang.String
- */
- public void setLabel(String s) {
- // property can only be set once
- if (label != null)
- return;
-
- label = s;
- MonitorManager.getInstance().requestChanged(this);
- }
-
- /**
- *
- */
- public void addProperty(String key, Object value) {
- try {
- if (properties.containsKey(key))
- properties.remove(key);
- properties.put(key, value);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not add property", e);
- }
- }
-
- /**
- *
- */
- public String getStringProperty(String key) {
- try {
- return (String) properties.get(key);
- } catch (Exception e) {
- return "";
- }
- }
-
- /**
- *
- */
- public Integer getIntegerProperty(String key) {
- try {
- return (Integer) properties.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- *
- */
- public Object getObjectProperty(String key) {
- try {
- return properties.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- public void fireChangedEvent() {
- MonitorManager.getInstance().requestChanged(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IRequest#addResendRequest(org.eclipse.wst.internet.monitor.core.IRequest)
- */
- public void addResendRequest(IRequest resendReq) {
- if (resendReq != null)
- resendRequests.add(resendReq);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IRequest#getResendRequests()
- */
- public IResendRequest[] getResendRequests() {
- IResendRequest[] rr = new IResendRequest[resendRequests.size()];
- resendRequests.toArray(rr);
- return rr;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java
deleted file mode 100644
index 7d0e17b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/SocketWrapper.java
+++ /dev/null
@@ -1,346 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.nio.channels.SocketChannel;
-/**
- * A socket that is only used for resending requests. All input operations are
- * ignored.
- */
-public class SocketWrapper extends Socket {
- private InputStream inputStream;
- private OutputStream outputStream;
-
- public SocketWrapper(InputStream inputStream) {
- this.inputStream = inputStream;
- this.outputStream = new DummyOutputStream();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#bind(java.net.SocketAddress)
- */
- public void bind(SocketAddress arg0) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#close()
- */
- public synchronized void close() throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#connect(java.net.SocketAddress, int)
- */
- public void connect(SocketAddress arg0, int arg1) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#connect(java.net.SocketAddress)
- */
- public void connect(SocketAddress arg0) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getChannel()
- */
- public SocketChannel getChannel() {
- return super.getChannel();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getInetAddress()
- */
- public InetAddress getInetAddress() {
- return super.getInetAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getInputStream()
- */
- public InputStream getInputStream() throws IOException {
- return inputStream;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getKeepAlive()
- */
- public boolean getKeepAlive() throws SocketException {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getLocalAddress()
- */
- public InetAddress getLocalAddress() {
- return super.getLocalAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getLocalPort()
- */
- public int getLocalPort() {
- return super.getLocalPort();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getLocalSocketAddress()
- */
- public SocketAddress getLocalSocketAddress() {
- return super.getLocalSocketAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getOOBInline()
- */
- public boolean getOOBInline() throws SocketException {
- return super.getOOBInline();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getOutputStream()
- */
- public OutputStream getOutputStream() throws IOException {
- return outputStream;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getPort()
- */
- public int getPort() {
- return super.getPort();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getReceiveBufferSize()
- */
- public synchronized int getReceiveBufferSize() throws SocketException {
- return super.getReceiveBufferSize();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getRemoteSocketAddress()
- */
- public SocketAddress getRemoteSocketAddress() {
- return super.getRemoteSocketAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getReuseAddress()
- */
- public boolean getReuseAddress() throws SocketException {
- return super.getReuseAddress();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getSendBufferSize()
- */
- public synchronized int getSendBufferSize() throws SocketException {
- return super.getSendBufferSize();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getSoLinger()
- */
- public int getSoLinger() throws SocketException {
- return super.getSoLinger();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getSoTimeout()
- */
- public synchronized int getSoTimeout() throws SocketException {
- return super.getSoTimeout();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getTcpNoDelay()
- */
- public boolean getTcpNoDelay() throws SocketException {
- return super.getTcpNoDelay();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#getTrafficClass()
- */
- public int getTrafficClass() throws SocketException {
- return super.getTrafficClass();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isBound()
- */
- public boolean isBound() {
- return super.isBound();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isClosed()
- */
- public boolean isClosed() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isConnected()
- */
- public boolean isConnected() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isInputShutdown()
- */
- public boolean isInputShutdown() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#isOutputShutdown()
- */
- public boolean isOutputShutdown() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#sendUrgentData(int)
- */
- public void sendUrgentData(int arg0) throws IOException {
- super.sendUrgentData(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setKeepAlive(boolean)
- */
- public void setKeepAlive(boolean arg0) throws SocketException {
- super.setKeepAlive(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setOOBInline(boolean)
- */
- public void setOOBInline(boolean arg0) throws SocketException {
- super.setOOBInline(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setReceiveBufferSize(int)
- */
- public synchronized void setReceiveBufferSize(int arg0) throws SocketException {
- super.setReceiveBufferSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setReuseAddress(boolean)
- */
- public void setReuseAddress(boolean arg0) throws SocketException {
- super.setReuseAddress(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setSendBufferSize(int)
- */
- public synchronized void setSendBufferSize(int arg0) throws SocketException {
- super.setSendBufferSize(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setSoLinger(boolean, int)
- */
- public void setSoLinger(boolean arg0, int arg1) throws SocketException {
- super.setSoLinger(arg0, arg1);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setSoTimeout(int)
- */
- public synchronized void setSoTimeout(int arg0) throws SocketException {
- super.setSoTimeout(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setTcpNoDelay(boolean)
- */
- public void setTcpNoDelay(boolean arg0) throws SocketException {
- super.setTcpNoDelay(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#setTrafficClass(int)
- */
- public void setTrafficClass(int arg0) throws SocketException {
- super.setTrafficClass(arg0);
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#shutdownInput()
- */
- public void shutdownInput() throws IOException {
- inputStream.close();
- }
-
- /* (non-Javadoc)
- * @see java.net.Socket#shutdownOutput()
- */
- public void shutdownOutput() throws IOException {
- // do nothing
- }
-
- /**
- * A dummy OutputStream that allows us to fake output for a socket.
- */
- public class DummyOutputStream extends OutputStream {
- /* (non-Javadoc)
- * @see java.io.OutputStream#close()
- */
- public void close() throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#flush()
- */
- public void flush() throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(byte[], int, int)
- */
- public void write(byte[] arg0, int arg1, int arg2) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(byte[])
- */
- public void write(byte[] arg0) throws IOException {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.OutputStream#write(int)
- */
- public void write(int arg0) throws IOException {
- // do nothing
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java
deleted file mode 100644
index b719157..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/TCPIPProtocolAdapter.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.IOException;
-import java.net.Socket;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate;
-/**
- *
- */
-public class TCPIPProtocolAdapter extends ProtocolAdapterDelegate {
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- Request request = new Request(MonitorCore.findProtocolAdapter("TCPIP"), monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- Connection conn = new Connection(in, out);
- DefaultThread requestThread = new DefaultThread(conn, request, in.getInputStream(), out.getOutputStream(), true);
- requestThread.start();
- new DefaultThread(conn, request, out.getInputStream(), in.getOutputStream(), false).start();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
deleted file mode 100644
index 82c684a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.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 PARSING = 4;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!MonitorPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(System.currentTimeMillis() + " " + s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java
deleted file mode 100644
index a3d0067..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/XMLMemento.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal;
-
-import java.io.*;
-import java.util.*;
-import java.net.URL;
-import org.w3c.dom.*;
-import org.xml.sax.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-/**
- * A Memento is a class independent container for persistence
- * info. It is a reflection of 3 storage requirements.
- *
- * 1) We need the ability to persist an object and restore it.
- * 2) The class for an object may be absent. If so we would
- * like to skip the object and keep reading.
- * 3) The class for an object may change. If so the new class
- * should be able to read the old persistence info.
- *
- * We could ask the objects to serialize themselves into an
- * ObjectOutputStream, DataOutputStream, or Hashtable. However
- * all of these approaches fail to meet the second requirement.
- *
- * Memento supports binary persistance with a version ID.
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- public XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /**
- * @see IMemento.
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * @see IMemento.
- */
- public IMemento createChild(String type, String id) {
- Element child = factory.createElement(type);
- child.setAttribute(TAG_ID, id);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- protected static XMLMemento createReadRoot(Reader reader) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(reader));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (ParserConfigurationException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- } catch (SAXException e) {
- // ignore
- } finally {
- try {
- reader.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /**
- * @see IMemento.
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /**
- * @see IMemento.
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- ArrayList list = new ArrayList(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, (Element)list.get(x));
- }
- return results;
- }
-
- /**
- * Return the contents of this memento as a byte array.
- *
- * @return byte[]
- */
- public byte[] getContents() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toByteArray();
- }
-
- /**
- * Returns an input stream for writing to the disk with a local locale.
- *
- * @return java.io.InputStream
- */
- public InputStream getInputStream() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return new ByteArrayInputStream(out.toByteArray());
- }
-
- /**
- * @see IMemento.
- */
- public Float getFloat(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Float(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /**
- * @see IMemento.
- */
- public String getId() {
- return element.getAttribute(TAG_ID);
- }
-
- /**
- * @see IMemento.
- */
- public String getName() {
- return element.getNodeName();
- }
-
- /**
- * @see IMemento.
- */
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Integer(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /**
- * @see IMemento.
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- public List getNames() {
- NamedNodeMap map = element.getAttributes();
- int size = map.getLength();
- List list = new ArrayList();
- for (int i = 0; i < size; i++) {
- Node node = map.item(i);
- String name = node.getNodeName();
- list.add(name);
- }
- return list;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(InputStream in) {
- return createReadRoot(new InputStreamReader(in));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadCorruptMemento(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(in);
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (ParserConfigurationException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- } catch (SAXException e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(String filename) throws IOException {
- return XMLMemento.createReadRoot(new FileReader(filename));
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param url java.net.URL
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(URL url) throws IOException {
- return XMLMemento.createReadRoot(new InputStreamReader(url.openStream()));
- }
-
- /**
- * @see IMemento.
- */
- private void putElement(Element element2) {
- NamedNodeMap nodeMap = element2.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++){
- Attr attr = (Attr)nodeMap.item(i);
- putString(attr.getName(),attr.getValue());
- }
-
- NodeList nodes = element2.getChildNodes();
- size = nodes.getLength();
- for (int i = 0; i < size; i ++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- XMLMemento child = (XMLMemento)createChild(node.getNodeName());
- child.putElement((Element)node);
- }
- }
- }
-
- /**
- * @see IMemento.
- */
- public void putFloat(String key, float f) {
- element.setAttribute(key, String.valueOf(f));
- }
-
- /**
- * @see IMemento.
- */
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
-
- /**
- * @see IMemento.
- */
- public void putMemento(IMemento memento) {
- XMLMemento xmlMemento = (XMLMemento) memento;
- putElement(xmlMemento.element);
- }
-
- /**
- * @see IMemento.
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(Writer writer) throws IOException {
- Result result = new StreamResult(writer);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Save this Memento to a Writer.
- */
- public void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- Writer w = null;
- try {
- w = new FileWriter(filename);
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- public String saveToString() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toString("UTF-8");
- }
-
- /*
- * @see IMemento#getBoolean(String)
- */
- public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- if ("true".equalsIgnoreCase(strValue))
- return new Boolean(true);
-
- return new Boolean(false);
- }
-
- /*
- * @see IMemento#putBoolean(String, boolean)
- */
- public void putBoolean(String key, boolean value) {
- element.setAttribute(key, value ? "true" : "false");
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java
deleted file mode 100644
index 6a208fb..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPConnection.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-
-import java.util.List;
-import java.util.ArrayList;
-/**
- * Manages a monitor server connection between two hosts. This
- * connection may spawn one or more TCP/IP pairs to be displayed
- * in the monitor server view.
- */
-public class HTTPConnection {
- protected IMonitor monitor;
-
- protected int req = -1;
- protected int resp = -1;
-
- protected List calls = new ArrayList();
-
- /**
- * MonitorHTTPConnection constructor comment.
- */
- public HTTPConnection(IMonitor monitor) {
- super();
- this.monitor = monitor;
- Trace.trace(Trace.PARSING, "TCP/IP monitor connection opened " + monitor);
- }
-
- /**
- * Add a request.
- * @param req byte[]
- * @param isNew boolean
- */
- public void addRequest(byte[] request, boolean isNew) {
- if (isNew)
- req ++;
- HTTPRequest pair = (HTTPRequest) getRequestResponse(req);
- pair.addToRequest(request);
- }
-
- /**
- * Add a response.
- * @param req byte[]
- * @param isNew boolean
- */
- public void addResponse(byte[] response, boolean isNew) {
- if (isNew)
- resp ++;
- HTTPRequest pair = (HTTPRequest) getRequestResponse(resp);
- pair.addToResponse(response);
- }
-
- /**
- *
- */
- public void addProperty(String key, Object value) {
- IRequest pair = getRequestResponse(req);
- pair.addProperty(key, value);
- }
-
- /**
- *
- */
- public IRequest getRequestResponse(boolean isRequest) {
- if (isRequest)
- return getRequestResponse(req);
-
- return getRequestResponse(resp);
- }
-
- /**
- *
- */
- protected IRequest getRequestResponse(int i) {
- synchronized (this) {
- while (i >= calls.size()) {
- IRequest rr = new HTTPRequest(monitor.getLocalPort(), monitor.getRemoteHost(), monitor.getRemotePort());
- calls.add(rr);
- return rr;
- }
- return (IRequest) calls.get(i);
- }
- }
-
- /**
- * Set the title
- * @param req byte[]
- * @param isNew boolean
- */
- public void setLabel(String title, boolean isNew) {
- if (isNew)
- req ++;
- HTTPRequest pair = (HTTPRequest) getRequestResponse(req);
- pair.setLabel(title);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java
deleted file mode 100644
index 00b3b1d..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPProtocolAdapter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import java.io.IOException;
-import java.net.Socket;
-
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-/**
- *
- */
-public class HTTPProtocolAdapter extends ProtocolAdapterDelegate {
- public void connect(IMonitor monitor, Socket in, Socket out) throws IOException {
- Connection conn2 = new Connection(in, out);
- HTTPConnection conn = new HTTPConnection(monitor);
- HTTPThread request = new HTTPThread(conn2, in.getInputStream(), out.getOutputStream(), conn, true, monitor.getRemoteHost(), monitor.getRemotePort());
- HTTPThread response = new HTTPThread(conn2, out.getInputStream(), in.getOutputStream(), conn, false, "localhost", monitor.getLocalPort(), request);
- request.start();
- response.start();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java
deleted file mode 100644
index d9ffd37..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPRequest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.internet.monitor.core.internal.Request;
-/**
- *
- */
-public class HTTPRequest extends Request {
- protected static final String HTTP_REQUEST_HEADER = "request-header";
- protected static final String HTTP_RESPONSE_HEADER = "response-header";
-
- protected static final String HTTP_REQUEST_BODY = "request-body";
- protected static final String HTTP_RESPONSE_BODY = "response-body";
-
- protected static final byte[] EMPTY = new byte[0];
-
- /**
- * HTTPRequestResponse constructor comment.
- */
- public HTTPRequest(int localPort, String remoteHost, int remotePort) {
- super(MonitorCore.findProtocolAdapter(MonitorCore.HTTP_PROTOCOL_ID), localPort, remoteHost, remotePort);
- }
-
- public byte[] getRequest(byte type2) {
- if (type2 == ALL)
- return request;
- else if (type2 == TRANSPORT)
- return getRequestHeader();
- else
- return getRequestContent();
- }
-
- public byte[] getResponse(byte type2) {
- if (type2 == ALL)
- return response;
- else if (type2 == TRANSPORT)
- return getResponseHeader();
- else
- return getResponseContent();
- }
-
- protected byte[] getRequestHeader() {
- Object obj = getObjectProperty(HTTP_REQUEST_HEADER);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getRequestContent() {
- Object obj = getObjectProperty(HTTP_REQUEST_BODY);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getResponseHeader() {
- Object obj = getObjectProperty(HTTP_RESPONSE_HEADER);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-
- protected byte[] getResponseContent() {
- Object obj = getObjectProperty(HTTP_RESPONSE_BODY);
- if (obj == null || !(obj instanceof byte[]))
- return null;
- return (byte[]) obj;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
deleted file mode 100644
index 901cb84..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import java.io.*;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.Trace;
-/**
- * Monitor server I/O thread.
- */
-public class HTTPThread extends Thread {
- private static final int BUFFER = 2048;
- private static final byte CR = (byte) '\r';
- private static final byte LF = (byte) '\n';
- protected static int threadCount = 0;
-
- private byte[] readBuffer = new byte[BUFFER];
-
- // buffer and index
- protected byte[] buffer = new byte[0];
- protected int bufferIndex = 0;
-
- protected InputStream in;
- protected OutputStream out;
- protected HTTPConnection conn;
- protected boolean isRequest;
- protected Connection conn2;
-
- protected HTTPThread request;
- protected boolean isWaiting;
-
- // user to translate the Host: header
- protected String host;
- protected int port;
-
- protected int contentLength = -1;
- protected byte transferEncoding = -1;
- protected String responseType = null;
- protected boolean keepAlive = false;
-
- protected static final String[] ENCODING_STRING = new String[] {
- "chunked", "identity", "gzip", "compressed", "deflate"};
-
- protected static final byte ENCODING_CHUNKED = 0;
- protected static final byte ENCODING_IDENTITY = 1;
- protected static final byte ENCODING_GZIP = 2;
- protected static final byte ENCODING_COMPRESSED = 3;
- protected static final byte ENCODING_DEFLATE = 4;
-
-/* change:
-Referer: http://localhost:8081/index.html
-Host: localhost:8081
-*/
-/* The Connection header has the following grammar:
-
- Connection = "Connection" ":" 1#(connection-token)
- connection-token = token
-
- HTTP/1.1 proxies MUST parse the Connection header field before a
- message is forwarded and, for each connection-token in this field,
- remove any header field(s) from the message with the same name as the
- connection-token. */
-
- /**
- * MonitorThread constructor comment.
- */
- public HTTPThread(Connection conn2, InputStream in, OutputStream out, HTTPConnection conn, boolean isRequest, String host, int port) {
- super();
- this.conn2 = conn2;
- this.in = in;
- this.out = out;
- this.conn = conn;
- this.isRequest = isRequest;
- this.host = host;
- this.port = port;
-
- setName("HTTP (" + host + ":" + port + ") " + (isRequest ? "REQUEST" : "RESPONSE") + " " + (threadCount++));
- setPriority(Thread.NORM_PRIORITY + 1);
- setDaemon(true);
-
- Trace.trace(Trace.PARSING, "Started: " + this);
- }
-
- /**
- * MonitorThread constructor comment.
- */
- public HTTPThread(Connection conn2, InputStream in, OutputStream out, HTTPConnection conn, boolean isRequest, String host, int port, HTTPThread request) {
- this(conn2, in, out, conn, isRequest, host, port);
-
- this.request = request;
- }
-
- /**
- * Add a line feed to the end of the byte array.
- * @return byte[]
- * @param b byte[]
- */
- protected static byte[] convert(byte[] b) {
- if (b == null || b.length == 0)
- return b;
-
- int size = b.length;
- byte[] x = new byte[size + 2];
- System.arraycopy(b, 0, x, 0, size);
- x[size] = (byte) '\r'; // CR
- x[size + 1] = (byte) '\n'; // LF
- return x;
- }
-
- /**
- * Read more data into the buffer.
- *
- * @return byte[]
- */
- protected void fillBuffer() throws IOException {
- int n = in.read(readBuffer);
-
- if (n <= 0)
- throw new IOException("End of input");
-
- // add to full buffer
- int len = buffer.length - bufferIndex;
- if (len < 0)
- len = 0;
- byte[] x = new byte[n + len];
- System.arraycopy(buffer, bufferIndex, x, 0, len);
- System.arraycopy(readBuffer, 0, x, len, n);
- bufferIndex = 0;
- buffer = x;
- }
-
- /**
- * Returns the first location of a CRLF.
- *
- * @return int
- */
- protected int getFirstCRLF() {
- int size = buffer.length;
- int i = bufferIndex + 1;
- while (i < size) {
- if (buffer[i - 1] == CR && buffer[i] == LF)
- return i;
- i++;
- }
- return -1;
- }
-
- /**
- * Output the given bytes.
- * @param b byte[]
- */
- protected void outputBytes(byte[] b, boolean isNew) throws IOException {
- out.write(b);
- if (isRequest)
- conn.addRequest(b, isNew);
- else
- conn.addResponse(b, isNew);
- }
-
- /**
- * Parse the HTTP body.
- */
- public void parseBody() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing body for: " + this);
-
- if (isRequest) {
- if (contentLength != -1) {
- byte[] b = readBytes(contentLength);
- out.write(b);
- conn.addRequest(b, false);
- setHTTPBody(b);
- } else if (transferEncoding != -1 && transferEncoding != ENCODING_IDENTITY) {
- parseChunk();
- }
-
- Trace.trace(Trace.PARSING, "Done parsing request body for: " + this);
- return;
- }
-
- // just return body for HTTP 1.0 responses
- if (!isRequest && !keepAlive && contentLength == -1 && transferEncoding == -1) {
- Trace.trace(Trace.PARSING, "Assuming HTTP 1.0 for: " + this);
- int n = buffer.length - bufferIndex;
- byte[] b = readBytes(n);
- byte[] body = new byte[0];
- while (n >= 0) {
- Trace.trace(Trace.PARSING, "Bytes read: " + n + " " + this);
- if (b != null && n > 0) {
- byte[] x = null;
- if (n == b.length)
- x = b;
- else {
- x = new byte[n];
- System.arraycopy(b, 0, x, 0, n);
- }
- outputBytes(x, false);
-
- // copy to HTTP body
- byte[] temp = new byte[body.length + x.length];
- System.arraycopy(body, 0, temp, 0, body.length);
- System.arraycopy(x, 0, temp, body.length, x.length);
- body = temp;
- }
- if (b.length < BUFFER)
- b = new byte[BUFFER];
- n = in.read(b);
- Thread.yield();
- }
- out.flush();
- setHTTPBody(body);
- return;
- }
-
- // spec 4.4.1
- if (responseType != null && (responseType.startsWith("1") || "204".equals(responseType) || "304".equals(responseType))) {
- setHTTPBody(new byte[0]);
- return;
- }
-
- // spec 4.4.2
- if (transferEncoding != -1 && transferEncoding != ENCODING_IDENTITY) {
- parseChunk();
- return;
- }
-
- // spec 4.4.3
- if (contentLength != -1) {
- byte[] b = readBytes(contentLength);
- out.write(b);
- if (isRequest)
- conn.addRequest(b, false);
- else
- conn.addResponse(b, false);
- setHTTPBody(b);
- return;
- }
-
- // spec 4.4.4 (?)
-
- Trace.trace(Trace.PARSING, "Unknown body for: " + this);
- }
-
- /**
- * Parse an HTTP chunk.
- */
- public void parseChunk() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing chunk for: " + this);
- boolean done = false;
- byte[] body = new byte[0];
-
- while (!done) {
- // read chunk size
- byte[] b = readLine();
-
- String s = new String(b);
- int index = s.indexOf(" ");
- int length = -1;
- try {
- if (index > 0)
- s = s.substring(0, index);
- length = Integer.parseInt(s.trim(), 16);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error chunk for: " + this, e);
- }
-
- // output bytes
- outputBytes(b, false);
-
- if (length <= 0)
- done = true;
- else {
- // read and output chunk data plus CRLF
- b = readBytes(length + 2);
- outputBytes(b, false);
-
- // copy to HTTP body
- byte[] temp = new byte[body.length + b.length - 2];
- System.arraycopy(body, 0, temp, 0, body.length);
- System.arraycopy(b, 0, temp, body.length, b.length - 2);
- body = temp;
- }
- }
-
- // read trailer
- byte[] b = readLine();
- while (b.length > 2) {
- outputBytes(b, false);
- b = readLine();
- }
-
- outputBytes(b, false);
- setHTTPBody(body);
- }
-
- /**
- * Parse an HTTP header.
- */
- public void parseHeader() throws IOException {
- Trace.trace(Trace.PARSING, "Parsing header for: " + this);
-
- // read until first blank line
- boolean isFirstLine = true;
- boolean isNew = true;
-
- byte[] b = readLine();
- while (b.length > 5) {
- Trace.trace(Trace.PARSING, "Parsing header line: '" + new String(b) + "'");
-
- if (isFirstLine) {
- String s = new String(b);
- if (isRequest) {
- setLabel(s);
- isNew = false;
- }
-
- if (!isRequest) {
- int index1 = s.indexOf(' ');
- int index2 = s.indexOf(' ', index1 + 1);
-
- try {
- responseType = s.substring(index1 + 1, index2).trim();
- Trace.trace(Trace.PARSING, "Response Type: " + this + " " + responseType);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error parsing response type for: " + this, e);
- }
- if (responseType != null && responseType.equals("100")) {
- outputBytes(b, isNew);
- isNew = false;
-
- b = readLine();
- outputBytes(b, false);
-
- b = readLine();
-
- index1 = s.indexOf(' ');
- index2 = s.indexOf(' ', index1 + 1);
-
- try {
- responseType = s.substring(index1 + 1, index2).trim();
- Trace.trace(Trace.PARSING, "Response Type: " + this + " " + responseType);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error parsing response type for: " + this, e);
- }
- }
- }
- isFirstLine = false;
- }
-
- // translate
- b = translateHeaderLine(b);
-
- outputBytes(b, isNew);
- isNew = false;
-
- b = readLine();
- }
-
- Trace.trace(Trace.PARSING, "Parsing final header line: '" + new String(b) + "'");
-
- outputBytes(b, false);
-
- IRequest rr = conn.getRequestResponse(isRequest);
- Trace.trace(Trace.PARSING, "Setting header length: " + rr.getRequest(IRequest.ALL).length);
-
- setHTTPHeader(rr);
- }
-
- /**
- * Read bytes from the stream.
- * @return byte[]
- */
- protected byte[] readBytes(int n) throws IOException {
- Trace.trace(Trace.PARSING, "readBytes() " + n + " for: " + this);
- while (buffer.length - bufferIndex < n)
- fillBuffer();
-
- return removeFromBuffer(bufferIndex + n);
- }
-
- /**
- * Read and return the next full line.
- *
- * @return byte[]
- */
- protected byte[] readLine() throws IOException {
- Trace.trace(Trace.PARSING, "readLine() for: " + this);
-
- int n = getFirstCRLF();
- while (n < 0) {
- fillBuffer();
- n = getFirstCRLF();
- }
- return removeFromBuffer(n + 1);
- }
-
- /**
- * Remove data from the buffer up to the absolute index n.
- * Return the data from between bufferIndex and n.
- *
- * @return byte[]
- * @param index int
- */
- protected byte[] removeFromBuffer(int n) {
- // copy line out of buffer
- byte[] b = new byte[n - bufferIndex];
- System.arraycopy(buffer, bufferIndex, b, 0, n - bufferIndex);
-
- if (buffer.length > BUFFER * 2 || bufferIndex > BUFFER) {
- // remove line from buffer
- int size = buffer.length;
- byte[] x = new byte[size - n];
- System.arraycopy(buffer, n, x, 0, size - n);
- buffer = x;
- bufferIndex = 0;
- } else
- bufferIndex = n;
-
- return b;
- }
-
- /**
- * Listen for input, save it, and pass to the output stream.
- * Philosophy: Read a single line separately and translate.
- * When blank line is reached, just pass all other data through.
- */
- public void run() {
- try {
- try {
- while (true) {
- contentLength = -1;
- transferEncoding = -1;
- keepAlive = false;
-
- parseHeader();
- parseBody();
-
- if (isRequest && keepAlive)
- waitForResponse();
-
- IRequest r = conn.getRequestResponse(true);
- r.fireChangedEvent();
-
- Trace.trace(Trace.PARSING, "Done HTTP request for " + this + " " + keepAlive);
- if (!isRequest && !request.keepAlive) {
- conn2.close();
- break;
- }
-
- if (!isRequest)
- notifyRequest();
-
- Thread.yield();
- }
- } catch (IOException e) {
- // reached end of input
- Trace.trace(Trace.PARSING, "End of buffer for: " + this + " " + e.getMessage());
- }
-
- // send rest of buffer
- out.write(buffer, bufferIndex, buffer.length - bufferIndex);
- out.flush();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in: " + this, e);
- }
- //if (!isRequest)
- // conn2.close();
-
- Trace.trace(Trace.PARSING, "Closing thread " + this);
- }
-
- /**
- * Sets the title of the call.
- *
- * @param s java.lang.String
- */
- protected void setLabel(String s) {
- try {
- int index1 = s.indexOf(' ');
- if (index1 < 0 || index1 > 15)
- return;
- int index2 = s.indexOf(' ', index1 + 1);
- if (index2 < 0)
- return;
-
- conn.setLabel(s.substring(index1 + 1, index2), true);
- } catch (Exception e) {
- // ignore
- }
- }
-
- /**
- * Translate the header line.
- *
- * @return byte[]
- * @param b byte[]
- */
- protected byte[] translateHeaderLine(byte[] b) {
- String s = new String(b);
-
- if (isRequest && s.startsWith("Host: ")) {
- String t = "Host: " + host;
- if (port != 80)
- t += ":" + port;
- return convert(t.getBytes());
- } else if (s.startsWith("Content-Length: ")) {
- try {
- contentLength = Integer.parseInt(s.substring(16).trim());
- Trace.trace(Trace.PARSING, "Content length: " + this + " " + contentLength);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Content length error", e);
- }
- } else if (s.startsWith("Connection: ")) {
- try {
- String t = s.substring(11).trim();
- if (t.equalsIgnoreCase("Keep-Alive"))
- keepAlive = true;
- Trace.trace(Trace.PARSING, "Keep alive: " + keepAlive);
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error getting Connection: from header", e);
- }
- } else if (s.startsWith("Transfer-Encoding: ")) {
- String t = s.substring(19).trim();
- int size = ENCODING_STRING.length;
- for (int i = 0; i < size; i++) {
- if (ENCODING_STRING[i].equalsIgnoreCase(t)) {
- transferEncoding = (byte) i;
- Trace.trace(Trace.PARSING, "Transfer encoding: " + ENCODING_STRING[i]);
- }
- }
- }
-
- return b;
- }
-
- protected void close() {
- try {
- Trace.trace(Trace.PARSING, "Closing: " + this);
- out.close();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error closing connection " + this + " " + e.getMessage());
- }
- }
-
- protected void waitForResponse() {
- Trace.trace(Trace.PARSING, "Waiting for response " + this);
- synchronized (this) {
- try {
- isWaiting = true;
- wait();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in waitForResponse() " + this + " " + e.getMessage());
- }
- isWaiting = false;
- }
- Trace.trace(Trace.PARSING, "Done waiting for response " + this);
- }
-
- protected void notifyRequest() {
- Trace.trace(Trace.PARSING, "Notifying request " + this);
- while (request.keepAlive && !request.isWaiting) {
- Trace.trace(Trace.PARSING, "Waiting for request " + this);
- try {
- Thread.sleep(100);
- } catch (Exception e) {
- // ignore
- }
- }
- synchronized (request) {
- try {
- request.notify();
- } catch (Exception e) {
- Trace.trace(Trace.PARSING, "Error in notifyRequest() " + this + " " + e.getMessage());
- }
- }
- Trace.trace(Trace.PARSING, "Done notifying request " + this);
- }
-
- protected void setHTTPHeader(IRequest rr) {
- if (isRequest) {
- byte[] b = rr.getRequest(IRequest.ALL);
- byte[] h = new byte[b.length];
- System.arraycopy(b, 0, h, 0, b.length);
- rr.addProperty(HTTPRequest.HTTP_REQUEST_HEADER, h);
- } else {
- byte[] b = rr.getResponse(IRequest.ALL);
- byte[] h = new byte[b.length];
- System.arraycopy(b, 0, h, 0, b.length);
- rr.addProperty(HTTPRequest.HTTP_RESPONSE_HEADER, h);
- }
- }
-
- protected void setHTTPBody(byte[] b) {
- IRequest rr = conn.getRequestResponse(isRequest);
- if (isRequest)
- rr.addProperty(HTTPRequest.HTTP_REQUEST_BODY, b);
- else
- rr.addProperty(HTTPRequest.HTTP_RESPONSE_BODY, b);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java
deleted file mode 100644
index 904f75f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPConnection.java
+++ /dev/null
@@ -1,31 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import org.eclipse.wst.internet.monitor.core.IRequest;
-/**
- * A resend HTTP connection wraps an HTTP connection to send an existing request.
- */
-public class ResendHTTPConnection extends HTTPConnection{
- protected IRequest existingRequest;
-
- public ResendHTTPConnection(IRequest request) {
- super(null);
- this.existingRequest = request;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPConnection#getRequestResponse(int)
- */
- protected IRequest getRequestResponse(int i) {
- return existingRequest;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java
deleted file mode 100644
index 98fc8a6..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/ResendHTTPRequest.java
+++ /dev/null
@@ -1,135 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.core.internal.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.Socket;
-
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-import org.eclipse.wst.internet.monitor.core.internal.Connection;
-import org.eclipse.wst.internet.monitor.core.internal.SocketWrapper;
-/**
- * Wraps an existing request to create an HTTP request that can be sent. The
- * response is ignored. Only the request is important in this case.
- */
-public class ResendHTTPRequest extends HTTPRequest implements IResendRequest {
- private boolean sent = false;
-
- private byte[] header;
-
- private byte[] content;
-
- private IRequest originalRequest = null;
-
- /**
- * Constructor.
- *
- * @param req the request that is to be resent.
- */
- public ResendHTTPRequest(IRequest req) {
- super(req.getLocalPort(), req.getRemoteHost(), req.getRemotePort());
- addProperty(HTTP_REQUEST_HEADER, req
- .getObjectProperty(HTTP_REQUEST_HEADER));
- addProperty(HTTP_REQUEST_BODY, req.getObjectProperty(HTTP_REQUEST_BODY));
- header = req.getRequest(TRANSPORT);
- content = req.getRequest(CONTENT);
- request = req.getRequest(ALL);
- label = req.getLabel();
- this.originalRequest = req;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IResendRequest#sendRequest()
- */
- public void sendRequest() {
- try {
- Socket inSocket = new SocketWrapper(new ByteArrayInputStream(
- request));
- Socket outSocket = new Socket(remoteHost, remotePort);
- //Connection conn = new Connection(inSocket, outSocket);
- //DefaultThread requestThread = new DefaultThread(conn, this, in,
- // outSocket.getOutputStream(), true);
- //requestThread.start();
- //new DefaultThread(conn, this, outSocket.getInputStream(),
- // inSocket.getOutputStream(), false).start();
- Connection conn2 = new Connection(inSocket, outSocket);
- ResendHTTPConnection conn = new ResendHTTPConnection(this);
-
- HTTPThread request2 = new HTTPThread(conn2, inSocket
- .getInputStream(), outSocket.getOutputStream(), conn, true,
- remoteHost, remotePort);
- HTTPThread response2 = new HTTPThread(conn2, outSocket
- .getInputStream(), inSocket.getOutputStream(), conn, false,
- "localhost", localPort, request2);
- request2.start();
- response2.start();
- } catch (IOException e) {
- response = ("Unable to resend to server.\n" + e).getBytes();
- }
- sent = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.Request#addToRequest(byte[])
- */
- public void addToRequest(byte[] addRequest) {
- // Don't want to add to the request as we already have the request.
- }
-
- public boolean hasBeenSent() {
- return sent;
- }
-
- public void setRequest(byte[] request, int type) {
- if (type == TRANSPORT && request != null)
- header = request;
- else if (type == CONTENT)
- content = request;
-
- int length = 0;
- int headerLength = 0;
- if (header != null) {
- length += header.length;
- headerLength = length;
- }
- if (content != null)
- length += content.length;
- byte[] newRequest = new byte[length];
- if (header != null)
- System.arraycopy(header, 0, newRequest, 0, header.length);
- if (content != null)
- System.arraycopy(content, 0, newRequest, headerLength, content.length);
- super.setRequest(newRequest);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPRequest#getRequestContent()
- */
- protected byte[] getRequestContent() {
- return content;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.internal.http.HTTPRequest#getRequestHeader()
- */
- protected byte[] getRequestHeader() {
- return header;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.core.IResendRequest#getOriginalRequest()
- */
- public IRequest getOriginalRequest() {
- return originalRequest;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties b/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties
deleted file mode 100644
index ec8d3af..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/plugin.properties
+++ /dev/null
@@ -1,22 +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=Monitor
-providerName=Eclipse.org
-
-# --------------- Errors ---------------
-errorPortInUse=The TCP/IP monitor could not start because the port is in use.
-
-extensionPointProtocolAdapters=Protocol Adapters
-extensionPointContentFilters=Content Filters
-extensionPointRequestListeners=Request Listeners
-
-HTTP=HTTP
-TCPIP=TCP/IP
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml b/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml
deleted file mode 100644
index 214f354..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/plugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.wst.internet.monitor.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.internet.monitor.core.internal.MonitorPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
-</requires>
-
-<runtime>
- <library name="monitorcore.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<extension-point name="%extensionPointProtocolAdapters" id="protocolAdapters" schema="schema/protocolAdapters.exsd"/>
-<extension-point name="%extensionPointContentFilters" id="contentFilters" schema="schema/contentFilters.exsd"/>
-<extension-point name="%extensionPointRequestListeners" id="requestListeners" schema="schema/requestListeners.exsd"/>
-
-<extension point="org.eclipse.wst.internet.monitor.core.protocolAdapters">
- <protocolAdapter
- id="TCPIP"
- class="org.eclipse.wst.internet.monitor.core.internal.TCPIPProtocolAdapter"
- name="%TCPIP"/>
- <protocolAdapter
- id="HTTP"
- class="org.eclipse.wst.internet.monitor.core.internal.http.HTTPProtocolAdapter"
- name="%HTTP"/>
-</extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/contentFilters.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/contentFilters.exsd
deleted file mode 100644
index 84a5626..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/contentFilters.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="contentFilters" name="Content Filters"/>
- </appInfo>
- <documentation>
- This extension point is used to filter content received in a monitor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="filter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of a Java class that extends <samp>org.eclipse.wst.internet.monitor.core.ContentFilterDelegate</samp>.
-Content filter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.ContentFilterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the filter
- </documentation>
- </annotation>
- </attribute>
- <attribute name="order" type="string">
- <annotation>
- <documentation>
- an integer used to order filters relative to each other. Lower orders are processed first
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content filter extension point:
-
-<p>
-<pre>
- <extension point="org.eclipse.wst.internet.monitor.core.contentFilter">
- <filter
- id="com.example.ExampleIdentifier"
- name="%exampleName"
- class="com.example.ExampleContentFilter"/>
- </extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.internet.monitor.core.ContentFilterDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Common Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
deleted file mode 100644
index 0a770a7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/protocolAdapters.exsd
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="protocolAdapters" name="Protocol Adapters"/>
- </appInfo>
- <documentation>
- This extension point is used to provide an adapter for a new protocol (e.g. HTTP). This allows different types of protocols to be monitored.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="protocolAdapter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="protocolAdapter">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate</samp>
-Protocol adapter instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the protocol adapter
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a protocol adapter extension point to define a protocol adapter for TCP/IP:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.internet.monitor.core.protocolAdapters">
- <protocolAdapter
- id="TCPIP"
- class="com.example.TCPIPProtocolAdapter"
- name="%TCPIP"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.internet.monitor.core.ProtocolAdapterDelegate</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Common Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/schema/requestListeners.exsd b/plugins/org.eclipse.wst.internet.monitor.core/schema/requestListeners.exsd
deleted file mode 100644
index f09f007..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.core/schema/requestListeners.exsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.core" id="requestListeners" name="Request Listeners"/>
- </appInfo>
- <documentation>
- This extension point is used to listen for new monitor traffic (requests), or changes to existing requests. The extension point will be called whenever the monitor adds, changes, or removes a request.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="requestListener" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="requestListener">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.wst.internet.monitor.core.IRequestListener</samp>
-RequestListener instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.internet.monitor.core.IRequestListener"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a request listener extension point:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.internet.monitor.core.requestListeners">
- <requestListener
- id="com.example.requestListener"
- class="com.example.MyRequestListener"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.wst.internet.monitor.core.IRequestListener</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Common Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.classpath b/plugins/org.eclipse.wst.internet.monitor.ui/.classpath
deleted file mode 100644
index 0631920..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="monitorui/"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore b/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore
deleted file mode 100644
index 7d2f75b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-monitorui.jar
-build.xml
-temp.folder
-org.eclipse.wst.internet.monitor.ui_3.0.0.jar
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/.project b/plugins/org.eclipse.wst.internet.monitor.ui/.project
deleted file mode 100644
index b81173e..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.monitor.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/build.properties b/plugins/org.eclipse.wst.internet.monitor.ui/build.properties
deleted file mode 100644
index a4f741a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.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,\
- *.jar,\
- monitorui.jar,\
- plugin.properties,\
- icons/
-jars.compile.order =
-src.includes = schema/,\
- build.properties
-output.monitorui.jar = bin/
-source.monitorui.jar = monitorui/
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif
deleted file mode 100644
index 389954f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif
deleted file mode 100644
index fb20c38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif
deleted file mode 100644
index e334e9f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/clcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif
deleted file mode 100644
index c374f13..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/cview16/monitorView.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif
deleted file mode 100644
index 3bf98c0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif
deleted file mode 100644
index 6d71a8b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif
deleted file mode 100644
index 06e0c73..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/dlcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif
deleted file mode 100644
index 389954f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/clear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif
deleted file mode 100644
index fb20c38..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/httpHeader.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif
deleted file mode 100644
index cf62b63..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/resendRequest.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif
deleted file mode 100644
index e334e9f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/elcl16/sortResponseTime.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif
deleted file mode 100644
index d044e59..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/etool16/editRequest.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif
deleted file mode 100644
index c374f13..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/eview16/monitorView.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif
deleted file mode 100644
index b51ae39..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/host.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif
deleted file mode 100644
index 42e5f31..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOff.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif
deleted file mode 100644
index 2ff3974..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/monitorOn.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif b/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif
deleted file mode 100644
index 8a6e219..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/icons/obj16/tcp.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/ContentViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/ContentViewer.java
deleted file mode 100644
index d2338eb..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/ContentViewer.java
+++ /dev/null
@@ -1,48 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui;
-
-import org.eclipse.swt.widgets.Composite;
-/**
- * Viewer interface for displaying request and response messages.
- * This abstract class is intended to be extended only by clients
- * to extend the <code>contentViewers</code> extension point.
- *
- * @since 1.0
- */
-public abstract class ContentViewer {
- /**
- * Initializes the viewer so it can be used to display content. Requires the parent
- * Composite that the viewer will display its information in.
- *
- * @param parent the parent composite
- */
- public void init(Composite parent) {
- // do nothing
- }
-
- /**
- * Sets the content that the viewer should display. The parameter may be null if
- * no content should be displayed.
- *
- * @param b the content
- */
- public void setContent(byte[] b) {
- // do nothing
- }
-
- /**
- * Disposes this viewer and any underlying resources such as a composite.
- */
- public void dispose() {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/EditableContentViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/EditableContentViewer.java
deleted file mode 100644
index 194a96b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/EditableContentViewer.java
+++ /dev/null
@@ -1,41 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui;
-/**
- * Editable viewer for viewing and editing requests and responses.
- * This abstract class is intended to be extended only by clients
- * to extend the <code>contentFilters</code> extension point.
- *
- * @see ContentViewer
- * @since 1.0
- */
-public abstract class EditableContentViewer extends ContentViewer {
- /**
- * Set whether the current viewer is editable, that is, the user is able to
- * edit the content.
- *
- * @param editable <code>true</code> if true the content can be edited,
- * and <code>false</code> otherwise
- */
- public void setEditable(boolean editable) {
- // do nothing
- }
-
- /**
- * Get the content from the viewer. This is usually only interesting if the
- * content has changed.
- *
- * @return the content from the viewer
- */
- public byte[] getContent() {
- return null;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java
deleted file mode 100644
index 7bcda23..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/ContextIds.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-/**
- * Constant ids for context help.
- */
-public interface ContextIds {
- public static final String VIEW = MonitorUIPlugin.PLUGIN_ID + ".tmvw0000";
- public static final String VIEW_TREE = MonitorUIPlugin.PLUGIN_ID + ".tmvw0002";
- public static final String VIEW_REQUEST = MonitorUIPlugin.PLUGIN_ID + ".tmvw0004";
- public static final String VIEW_RESPONSE = MonitorUIPlugin.PLUGIN_ID + ".tmvw0006";
-
- public static final String PREF = MonitorUIPlugin.PLUGIN_ID + ".tmpr0000";
- public static final String PREF_SHOW = MonitorUIPlugin.PLUGIN_ID + ".tmpr0002";
- public static final String PREF_MONITORS = MonitorUIPlugin.PLUGIN_ID + ".tmpr0004";
- public static final String PREF_DIALOG = MonitorUIPlugin.PLUGIN_ID + ".tmpr0006";
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorComposite.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorComposite.java
deleted file mode 100644
index eb7e2bf..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorComposite.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.Window;
-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.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- *
- */
-public class MonitorComposite extends Composite {
- protected Table table;
- protected TableViewer tableViewer;
-
- protected Button edit;
- protected Button remove;
- protected Button start;
- protected Button stop;
-
- protected List selection2;
-
- public MonitorComposite(Composite parent, int style) {
- super(parent, style);
-
- createWidgets();
- }
-
- protected void createWidgets() {
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = 6;
- layout.verticalSpacing = 6;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- setLayout(layout);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
-
- Label label = new Label(this, SWT.WRAP);
- label.setText(MonitorUIPlugin.getResource("%monitorList"));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
-
- label = new Label(this, SWT.NONE);
-
- table = new Table(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 300;
- WorkbenchHelp.setHelp(table, ContextIds.PREF_MONITORS);
-
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout tableLayout = new TableLayout();
-
- TableColumn statusColumn = new TableColumn(table, SWT.NONE);
- statusColumn.setText(MonitorUIPlugin.getResource("%columnStatus"));
- ColumnWeightData colData = new ColumnWeightData(6, 60, true);
- tableLayout.addColumnData(colData);
-
- TableColumn remoteColumn = new TableColumn(table, SWT.NONE);
- remoteColumn.setText(MonitorUIPlugin.getResource("%columnRemote"));
- colData = new ColumnWeightData(12, 120, true);
- tableLayout.addColumnData(colData);
-
- TableColumn httpColumn = new TableColumn(table, SWT.NONE);
- httpColumn.setText(MonitorUIPlugin.getResource("%columnType"));
- colData = new ColumnWeightData(5, 55, true);
- tableLayout.addColumnData(colData);
-
- TableColumn localColumn = new TableColumn(table, SWT.NONE);
- localColumn.setText(MonitorUIPlugin.getResource("%columnLocal"));
- colData = new ColumnWeightData(5, 50, true);
- tableLayout.addColumnData(colData);
-
- table.setLayout(tableLayout);
-
- tableViewer = new TableViewer(table);
- tableViewer.setContentProvider(new MonitorContentProvider());
- tableViewer.setLabelProvider(new MonitorTableLabelProvider());
- tableViewer.setInput("root");
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setSelection(event.getSelection());
- }
- });
-
- Composite buttonComp = new Composite(this, SWT.NONE);
- layout = new GridLayout();
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 8;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- buttonComp.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL);
- buttonComp.setLayoutData(data);
-
- Button add = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%add"));
- add.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MonitorDialog dialog = new MonitorDialog(getShell());
- if (dialog.open() == Window.CANCEL)
- return;
- tableViewer.refresh();
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- Object monitor = monitors[monitors.length - 1];
- tableViewer.setSelection(new StructuredSelection(monitor));
- }
- });
-
- edit = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%edit"));
- edit.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- IMonitor monitor = (IMonitor) getSelection().get(0);
- IMonitorWorkingCopy wc = monitor.getWorkingCopy();
-
- MonitorDialog dialog = new MonitorDialog(getShell(), wc);
- if (dialog.open() != Window.CANCEL) {
- try {
- tableViewer.refresh(wc.save());
- } catch (Exception ex) {
- // ignore
- }
- }
- }
- });
- edit.setEnabled(false);
-
- remove = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%remove"));
- remove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- monitor.delete();
- } catch (Exception ex) {
- // ignore
- }
- tableViewer.remove(monitor);
-
- IMonitor[] monitors = MonitorCore.getMonitors();
- Object monitor2 = monitors[monitors.length - 1];
- tableViewer.setSelection(new StructuredSelection(monitor2));
- }
- }
- });
- remove.setEnabled(false);
-
- start = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%start"));
- start.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- MonitorCore.startMonitor(monitor);
- } catch (CoreException ce) {
- MessageDialog.openError(getShell(), MonitorUIPlugin.getResource("%errorDialogTitle"), ce.getStatus().getMessage());
- } catch (Exception ce) {
- MessageDialog.openError(getShell(), MonitorUIPlugin.getResource("%errorDialogTitle"), ce.getMessage());
- }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- start.setEnabled(false);
-
- stop = SWTUtil.createButton(buttonComp, MonitorUIPlugin.getResource("%stop"));
- stop.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Iterator iterator = getSelection().iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- try {
- MonitorCore.stopMonitor(monitor);
- } catch (Exception ex) {
- // ignore
- }
- tableViewer.refresh(monitor, true);
- }
- tableViewer.setSelection(tableViewer.getSelection());
- }
- });
- stop.setEnabled(false);
- }
-
- protected List getSelection() {
- return selection2;
- }
-
- protected void setSelection(ISelection sel2) {
- IStructuredSelection sel = (IStructuredSelection) sel2;
- Iterator iterator = sel.iterator();
- selection2 = new ArrayList();
-
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof IMonitor)
- selection2.add(obj);
- }
-
- if (!selection2.isEmpty()) {
- remove.setEnabled(true);
-
- boolean allStopped = true;
- boolean allStarted = true;
-
- iterator = selection2.iterator();
- while (iterator.hasNext()) {
- IMonitor monitor = (IMonitor) iterator.next();
- if (monitor.isRunning())
- allStopped = false;
- else
- allStarted = false;
- }
- start.setEnabled(allStopped);
- stop.setEnabled(allStarted);
- edit.setEnabled(selection2.size() == 1 && allStopped);
- } else {
- edit.setEnabled(false);
- remove.setEnabled(false);
- start.setEnabled(false);
- stop.setEnabled(false);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java
deleted file mode 100644
index 38e66c4..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorContentProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- * Monitor content provider.
- */
-public class MonitorContentProvider implements IStructuredContentProvider {
- /**
- * MonitorContentProvider constructor comment.
- */
- public MonitorContentProvider() {
- super();
- }
-
- /*
- * Disposes of this content provider.
- */
- public void dispose() {
- // do nothing
- }
-
- /*
- * Returns the elements to display in the viewer
- * when its input is set to the given element.
- */
- public Object[] getElements(Object inputElement) {
- return MonitorCore.getMonitors();
- }
-
- /*
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java
deleted file mode 100644
index 1de67d7..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorDialog.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import java.net.InetAddress;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy;
-import org.eclipse.wst.internet.monitor.core.IProtocolAdapter;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- *
- */
-public class MonitorDialog extends Dialog {
- protected IMonitorWorkingCopy monitor;
- protected boolean isEdit;
-
- private Button okButton;
- private Text monitorPort;
- private Text remoteHostname;
- private Text remotePort;
-
- interface StringModifyListener {
- public void valueChanged(String s);
- }
-
- interface BooleanModifyListener {
- public void valueChanged(boolean b);
- }
-
- interface TypeModifyListener {
- public void valueChanged(IProtocolAdapter type);
- }
-
- /**
- * @param parentShell
- */
- public MonitorDialog(Shell parentShell, IMonitorWorkingCopy monitor) {
- super(parentShell);
- this.monitor = monitor;
- isEdit = true;
- }
-
- public MonitorDialog(Shell parentShell) {
- super(parentShell);
- monitor = MonitorCore.createMonitor();
- isEdit = false;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (isEdit)
- shell.setText(MonitorUIPlugin.getResource("%editMonitor"));
- else
- shell.setText(MonitorUIPlugin.getResource("%newMonitor"));
- }
-
- protected Label createLabel(Composite comp, String txt) {
- Label label = new Label(comp, SWT.NONE);
- label.setText(txt);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- return label;
- }
-
- protected Text createText(Composite comp, String txt, final StringModifyListener listener) {
- final Text text = new Text(comp, SWT.BORDER);
- if (txt != null)
- text.setText(txt);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = 150;
- text.setLayoutData(data);
- if (listener != null)
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- listener.valueChanged(text.getText());
- }
- });
- return text;
- }
-
- protected Combo createTypeCombo(Composite comp, final IProtocolAdapter[] types, IProtocolAdapter sel, final TypeModifyListener listener) {
- final Combo combo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);
- int size = types.length;
- String[] items = new String[size];
- int index = -1;
- for (int i = 0; i < size; i++) {
- items[i] = types[i].getName();
- if (types[i].equals(sel))
- index = i;
- }
- combo.setItems(items);
- if (index >= 0)
- combo.select(index);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = 150;
- combo.setLayoutData(data);
- if (listener != null)
- combo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- listener.valueChanged(types[combo.getSelectionIndex()]);
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- return combo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- ((GridLayout)composite.getLayout()).numColumns = 2;
-
- WorkbenchHelp.setHelp(composite, ContextIds.PREF_DIALOG);
-
- createLabel(composite, MonitorUIPlugin.getResource("%localPort"));
- monitorPort = createText(composite, monitor.getLocalPort() + "", new StringModifyListener() {
- public void valueChanged(String s) {
- try {
- monitor.setLocalPort(Integer.parseInt(s));
- } catch (Exception e) {
- // ignore
- }
- validateFields();
- }
- });
-
- Group group = new Group(composite, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- group.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- group.setLayoutData(data);
- group.setText(MonitorUIPlugin.getResource("%remoteGroup"));
-
- createLabel(group, MonitorUIPlugin.getResource("%remoteHost"));
- remoteHostname = createText(group, monitor.getRemoteHost(), new StringModifyListener() {
- public void valueChanged(String s) {
- monitor.setRemoteHost(s);
- validateFields();
- }
- });
-
- createLabel(group, MonitorUIPlugin.getResource("%remotePort"));
- remotePort = createText(group, monitor.getRemotePort() + "", new StringModifyListener() {
- public void valueChanged(String s) {
- try {
- monitor.setRemotePort(Integer.parseInt(s));
- } catch (Exception e) {
- // ignore
- }
- validateFields();
- }
- });
-
- createLabel(group, MonitorUIPlugin.getResource("%parseType"));
- createTypeCombo(group, MonitorCore.getProtocolAdapters(), monitor.getProtocolAdapter(), new TypeModifyListener() {
- public void valueChanged(IProtocolAdapter type) {
- monitor.setProtocolAdapter(type);
- }
- });
-
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- monitor.save();
- super.okPressed();
- }
-
- protected Control createButtonBar(Composite parent) {
- Control buttonControl = super.createButtonBar(parent);
- validateFields();
- return buttonControl;
- }
-
- private void setOKButtonEnabled(boolean curIsEnabled) {
- if (okButton == null)
- okButton = getButton(IDialogConstants.OK_ID);
-
- if (okButton != null)
- okButton.setEnabled(curIsEnabled);
- }
-
- protected void validateFields() {
- if (monitorPort == null)
- return;
-
- boolean result = true;
-
- String currHostname = remoteHostname.getText();
- if (!isValidHostname(currHostname))
- result = false;
-
- String currHostnamePort = remotePort.getText();
- try {
- Integer.parseInt(currHostnamePort);
- } catch (Exception any) {
- result = false;
- }
-
- String currMonitorPort = monitorPort.getText();
- try {
- Integer.parseInt(currMonitorPort);
- } catch (Exception any) {
- result = false;
- }
-
- if (result && isLocalhost(currHostname)) {
- if (currHostnamePort.equals(currMonitorPort))
- result = false;
- }
- setOKButtonEnabled(result);
- }
-
- protected static boolean isValidHostname(String host) {
- if (host == null || host.trim().length() < 1)
- return false;
-
- int length = host.length();
- for (int i = 0; i < length; i++) {
- char c = host.charAt(i);
- if (!Character.isLetterOrDigit(c) && c != ':' && c != '.')
- return false;
- }
- if (host.endsWith(":"))
- return false;
- return true;
- }
-
- protected static boolean isLocalhost(String host) {
- if (host == null)
- return false;
- try {
- if ("localhost".equals(host) || "127.0.0.1".equals(host))
- return true;
- InetAddress localHostaddr = InetAddress.getLocalHost();
- if (localHostaddr.getHostName().equals(host))
- return true;
- } catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error checking for localhost", e);
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java
deleted file mode 100644
index 1128741..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPreferencePage.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-/**
- * The preference page that holds monitor properties.
- */
-public class MonitorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- protected Button displayButton;
-
- /**
- * MonitorPreferencePage constructor comment.
- */
- public MonitorPreferencePage() {
- super();
- noDefaultAndApplyButton();
- }
-
- /**
- * Create the preference options.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @return org.eclipse.swt.widgets.Control
- */
- protected Control createContents(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(4);
- layout.verticalSpacing = convertVerticalDLUsToPixels(4);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- composite.setLayoutData(data);
- WorkbenchHelp.setHelp(composite, ContextIds.PREF);
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText(MonitorUIPlugin.getResource("%preferenceDescription"));
- data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- label.setLayoutData(data);
-
- displayButton = new Button(composite, SWT.CHECK);
- displayButton.setText(MonitorUIPlugin.getResource("%prefShowView"));
- displayButton.setSelection(MonitorUIPlugin.getShowOnActivityPreference());
- WorkbenchHelp.setHelp(displayButton, ContextIds.PREF_SHOW);
-
- label = new Label(composite, SWT.NONE);
- label.setText("");
-
- MonitorComposite monitorComp = new MonitorComposite(composite, SWT.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- monitorComp.setLayoutData(data);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- /**
- * Initializes this preference page using the passed desktop.
- *
- * @param desktop the current desktop
- */
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- /**
- * Performs special processing when this page's Defaults button has been pressed.
- * <p>
- * This is a framework hook method for sublcasses to do special things when
- * the Defaults button has been pressed.
- * Subclasses may override, but should call <code>super.performDefaults</code>.
- * </p>
- */
- protected void performDefaults() {
- displayButton.setSelection(MonitorUIPlugin.getDefaultShowOnActivityPreference());
- super.performDefaults();
- }
-
- /**
- * Method declared on IPreferencePage.
- * Subclasses should override
- */
- public boolean performOk() {
- MonitorUIPlugin.setShowOnActivityPreference(displayButton.getSelection());
- MonitorUIPlugin.getInstance().savePluginPreferences();
- return true;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPrefrencesDialog.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPrefrencesDialog.java
deleted file mode 100644
index 1269ba5..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorPrefrencesDialog.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.internet.monitor.core.IMonitorWorkingCopy;
-/**
- *
- */
-public class MonitorPrefrencesDialog extends Dialog {
- protected IMonitorWorkingCopy monitor;
- protected boolean isEdit;
-
- /**
- * @param parentShell
- */
- public MonitorPrefrencesDialog(Shell parentShell, IMonitorWorkingCopy monitor) {
- super(parentShell);
- this.monitor = monitor;
- isEdit = true;
- }
-
- public MonitorPrefrencesDialog(Shell composite) {
- super(composite);
- isEdit=false;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(MonitorUIPlugin.getResource("%preferenceTitle"));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite compositeParent = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(compositeParent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
- WorkbenchHelp.setHelp(composite, ContextIds.PREF);
-
- MonitorComposite monitorComp = new MonitorComposite(composite, SWT.NONE);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- monitorComp.setLayoutData(data);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- MonitorUIPlugin.getInstance().savePluginPreferences();
- super.okPressed();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java
deleted file mode 100644
index 8687122..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorTableLabelProvider.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.internet.monitor.core.IMonitor;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-/**
- * Monitor table label provider.
- */
-public class MonitorTableLabelProvider implements ITableLabelProvider {
- /**
- * MonitorTableLabelProvider constructor comment.
- */
- public MonitorTableLabelProvider() {
- super();
- }
-
- /**
- * Adds a listener to this label provider.
- * Has no effect if an identical listener is already registered.
- * <p>
- * Label provider listeners are informed about state changes
- * that affect the rendering of the viewer that uses this label provider.
- * </p>
- *
- * @param listener a label provider listener
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /**
- * Disposes of this label provider. When a label provider is
- * attached to a viewer, the viewer will automatically call
- * this method when the viewer is being closed. When label providers
- * are used outside of the context of a viewer, it is the client's
- * responsibility to ensure that this method is called when the
- * provider is no longer needed.
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns the label image for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- * @param columnIndex the zero-based index of the column in which
- * the label appears
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- IMonitor monitor = (IMonitor) element;
- if (monitor.isRunning())
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_MONITOR_ON);
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_MONITOR_OFF);
- }
- return null;
- }
-
- /**
- * Returns the label text for the given column of the given element.
- *
- * @param element the object representing the entire row, or
- * <code>null</code> indicating that no input object is set
- * in the viewer
- * @param columnIndex the zero-based index of the column in which the label appears
- */
- public String getColumnText(Object element, int columnIndex) {
- IMonitor monitor = (IMonitor) element;
- if (columnIndex == 0) {
- if (monitor.isRunning())
- return MonitorUIPlugin.getResource("%started");
- return MonitorUIPlugin.getResource("%stopped");
- } else if (columnIndex == 1)
- return monitor.getRemoteHost() + ":" + monitor.getRemotePort();
- else if (columnIndex == 2)
- return monitor.getProtocolAdapter().getName();
- else if (columnIndex == 3)
- return monitor.getLocalPort() + "";
- else
- return "X";
- }
-
- protected String notNull(String s) {
- if (s == null)
- return "";
-
- return s;
- }
-
- /**
- * Returns whether the label would be affected
- * by a change to the given property of the given element.
- * This can be used to optimize a non-structural viewer update.
- * If the property mentioned in the update does not affect the label,
- * then the viewer need not update the label.
- *
- * @param element the element
- * @param property the property
- * @return <code>true</code> if the label would be affected,
- * and <code>false</code> if it would be unaffected
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * Removes a listener to this label provider.
- * Has no affect if an identical listener is not registered.
- *
- * @param listener a label provider listener
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java
deleted file mode 100644
index be5902b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/MonitorUIPlugin.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.osgi.framework.BundleContext;
-/**
- * The TCP/IP monitor UI plugin.
- */
-public class MonitorUIPlugin extends AbstractUIPlugin {
- public static final String PLUGIN_ID = "org.eclipse.wst.internet.monitor.ui";
-
- private static MonitorUIPlugin singleton;
-
- protected Map imageDescriptors = new HashMap();
-
- private static URL ICON_BASE_URL;
- private static final String URL_CLCL = "clcl16/";
- private static final String URL_ELCL = "elcl16/";
- private static final String URL_DLCL = "dlcl16/";
- private static final String URL_OBJ = "obj16/";
-
- public static final String IMG_ELCL_SORT_RESPONSE_TIME = "IMG_ELCL_SORT_RESPONSE_TIME";
- public static final String IMG_ELCL_CLEAR = "IMG_ELCL_CLEAR";
- public static final String IMG_ELCL_HTTP_HEADER = "IMG_ELCL_HTTP_HEADER";
- public static final String IMG_CLCL_SORT_RESPONSE_TIME = "IMG_CLCL_SORT_RESPONSE_TIME";
- public static final String IMG_CLCL_CLEAR = "IMG_CLCL_CLEAR";
- public static final String IMG_CLCL_HTTP_HEADER = "IMG_CLCL_HTTP_HEADER";
- public static final String IMG_DLCL_SORT_RESPONSE_TIME = "IMG_DLCL_SORT_RESPONSE_TIME";
- public static final String IMG_DLCL_CLEAR = "IMG_DLCL_CLEAR";
- public static final String IMG_DLCL_HTTP_HEADER = "IMG_DLCL_HTTP_HEADER";
-
- public static final String IMG_REQUEST_RESPONSE = "requestResponse";
- public static final String IMG_RESEND_REQUEST_RESPONSE = "resendRequestResponse";
-
- public static final String IMG_HOST = "host";
- public static final String IMG_MONITOR_ON = "monitorOn";
- public static final String IMG_MONITOR_OFF = "monitorOff";
-
- private static final String SHOW_VIEW_ON_ACTIVITY = "show-view";
- private static final String SHOW_HEADER = "show-header";
-
- /**
- * MonitorUIPlugin constructor comment.
- */
- public MonitorUIPlugin() {
- super();
- singleton = this;
-
- // Create an adapter factory to hold the adapter for IRequests
- IAdapterFactory adaptFact = new IAdapterFactory() {
- private RequestActionFilter reqActionFilter = null;
-
- public Class[] getAdapterList() {
- return new Class[] { IActionFilter.class };
- }
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType == IActionFilter.class) {
- if (reqActionFilter == null) {
- reqActionFilter = new RequestActionFilter();
- }
- return reqActionFilter;
- }
- return null;
- }
- };
-
- Platform.getAdapterManager().registerAdapters(adaptFact, IRequest.class);
- }
-
- /**
- * Creates and pre-loads the image registry.
- *
- * @return ImageRegistry
- */
- protected ImageRegistry createImageRegistry() {
- ImageRegistry registry = super.createImageRegistry();
-
- registerImage(registry, IMG_REQUEST_RESPONSE, URL_OBJ + "tcp.gif");
- registerImage(registry, IMG_RESEND_REQUEST_RESPONSE, URL_ELCL + "resendRequest.gif");
-
- registerImage(registry, IMG_HOST, URL_OBJ + "host.gif");
- registerImage(registry, IMG_MONITOR_ON, URL_OBJ + "monitorOn.gif");
- registerImage(registry, IMG_MONITOR_OFF, URL_OBJ + "monitorOff.gif");
-
- registerImage(registry, IMG_CLCL_CLEAR, URL_CLCL + "clear.gif");
- registerImage(registry, IMG_CLCL_SORT_RESPONSE_TIME, URL_CLCL + "sortResponseTime.gif");
- registerImage(registry, IMG_CLCL_HTTP_HEADER, URL_CLCL + "httpHeader.gif");
-
- registerImage(registry, IMG_ELCL_CLEAR, URL_ELCL + "clear.gif");
- registerImage(registry, IMG_ELCL_SORT_RESPONSE_TIME, URL_ELCL + "sortResponseTime.gif");
- registerImage(registry, IMG_ELCL_HTTP_HEADER, URL_ELCL + "httpHeader.gif");
-
- registerImage(registry, IMG_DLCL_CLEAR, URL_DLCL + "clear.gif");
- registerImage(registry, IMG_DLCL_SORT_RESPONSE_TIME, URL_DLCL + "sortResponseTime.gif");
- registerImage(registry, IMG_DLCL_HTTP_HEADER, URL_DLCL + "httpHeader.gif");
-
- return registry;
- }
-
- /**
- * Return the image with the given key from the image registry.
- *
- * @param key the key
- * @return the image
- */
- public static Image getImage(String key) {
- return getInstance().getImageRegistry().get(key);
- }
-
- /**
- * Return the image with the given key from the image registry.
- *
- * @param key the key
- * @return an image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- try {
- getInstance().getImageRegistry();
- return (ImageDescriptor) getInstance().imageDescriptors.get(key);
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Returns the singleton instance of this plugin.
- *
- * @return the plugin
- */
- public static MonitorUIPlugin getInstance() {
- return singleton;
- }
-
- /**
- * Returns the translated String found with the given key.
- *
- * @param key the key
- * @return the translated string
- */
- public static String getResource(String key) {
- try {
- return Platform.getResourceString(getInstance().getBundle(), key);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key, and formatted
- * with the given object.
- *
- * @param key the key
- * @param obj substitution variables
- * @return the translated string
- */
- public static String getResource(String key, Object[] obj) {
- try {
- return MessageFormat.format(getResource(key), obj);
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Returns the translated String found with the given key, and formatted
- * with the given object.
- *
- * @param key the key
- * @param s substitution variable
- * @return the translated string
- */
- public static String getResource(String key, String s) {
- try {
- return MessageFormat.format(getResource(key), new String[] { s });
- } catch (Exception e) {
- return key;
- }
- }
-
- /**
- * Register an image with the registry.
- *
- * @param key the key
- * @param partialURL
- */
- private void registerImage(ImageRegistry registry, String key, String partialURL) {
- if (ICON_BASE_URL == null) {
- String pathSuffix = "icons/";
- ICON_BASE_URL = singleton.getBundle().getEntry(pathSuffix);
- }
-
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));
- registry.put(key, id);
- imageDescriptors.put(key, id);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error registering image", e);
- }
- }
-
- /**
- * Start this plug-in.
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- getPreferenceStore().setDefault(MonitorUIPlugin.SHOW_VIEW_ON_ACTIVITY, true);
- }
-
- public static boolean getDefaultShowOnActivityPreference() {
- return getInstance().getPreferenceStore().getDefaultBoolean(SHOW_VIEW_ON_ACTIVITY);
- }
-
- public static boolean getShowOnActivityPreference() {
- return getInstance().getPreferenceStore().getBoolean(SHOW_VIEW_ON_ACTIVITY);
- }
-
- public static void setShowOnActivityPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(SHOW_VIEW_ON_ACTIVITY, b);
- getInstance().savePluginPreferences();
- }
-
- public static boolean getShowHeaderPreference() {
- return getInstance().getPreferenceStore().getBoolean(SHOW_HEADER);
- }
-
- public static void setShowHeaderPreference(boolean b) {
- getInstance().getPreferenceStore().setValue(SHOW_HEADER, b);
- getInstance().savePluginPreferences();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java
deleted file mode 100644
index 387e960..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestActionFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-/**
- * An action filter for requests.
- */
-public class RequestActionFilter implements IActionFilter{
- public static final String REQUEST_SENT = "requestsent";
-
- /**
- * @see IActionFilter#testAttribute(Object, String, String)
- */
- public boolean testAttribute(Object target, String name, String value) {
- IRequest request = (IRequest) target;
- if (name.equals(REQUEST_SENT)) {
- if (value.equals("true"))
- return request.getResponseTime() != -1;
-
- return request.getResponseTime() == -1;
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestListener.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestListener.java
deleted file mode 100644
index cd082cc..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/RequestListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IRequestListener;
-import org.eclipse.wst.internet.monitor.ui.internal.view.MonitorView;
-/**
- * Open the monitor view if there is new activity.
- */
-public class RequestListener implements IRequestListener {
- public void requestAdded(IRequest rr) {
- if (MonitorUIPlugin.getShowOnActivityPreference()) {
- MonitorView.open(rr);
- }
- }
-
- public void requestChanged(IRequest rr) {
- // do nothing
- }
-
- public void requestRemoved(IRequest rr) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java
deleted file mode 100644
index ef5fadd..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/SWTUtil.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-/**
- * SWT Utility class.
- */
-public class SWTUtil {
- private static FontMetrics fontMetrics;
-
- protected static void initializeDialogUnits(Control testControl) {
- // Compute and store a font metric
- GC gc = new GC(testControl);
- gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
- gc.dispose();
- }
-
- /**
- * Returns a width hint for a button control.
- */
- protected static int getButtonWidthHint(Button button) {
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- public static Button createButton(Composite comp, String label) {
- Button b = new Button(comp, SWT.PUSH);
- b.setText(label);
- if (fontMetrics == null)
- initializeDialogUnits(comp);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.widthHint = getButtonWidthHint(b);
- data.heightHint = Dialog.convertVerticalDLUsToPixels(fontMetrics, IDialogConstants.BUTTON_HEIGHT);
- b.setLayoutData(data);
- return b;
- }
-
- public static Button createCheckbox(Composite comp, String txt, boolean isSelected){
- Button button = new Button(comp, SWT.CHECK);
- button.setText(txt);
- GridLayout layout = new GridLayout();
- comp.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalIndent = 10;
- button.setLayoutData(data);
- button.setSelection(isSelected);
- return button;
- }
-
- public static Label createLabel(Composite comp, String txt) {
- Label label = new Label(comp, SWT.NONE);
- label.setText(txt);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- return label;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
deleted file mode 100644
index cf23e0b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/Trace.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.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;
-
- /**
- * Trace constructor comment.
- */
- private Trace() {
- super();
- }
-
- /**
- * Trace the given text.
- *
- * @param s java.lang.String
- */
- public static void trace(byte level, String s) {
- trace(level, s, null);
- }
-
- /**
- * Trace the given message and exception.
- *
- * @param s java.lang.String
- * @param t java.lang.Throwable
- */
- public static void trace(byte level, String s, Throwable t) {
- if (!MonitorUIPlugin.getInstance().isDebugging())
- return;
-
- System.out.println(s);
- if (t != null)
- t.printStackTrace();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java
deleted file mode 100644
index bd563a0..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/FilterAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.wst.internet.monitor.core.IContentFilter;
-/**
- *
- */
-public class FilterAction extends Action {
- protected IViewerManager vm;
- protected IContentFilter filter;
- protected boolean enabled;
-
- public FilterAction(IViewerManager vm, IContentFilter filter) {
- super(filter.getName(), IAction.AS_CHECK_BOX);
- this.vm = vm;
- this.filter = filter;
- }
-
- public void run() {
- if (!isChecked())
- vm.removeFilter(filter);
- else
- vm.addFilter(filter);
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/IViewerManager.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/IViewerManager.java
deleted file mode 100644
index 9c0ff0a..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/IViewerManager.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.wst.internet.monitor.core.IContentFilter;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- * Manager interface for TCP/IP request and response message viewers
- */
-public interface IViewerManager {
- /**
- * Set whether or not to show HTTP header details
- * @param b boolean
- */
- public void setDisplayHeaderInfo(boolean b);
-
- /**
- * Returns whether or not HTTP header details is showing
- * @return boolean
- */
- public boolean getDisplayHeaderInfo();
-
- /**
- * Show the TCP/IP request message in a parent Composite
- * @param rr org.eclipse.tcpip.monitor.internal.RequestResponse
- * @param parent org.eclipse.swt.widgets.Composite
- */
- public void setRequest(IRequest rr);
-
- /**
- * Returns an array of the available TCP/IP request viewer ids
- * @return java.lang.String[]
- */
- public List getRequestViewers();
-
- /**
- * Returns an array of the available TCP/IP response viewer ids
- * @return java.lang.String[]
- */
- public List getResponseViewers();
-
- /**
- * Set the TCP/IP request message viewer
- * @param id java.lang.String
- */
- public void setRequestViewer(IConfigurationElement element);
-
- /**
- * Set the TCP/IP response message viewer
- * @param id java.lang.String
- */
- public void setResponseViewer(IConfigurationElement element);
-
- public void addFilter(IContentFilter filter);
-
- public void removeFilter(IContentFilter filter);
-
- /**
- * Return the current request viewer.
- * @return The current request viewer.
- */
- public ContentViewer getCurrentRequestViewer();
-
- /**
- * Return the current request header viewer.
- * @return The current request header viewer.
- */
- public HeaderViewer getCurrentRequestHeaderViewer();
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java
deleted file mode 100644
index 586a43c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ModifyMessageAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- * Modify the selected message. Creates a new resendrequest and adds it
- * to the tree.
- */
-public class ModifyMessageAction implements IViewActionDelegate{
- ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof IRequest) {
- IRequest req = (IRequest) element;
- IResendRequest newReq = MonitorCore.createResendRequest(req);
- req.addResendRequest(newReq);
- TreeViewer treeViewer = MonitorView.view.treeViewer;
- treeViewer.add(req, newReq);
- treeViewer.setSelection(new StructuredSelection(newReq), false);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java
deleted file mode 100644
index b91ae83..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorTreeContentProvider.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- * Content provider for the monitor server view.
- */
-public class MonitorTreeContentProvider implements ITreeContentProvider{
- protected static final String ROOT = "root";
-
- protected boolean sortByResponseTime;
-
- /**
- * ProxyTreeContentProvider constructor comment.
- */
- public MonitorTreeContentProvider() {
- super();
- }
-
- /**
- * Disposes of this content provider.
- * <p>
- * [Issue: This method should be changed to take a Viewer,
- * renamed and repurposed to disconnect a content provider from
- * a viewer. This is over and above what inputChanged does,
- * which is disconnecting a content provider from the viewer's
- * input (but not the viewer itself).
- * ]
- * </p>
- */
- public void dispose() {
- // do nothing
- }
-
- /**
- * Returns an iterator over the child elements of the given element.
- * <p>
- * Note: The difference between this method and
- * <code>IStructuredContentProvider.getElements</code> is
- * that <code>getElements</code> is called to obtain the
- * tree viewer's root elements, whereas <code>getChildren</code> is used
- * to obtain the children of a given node in the tree
- * (including a root).
- * </p>
- * <p>
- * [Issue: Don't know what above is trying to say.
- * See IStructuredContentProvider.getElements.
- * ]
- * </p>
- *
- * @param element the element
- * @return an iterator over the child elements
- * (element type: <code>Object</code>)
- */
- public Object[] getChildren(Object element) {
- if (element instanceof Integer) {
- Integer in = (Integer) element;
- List list = new ArrayList();
- IRequest[] requests = MonitorCore.getRequests();
- if (requests != null) {
- int size = requests.length;
- for (int i = 0; i < size; i++) {
- IRequest req = requests[i];
- if ((req.getLocalPort() == in.intValue())
- && !(req instanceof IResendRequest))
- list.add(req);
- }
- }
- if (sortByResponseTime)
- sortByResponseTime(list);
- return list.toArray();
- } else if (element instanceof IRequest) {
- IRequest req = (IRequest) element;
- IResendRequest[] rr = req.getResendRequests();
- List list = new ArrayList();
- if (rr != null) {
- int size = rr.length;
- for (int i = 0; i < size; i++) {
- list.add(rr[i]);
- }
- }
- if (sortByResponseTime)
- sortByResponseTime(list);
- return list.toArray();
- }
- return null;
- }
-
- /*
- * Returns an iterator over the elements belonging to the
- * given element. These elements can be presented as rows in a table,
- * items in a list, etc.
- */
- public Object[] getElements(Object element) {
- if (ROOT.equals(element)) {
- List list = new ArrayList();
- IRequest[] requests = MonitorCore.getRequests();
- if (requests != null) {
- int size = requests.length;
- for (int i = 0; i < size; i++) {
- IRequest req = requests[i];
- Integer in = new Integer(req.getLocalPort());
- if (!list.contains(in))
- list.add(in);
- }
- }
- if (sortByResponseTime)
- sortByResponseTime(list);
- return list.toArray();
- }
- return getChildren(element);
- }
-
- /*
- * Returns the parent for the given element, or <code>null</code>
- * indicating that the parent can't be computed.
- */
- public Object getParent(Object element) {
- if (element != null) {
- if (element instanceof Integer)
- return ROOT;
- IRequest call = (IRequest) element;
- if (call instanceof IResendRequest) {
- IResendRequest callResend = (IResendRequest) call;
- IRequest parent = callResend.getOriginalRequest();
- if (parent != null)
- return parent;
- }
- return new Integer(call.getLocalPort());
- }
- return null;
- }
-
- /*
- * Returns true if the elements are currently being sorted by response time.
- */
- public boolean getSortByResponseTime() {
- return sortByResponseTime;
- }
-
- /*
- * Returns whether the given element has children.
- */
- public boolean hasChildren(Object element) {
- if (element instanceof Integer)
- return true;
- if (element instanceof IRequest) {
- return ((IRequest) element).getResendRequests().length > 0;
- }
- return false;
- }
-
- /*
- * Notifies this content provider that the given viewer's input
- * has been switched to a different element.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- /**
- * Sets the sort by response time option.
- * @param b boolean
- */
- public void setSortByResponseTime(boolean b) {
- sortByResponseTime = b;
- }
-
- /**
- *
- */
- protected void sortByResponseTime(List list) {
- int size = list.size();
- for (int i = 0; i < size - 1; i++) {
- for (int j = i + 1; j < size; j++) {
- IRequest c1 = (IRequest) list.get(i);
- IRequest c2 = (IRequest) list.get(j);
- if (c1.getResponseTime() < c2.getResponseTime()) {
- list.set(i, c2);
- list.set(j, c1);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java
deleted file mode 100644
index 758ad69..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/MonitorView.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.text.SimpleDateFormat;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.*;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wst.internet.monitor.core.*;
-import org.eclipse.wst.internet.monitor.ui.internal.*;
-/**
- * View of TCP/IP activity.
- */
-public class MonitorView extends ViewPart {
- protected Tree tree;
- protected TreeViewer treeViewer;
- protected MonitorTreeContentProvider contentProvider;
-
- protected IRequestListener listener;
- protected IViewerManager vm;
- protected List requestViewers;
- protected List responseViewers;
-
- protected static SimpleDateFormat format = new SimpleDateFormat(MonitorUIPlugin.getResource("%viewDateFormat"));
- protected static final String VIEW_ID = "org.eclipse.wst.internet.monitor.view";
- protected static final String DEFAULT_VIEWER = "org.eclipse.wst.internet.monitor.viewers.byteviewer";
-
- protected IAction httpHeaderAction;
-
- protected static MonitorView view;
-
- protected IRequest currentRequest = null;
- protected StructuredSelection currentSelection = null;
-
- /**
- * MonitorView constructor comment.
- */
- public MonitorView() {
- super();
- view = this;
- }
-
- protected void addListener() {
- listener = new IRequestListener() {
- public void requestAdded(final IRequest rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if(!(rr instanceof IResendRequest))
- {
- Integer in = new Integer(rr.getLocalPort());
- treeViewer.add(MonitorTreeContentProvider.ROOT, in);
- treeViewer.add(in, rr);
- treeViewer.setSelection(new StructuredSelection(rr), true);
- }
- }
- });
- }
-
- public void requestChanged(final IRequest rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- IStructuredSelection sel = (IStructuredSelection) treeViewer.getSelection();
-
- treeViewer.refresh(rr);
- if (!sel.isEmpty())
- treeViewer.setSelection(sel);
- }
- });
- }
-
- public void requestRemoved(final IRequest rr) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- treeViewer.remove(rr);
- }
- });
- }
- };
-
- MonitorCore.addRequestListener(listener);
- }
-
- /**
- * Clear the view.
- */
- protected void clear() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- treeViewer.setSelection(null);
- treeViewer.setInput(MonitorTreeContentProvider.ROOT);
- }
- });
- }
-
- protected void setSelection(IRequest request) {
- if (treeViewer != null)
- treeViewer.setSelection(new StructuredSelection(request));
- }
-
- /**
- * Returns the inner component in a desktop part.
- */
- public void createPartControl(Composite parent) {
- SashForm sashFparent = new SashForm(parent, SWT.VERTICAL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = 4;
- layout.verticalSpacing = 4;
- sashFparent.setLayout(layout);
- sashFparent.setLayoutData(new GridData(GridData.FILL_BOTH));
- WorkbenchHelp.setHelp(sashFparent, ContextIds.VIEW);
-
- // create tree panel
- Composite treePanel = new Composite(sashFparent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- treePanel.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 110;
- data.horizontalSpan = 2;
- treePanel.setLayoutData(data);
-
- tree = new Tree(treePanel, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
- data = new GridData(GridData.FILL_BOTH);
- //data.widthHint = 120;
- tree.setLayoutData(data);
- treeViewer = new TreeViewer(tree);
- contentProvider = new MonitorTreeContentProvider();
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setInput(MonitorTreeContentProvider.ROOT);
- treeViewer.setLabelProvider(new TreeLabelProvider());
-
- WorkbenchHelp.setHelp(tree, ContextIds.VIEW_TREE);
-
- Composite detailsPanel = new Composite(treePanel, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- detailsPanel.setLayout(layout);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- data.widthHint = 200;
- detailsPanel.setLayoutData(data);
-
- final Label label = new Label(detailsPanel, SWT.NONE);
- label.setText(MonitorUIPlugin.getResource("%viewTime", ""));
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label label2 = new Label(detailsPanel, SWT.NONE);
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", ""));
- label2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label label3 = new Label(detailsPanel, SWT.NONE);
- label3.setText(MonitorUIPlugin.getResource("%viewType", ""));
- label3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- // create center and right panels
- SashForm sashFchild = new SashForm(sashFparent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.horizontalSpacing = 2;
- layout.verticalSpacing = 4;
- sashFchild.setLayout(layout);
- sashFparent.setWeights(new int[] { 30, 70 });
-
- // request panel
- Composite request = new Composite(sashFchild, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- request.setLayout(layout);
- request.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite requestHeader = new Composite(request, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 30;
- requestHeader.setLayout(layout);
- requestHeader.setLayoutData(data);
-
- Composite requestHeaderLeft = new Composite(requestHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- requestHeaderLeft.setLayout(layout);
- requestHeaderLeft.setLayoutData(data);
-
- Label empty1 = new Label(requestHeaderLeft, SWT.NONE);
- empty1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- final Label requestLabel = new Label(requestHeaderLeft, SWT.NONE);
- requestLabel.setText(MonitorUIPlugin.getResource("%viewRequest", ""));
- requestLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END));
-
- final Label requestSizeLabel = new Label(requestHeaderLeft, SWT.NONE);
- requestSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- requestSizeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END));
-
- Composite requestHeaderRight = new Composite(requestHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- requestHeaderRight.setLayout(layout);
- requestHeaderRight.setLayoutData(data);
-
- Label empty2 = new Label(requestHeaderRight, SWT.NONE);
- empty2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- Combo requestViewerCombo = new Combo(requestHeaderRight, SWT.DROP_DOWN | SWT.READ_ONLY);
- requestViewerCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_END));
-
- // response panel
- Composite response = new Composite(sashFchild, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 3;
- layout.marginHeight = 2;
- layout.marginWidth = 0;
- response.setLayout(layout);
- response.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite responseHeader = new Composite(response, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.numColumns = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 30;
- responseHeader.setLayout(layout);
- responseHeader.setLayoutData(data);
-
- Composite responseHeaderLeft = new Composite(responseHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 2;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- responseHeaderLeft.setLayout(layout);
- responseHeaderLeft.setLayoutData(data);
-
- Label empty3 = new Label(responseHeaderLeft, SWT.NONE);
- empty3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- final Label responseLabel = new Label(responseHeaderLeft, SWT.NONE);
- responseLabel.setText(MonitorUIPlugin.getResource("%viewResponse", ""));
- responseLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- final Label responseSizeLabel = new Label(responseHeaderLeft, SWT.NONE);
- responseSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- responseSizeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END));
-
- Composite responseHeaderRight = new Composite(responseHeader, SWT.NONE);
- layout = new GridLayout();
- layout.verticalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_VERTICAL);
- data.heightHint = 30;
- responseHeaderRight.setLayout(layout);
- responseHeaderRight.setLayoutData(data);
-
- Label empty4 = new Label(responseHeaderRight, SWT.NONE);
- empty4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
-
- Combo responseViewerCombo = new Combo(responseHeaderRight, SWT.DROP_DOWN | SWT.READ_ONLY);
- responseViewerCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_END));
-
- // viewer manager
- vm = new ViewerManager(request, request, response, response);
- requestViewers = vm.getRequestViewers();
- responseViewers = vm.getResponseViewers();
-
- // set up the viewer combo boxes
- Iterator iterator = requestViewers.iterator();
- int ctr = 0;
- while (iterator.hasNext()) {
- IConfigurationElement element = (IConfigurationElement) iterator.next();
- requestViewerCombo.add(element.getAttribute("label"), ctr);
- if (element.getAttribute("id").equals(DEFAULT_VIEWER)) {
- requestViewerCombo.select(ctr);
- vm.setRequestViewer(element);
- }
- ctr++;
- }
- requestViewerCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent arg0) {
- Combo rvCombo = (Combo) arg0.getSource();
- vm.setRequestViewer((IConfigurationElement) requestViewers.get(rvCombo.getSelectionIndex()));
- }
- });
- requestHeader.layout(true);
-
- iterator = responseViewers.iterator();
- ctr = 0;
- while(iterator.hasNext()) {
- IConfigurationElement element = (IConfigurationElement) iterator.next();
- responseViewerCombo.add(element.getAttribute("label"), ctr);
- if(element.getAttribute("id").equals(DEFAULT_VIEWER)) {
- responseViewerCombo.select(ctr);
- vm.setResponseViewer(element);
- }
- ctr++;
- }
- responseViewerCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent arg0) {
- Combo rvCombo = (Combo) arg0.getSource();
- vm.setResponseViewer((IConfigurationElement) requestViewers.get(rvCombo.getSelectionIndex()));
- }
- });
- responseHeader.layout(true);
-
- // selection listener
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
-
- IRequest req = null;
- if (selection != null && !selection.isEmpty()) {
- StructuredSelection sel = (StructuredSelection) selection;
- currentSelection = sel;
- Object obj = sel.iterator().next();
- if (obj instanceof IRequest)
- req = (IRequest) obj;
- }
-
- if (req != null) {
- label.setText(MonitorUIPlugin.getResource("%viewTime", format.format(req.getDate())));
-
- if (req.getResponseTime() == -1)
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", ""));
- else {
- String time = MonitorUIPlugin.getResource("%viewResponseTimeFormat", req.getResponseTime() + "");
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", time));
- }
- label3.setText(MonitorUIPlugin.getResource("%viewType", req.getProtocolAdapter().getName()));
-
- // request information
- requestLabel.setText(MonitorUIPlugin.getResource("%viewRequest", "localhost:" + req.getLocalPort()));
- requestSizeLabel.setText(getSizeString(req.getRequest(IRequest.CONTENT), req.getRequest(IRequest.ALL)));
-
- // response information
- responseLabel.setText(MonitorUIPlugin.getResource("%viewResponse", req.getRemoteHost() + ":" + req.getRemotePort()));
- responseSizeLabel.setText(getSizeString(req.getResponse(IRequest.CONTENT), req.getResponse(IRequest.ALL)));
-
- vm.setRequest(req);
- } else {
- label.setText(MonitorUIPlugin.getResource("%viewTime", ""));
- label2.setText(MonitorUIPlugin.getResource("%viewResponseTime", ""));
- requestLabel.setText(MonitorUIPlugin.getResource("%viewRequest", ""));
- requestSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- responseLabel.setText(MonitorUIPlugin.getResource("%viewResponse", ""));
- responseSizeLabel.setText(MonitorUIPlugin.getResource("%viewSize", ""));
- vm.setRequest(req);
- }
- currentRequest = req;
- }
- });
- treeViewer.expandToLevel(2);
-
- // Create a menu manager for a context menu.
- MenuManager menuManager = new MenuManager();
- menuManager.setRemoveAllWhenShown(true);
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- });
-
- // create the menu.
- Menu menu = menuManager.createContextMenu(treeViewer.getControl());
- treeViewer.getControl().setMenu(menu);
-
- // register the menu with the platform.
- getSite().registerContextMenu(menuManager, treeViewer);
-
- initializeActions();
-
- addListener();
- }
-
- protected String getSizeString(byte[] a, byte[] b) {
- String aa = "0";
- String bb = "0";
- if (a != null)
- aa = a.length + "";
- if (b != null)
- bb = b.length + "";
- String size = MonitorUIPlugin.getResource("%viewSizeFormat", new Object[] { aa, bb});
- return MonitorUIPlugin.getResource("%viewSize", size);
- }
-
- public void dispose() {
- super.dispose();
- treeViewer = null;
- MonitorCore.removeRequestListener(listener);
- }
-
- /**
- *
- */
- public void initializeActions() {
- final IAction sortByResponseTimeAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean b = contentProvider.getSortByResponseTime();
- contentProvider.setSortByResponseTime(!b);
- treeViewer.refresh();
- setChecked(!b);
- }
- });
- }
- };
- sortByResponseTimeAction.setChecked(false);
- sortByResponseTimeAction.setToolTipText(MonitorUIPlugin.getResource("%actionSortByResponseTime"));
- sortByResponseTimeAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_SORT_RESPONSE_TIME));
- sortByResponseTimeAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_SORT_RESPONSE_TIME));
- sortByResponseTimeAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_SORT_RESPONSE_TIME));
-
- IAction clearAction = new Action() {
- public void run() {
- MonitorCore.removeAllRequests();
- }
- };
- clearAction.setToolTipText(MonitorUIPlugin.getResource("%actionClearToolTip"));
- clearAction.setImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_ELCL_CLEAR));
- clearAction.setHoverImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_CLCL_CLEAR));
- clearAction.setDisabledImageDescriptor(MonitorUIPlugin.getImageDescriptor(MonitorUIPlugin.IMG_DLCL_CLEAR));
-
- httpHeaderAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- boolean b = vm.getDisplayHeaderInfo();
- vm.setDisplayHeaderInfo(!b);
- setChecked(!b);
- }
- });
- }
- };
- httpHeaderAction.setChecked(vm.getDisplayHeaderInfo());
- httpHeaderAction.setText(MonitorUIPlugin.getResource("%actionShowHeader"));
-
- IAction preferenceAction = new Action() {
- public void run() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-
- MonitorPrefrencesDialog monitorPrefDialog = new MonitorPrefrencesDialog(workbenchWindow.getShell());
- if (monitorPrefDialog.open() == Window.CANCEL)
- return;
- }
- };
- preferenceAction.setText(MonitorUIPlugin.getResource("%actionProperties"));
-
-
- IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
- tbm.add(sortByResponseTimeAction);
- tbm.add(clearAction);
-
- IContentFilter[] filters = MonitorCore.getContentFilters();
- IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
- menuManager.add(httpHeaderAction);
- int size = filters.length;
- for (int i = 0; i < size; i++) {
- FilterAction action = new FilterAction(vm, filters[i]);
- menuManager.add(action);
- }
- menuManager.add(preferenceAction);
- }
-
- /**
- *
- */
- public static void open(final IRequest request) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbench workbench = MonitorUIPlugin.getInstance().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- //if (workbenchWindow == null)
- // workbenchWindow = workbench.getWorkbenchWindows()[0];
-
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- IViewPart view2 = page.findView(VIEW_ID);
-
- if (view2 != null)
- page.bringToTop(view2);
- else
- page.showView(VIEW_ID);
-
- if (view != null)
- view.setSelection(request);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error opening TCP/IP view", e);
- }
- }
- });
- }
-
- /**
- *
- */
- public void setFocus() {
- if (tree != null)
- tree.setFocus();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java
deleted file mode 100644
index a56f65b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ResendMessageAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-/**
- * Resends the selected request and adds the result to the request/response tree.
- */
-public class ResendMessageAction implements IViewActionDelegate{
- protected ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof IRequest) {
- IRequest req = (IRequest) element;
- IResendRequest newReq = MonitorCore.createResendRequest(req);
- req.addResendRequest(newReq);
- TreeViewer treeViewer = MonitorView.view.treeViewer;
- treeViewer.add(req, newReq);
- treeViewer.setSelection(new StructuredSelection(newReq), false);
- newReq.sendRequest();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java
deleted file mode 100644
index f1a2ec9..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/SendModifiedMessageAction.java
+++ /dev/null
@@ -1,63 +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 Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.EditableContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- * Send a modified message.
- */
-public class SendModifiedMessageAction implements IViewActionDelegate{
- ISelection selection = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (selection != null) {
- Object element = ((StructuredSelection) selection).getFirstElement();
- if (element != null && element instanceof IResendRequest) {
- IResendRequest req = (IResendRequest) element;
- ContentViewer curViewer = MonitorView.view.vm.getCurrentRequestViewer();
- HeaderViewer curHeaderViewer = MonitorView.view.vm.getCurrentRequestHeaderViewer();
- if (curViewer instanceof EditableContentViewer)
- req.setRequest(((EditableContentViewer) curViewer).getContent(), IRequest.CONTENT);
-
- if (curHeaderViewer != null)
- req.setRequest(curHeaderViewer.getContent(), IRequest.TRANSPORT);
-
- req.sendRequest();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection2) {
- this.selection = selection2;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java
deleted file mode 100644
index b335b0c..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/TreeLabelProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.IResendRequest;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * A label provider for the monitor server view.
- */
-public class TreeLabelProvider implements ILabelProvider {
- /**
- * TreeLabelProvider constructor comment.
- */
- public TreeLabelProvider() {
- super();
- }
-
- /*
- * Adds a listener to this label provider.
- */
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- /*
- * Disposes of this label provider.
- */
- public void dispose() {
- // do nothing
- }
-
- /*
- * Returns the image for the label of the given element for use
- * in the given viewer.
- */
- public Image getImage(Object element) {
- if (element instanceof IRequest) {
- if (element instanceof IResendRequest) {
- if (!((IResendRequest) element).hasBeenSent())
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_RESEND_REQUEST_RESPONSE);
- }
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_REQUEST_RESPONSE);
- }
- return MonitorUIPlugin.getImage(MonitorUIPlugin.IMG_HOST);
- }
-
- /*
- * Returns the text for the label of the given element for use
- * in the given viewer.
- */
- public String getText(Object element) {
- if (element instanceof IRequest) {
- IRequest call = (IRequest) element;
- return call.getLabel();
- } else if (element instanceof Integer) {
- Integer in = (Integer) element;
- return "localhost:" + in.intValue();
- } else
- return element.toString();
- }
-
- /*
- * Returns whether the label would be affected
- * by a change to the given property of the given element.
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /*
- * Removes a listener to this label provider.
- */
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java
deleted file mode 100644
index b90fc3b..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/view/ViewerManager.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.view;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.*;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.internet.monitor.core.*;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.EditableContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-import org.eclipse.wst.internet.monitor.ui.internal.Trace;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.ByteViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.viewers.HeaderViewer;
-/**
- *
- */
-public class ViewerManager implements IViewerManager{
- private boolean displayHeaderInf;
-
- protected ContentViewer reqViewer;
- protected ContentViewer respViewer;
-
- protected HeaderViewer reqHeader;
- protected HeaderViewer respHeader;
-
- protected Composite reqHComp;
- protected Composite reqVComp;
-
- protected Composite respHComp;
- protected Composite respVComp;
-
- protected List viewers;
-
- protected IRequest request;
-
- protected List filters = new ArrayList();
-
- public ViewerManager(Composite reqHeadParent, Composite reqViewParent, Composite respHeadParent, Composite respViewParent) {
- reqHComp = reqHeadParent;
- respHComp = respHeadParent;
- reqVComp = reqViewParent;
- respVComp = respViewParent;
- reqHeader = new HeaderViewer(reqHComp, HeaderViewer.REQUEST_HEADER);
- respHeader = new HeaderViewer(respHComp, HeaderViewer.RESPONSE_HEADER);
- reqViewer = new ByteViewer();
- reqViewer.init(reqVComp);
- respViewer = new ByteViewer();
- respViewer.init(respVComp);
- setDisplayHeaderInfo(MonitorUIPlugin.getShowHeaderPreference());
- setAvailableViewers();
- }
-
- private void setAvailableViewers() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] cf = registry.getConfigurationElementsFor(MonitorUIPlugin.PLUGIN_ID, "viewers");
- int size = cf.length;
- viewers = new ArrayList(size);
- for (int i = 0; i < size; i++) {
- viewers.add(cf[i]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.view.IViewerManager#setDisplayHeaderInfo(boolean)
- */
- public void setDisplayHeaderInfo(boolean b) {
- displayHeaderInf = b;
- reqHeader.setDisplayHeader(b);
- respHeader.setDisplayHeader(b);
- MonitorUIPlugin.setShowHeaderPreference(b);
- if (b) {
- reqHeader.setEditable(false);
- if (request instanceof IResendRequest && request.getResponse(IRequest.TRANSPORT) == null) {
- reqHeader.setEditable(true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.internal.view.IViewerManager#getDisplayHeaderInfo()
- */
- public boolean getDisplayHeaderInfo() {
- return displayHeaderInf;
- }
-
- public void setRequest(IRequest rr) {
- // Maintain the state of the request and request header if they've been modified.
- if (request instanceof IResendRequest
- && request.getResponse(IRequest.ALL) == null) {
- if (reqViewer instanceof EditableContentViewer) {
- IResendRequest resRequest = (IResendRequest) request;
- EditableContentViewer editViewer = (EditableContentViewer) reqViewer;
- byte[] content = editViewer.getContent();
- if (content != null && !MonitorCore.parse(resRequest.getRequest(IRequest.CONTENT)).equals(MonitorCore.parse(content))) {
- resRequest.setRequest(content, IRequest.CONTENT);
- }
- byte[] header = reqHeader.getContent();
- if (header != null && !MonitorCore.parse(resRequest.getRequest(IRequest.TRANSPORT)).equals(MonitorCore.parse(header))) {
- resRequest.setRequest(header, IRequest.TRANSPORT);
- }
- }
- }
- reqHeader.setRequestResponse(rr);
- respHeader.setRequestResponse(rr);
- byte[] b = null;
- if (rr != null)
- b = filter(rr.getRequest(IRequest.CONTENT));
- reqViewer.setContent(b);
- b = null;
- if (rr != null)
- b = filter(rr.getResponse(IRequest.CONTENT));
- respViewer.setContent(b);
- request = rr;
- // Set the editor to editable if the request hasn't been sent and the
- // editor can be set as editable.
- if (request instanceof IResendRequest
- && request.getResponse(IRequest.ALL) == null) {
- if (displayHeaderInf) {
- reqHeader.setEditable(true);
- }
- if (reqViewer instanceof EditableContentViewer)
- ((EditableContentViewer) reqViewer).setEditable(true);
- } else {
- if (displayHeaderInf) {
- reqHeader.setEditable(false);
- }
- if (reqViewer instanceof EditableContentViewer)
- ((EditableContentViewer) reqViewer).setEditable(false);
- }
- }
-
- public void addFilter(IContentFilter filter) {
- filters.add(filter);
- setRequest(request);
- }
-
- public void removeFilter(IContentFilter filter) {
- filters.remove(filter);
- setRequest(request);
- }
-
- protected byte[] filter(byte[] b) {
- if (b == null)
- return null;
- Iterator iterator = filters.iterator();
- while (iterator.hasNext()) {
- IContentFilter filter = (IContentFilter) iterator.next();
- try {
- b = filter.filter(request, false, b);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error while filtering with " + filter.getId(), e);
- }
- }
- return b;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#getRequestViewers()
- */
- public List getRequestViewers() {
- IConfigurationElement element;
- Iterator iterator = viewers.iterator();
- List temp = new ArrayList();
- while (iterator.hasNext()) {
- element = (IConfigurationElement) iterator.next();
- if (element.getAttribute("type").toLowerCase().indexOf("request") >= 0)
- temp.add(element);
- }
- return temp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#getResponseViewers()
- */
- public List getResponseViewers() {
- IConfigurationElement element;
- Iterator iterator = viewers.iterator();
- List temp = new ArrayList();
- while (iterator.hasNext()) {
- element = (IConfigurationElement) iterator.next();
- if (element.getAttribute("type").toLowerCase().indexOf("response") >= 0)
- temp.add(element);
- }
- return temp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#setRequestViewer(java.lang.String)
- */
- public void setRequestViewer(IConfigurationElement element) {
- // Call set request to save and reset the request.
- setRequest(request);
- reqViewer.dispose();
- try {
- reqViewer = (ContentViewer) element.createExecutableExtension("class");
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error", e);
- }
- reqViewer.init(reqVComp);
- //reqViewer.setRequestResponse(rr);
- byte[] b = null;
- if (request != null) {
- b = filter(request.getRequest(IRequest.CONTENT));
- // Set the editor to editable if the request hasn't been sent and the
- // editor can be set as editable.
- if (request instanceof IResendRequest
- && request.getResponse(IRequest.TRANSPORT) == null) {
- if (reqViewer instanceof EditableContentViewer)
- ((EditableContentViewer) reqViewer).setEditable(true);
- } else {
- if (reqViewer instanceof EditableContentViewer)
- ((EditableContentViewer) reqViewer).setEditable(false);
- }
- }
- reqViewer.setContent(b);
- reqVComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcpip.monitor.internal.view.IViewerManager#setResponseViewer(java.lang.String)
- */
- public void setResponseViewer(IConfigurationElement element) {
- respViewer.dispose();
- try {
- respViewer = (ContentViewer) element.createExecutableExtension("class");
- } catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Error", e);
- }
- respViewer.init(respVComp);
- //respViewer.setRequestResponse(rr);
- byte[] b = null;
- if (request != null)
- b = filter(request.getResponse(IRequest.CONTENT));
- respViewer.setContent(b);
- respVComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.internal.view.IViewerManager#getCurrentRequestViewer()
- */
- public ContentViewer getCurrentRequestViewer() {
- return reqViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.internal.view.IViewerManager#getCurrentRequestHeaderViewer()
- */
- public HeaderViewer getCurrentRequestHeaderViewer() {
- return reqHeader;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java
deleted file mode 100644
index 26f6912..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ByteViewer.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.internet.monitor.ui.EditableContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-/**
- * A basic byte viewer.
- */
-public class ByteViewer extends EditableContentViewer {
- protected Text text;
- protected Composite comp;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#dispose()
- */
- public void dispose() {
- comp.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#setContent()
- */
- public void setContent(byte[] b) {
- String out = "";
- if (b != null)
- out = MonitorCore.parse(b);
-
- String lineSeparator = System.getProperty("line.separator");
- int ls = lineSeparator.length();
- if (out.length() > ls) {
- while (out.substring(0, ls).indexOf(lineSeparator) >= 0)
- out = out.substring(ls, out.length());
- }
-
- text.setText(out);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- comp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- comp.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- comp.setLayoutData(data);
-
- text = new Text(comp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = comp.getDisplay();
- text.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- text.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- text.setFont(JFaceResources.getTextFont());
- WorkbenchHelp.setHelp(text, ContextIds.VIEW_RESPONSE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IEditableContentViewer#setEditable(boolean)
- */
- public void setEditable(boolean editable) {
- text.setEditable(editable);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IEditableContentViewer#getContent()
- */
- public byte[] getContent() {
- if (text == null) {
- return new byte[0];
- }
- String content = text.getText().trim();
- if (content.equals("")) {
- return new byte[0];
- }
- // Need to ensure that there is a newline at the end of the content.
- // getBytes() removes the newline.
- byte[] twoNewlines = new byte[] { '\015', '\012' };
- byte[] contentBytes = content.getBytes();
- byte[] retBytes = new byte[contentBytes.length + 2];
- System.arraycopy(contentBytes, 0, retBytes, 0, contentBytes.length);
- System.arraycopy(twoNewlines, 0, retBytes, contentBytes.length, 2);
- return retBytes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java
deleted file mode 100644
index f161683..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/HeaderViewer.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.internet.monitor.core.IRequest;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * An transport (header) viewer.
- */
-public class HeaderViewer {
- protected boolean displayHeader;
-
- protected Composite headerComp;
- protected Composite innerComp;
- protected Composite rootComp;
-
- protected Label headerLabel;
- protected Text headerText;
- protected IRequest rr;
- protected byte msg;
- protected GridLayout layout;
- protected GridData data;
-
- protected boolean hidden;
-
- protected static int HEADER_LABEL_SIZE = 15;
- protected static int HEADER_TEXT_SIZE = 110;
- public static byte REQUEST_HEADER = 0;
- public static byte RESPONSE_HEADER = 1;
-
- public HeaderViewer(Composite parent, byte message) {
- rootComp = parent;
- displayHeader = true;
- hidden = false;
-
- headerComp = new Composite(parent, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- headerComp.setLayout(layout);
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- headerComp.setLayoutData(data);
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_LABEL_SIZE;
- innerComp.setLayoutData(data);
-
- rr = null;
- msg = message;
-
- setDisplayHeader(false);
- }
-
- /*public boolean isHidden() {
- return hidden;
- }*/
-
- /*public void hideViewer() {
- hidden = true;
- innerComp.dispose();
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = 0;
- headerComp.setLayoutData(data);
- rootComp.layout(true);
- }
-
- public void showViewer() {
- hidden = false;
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_LABEL_SIZE;
- innerComp.setLayoutData(data);
-
- displayHeader = true;
- setDisplayHeader(false);
- }*/
-
- public void setRequestResponse(IRequest reqresp) {
- rr = reqresp;
- if (!hidden)
- getView();
- }
-
- public void setDisplayHeader(boolean b) {
- if (displayHeader != b) {
- displayHeader = b;
- if (displayHeader) {
- innerComp.dispose();
-
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = HEADER_TEXT_SIZE;
- headerComp.setLayoutData(data);
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_TEXT_SIZE;
- innerComp.setLayoutData(data);
-
- headerText = new Text(innerComp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = innerComp.getDisplay();
- headerText.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- headerText.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- headerText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- headerText.setFont(JFaceResources.getTextFont());
- WorkbenchHelp.setHelp(headerText, ContextIds.VIEW_RESPONSE);
-
- rootComp.layout(true);
- } else {
- innerComp.dispose();
-
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
- data.heightHint = HEADER_LABEL_SIZE;
- headerComp.setLayoutData(data);
-
- innerComp = new Composite(headerComp, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 2;
- innerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = HEADER_LABEL_SIZE;
- innerComp.setLayoutData(data);
-
- headerLabel = new Label(innerComp, SWT.NONE);
- headerLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- rootComp.layout(true);
- }
- }
- getView();
- }
-
- /*public boolean getDisplayHeader() {
- return displayHeader;
- }*/
-
- private void getView() {
- String out = "";
- if (rr != null) {
- if (msg == REQUEST_HEADER) {
- out = MonitorCore.parse(rr.getRequest(IRequest.TRANSPORT));
- } else if (msg == RESPONSE_HEADER) {
- out = MonitorCore.parse(rr.getResponse(IRequest.TRANSPORT));
- }
- }
-
- if (displayHeader) {
- headerText.setText(out);
- } else {
- String lineSeparator = System.getProperty("line.separator");
- int index = out.indexOf(lineSeparator);
- if(index > 0)
- headerLabel.setText(MonitorUIPlugin.getResource("%headerLabel") + ": " + out.substring(0, index));
- else
- headerLabel.setText(MonitorUIPlugin.getResource("%headerLabel") + ": " + out);
- }
- }
-
- public void dispose() {
- headerComp.dispose();
- }
-
- /**
- * Set whether the header can be edited.
- *
- * @param editable If true the header can be edited, otherwise the header cannot be edited.
- */
- public void setEditable(boolean editable) {
- headerText.setEditable(editable);
- }
-
- /**
- * Get the content from the header.
- *
- * @return The content from the header.
- */
- public byte[] getContent() {
- if (headerText == null || headerText.isDisposed())
- return null;
-
- String header = headerText.getText().trim();
- // Need to ensure that the following 4 bytes end the header. The getBytes()
- // method removes spaces at the end of the string.
- byte[] twoNewlines = new byte[] { '\015', '\012', '\015', '\012' };
- byte[] headerBytes = header.getBytes();
- byte[] retBytes = new byte[headerBytes.length + 4];
- System.arraycopy(headerBytes, 0, retBytes, 0, headerBytes.length);
- System.arraycopy(twoNewlines, 0, retBytes, headerBytes.length, 4);
- return retBytes;
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java
deleted file mode 100644
index d07c136..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/ImageViewer.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import java.io.ByteArrayInputStream;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-/**
- * An image viewer.
- */
-public class ImageViewer extends ContentViewer {
- protected Composite rootComp;
- protected Composite viewerComp;
- protected Label messageLabel;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- rootComp = parent;
-
- viewerComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- viewerComp.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- viewerComp.setLayoutData(data);
-
- messageLabel = new Label(viewerComp, SWT.NONE);
- messageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#setContent()
- */
- public void setContent(byte[] b) {
- if (b == null || b.length == 0) {
- messageLabel.setText("<" + MonitorUIPlugin.getResource("%imageViewInvalid") + ">");
- } else {
- byte cr = '\r';
- byte lf = '\n';
- int trimFront = 0;
- int trimBack = 0;
- int len = b.length - 1;
- while(b[trimFront] == cr || b[trimFront] == lf)
- trimFront++;
- while(b[len - trimBack] == cr || b[len - trimBack] == lf)
- trimBack++;
-
- if (trimFront + trimBack > 0) {
- byte[] temp = b;
- b = new byte[temp.length - trimBack - trimFront];
- for(int i = trimFront; i < temp.length - trimBack; i++) {
- b[i - trimFront] = temp[i];
- }
- }
- try {
- ImageData imgD = new ImageData(new ByteArrayInputStream(b));
- Image img = new Image(null, imgD);
- messageLabel.setImage(img);
- } catch(Exception e) {
- messageLabel.setText("<" + MonitorUIPlugin.getResource("%imageViewInvalid") + ">");
- }
- }
-
- viewerComp.layout(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#dispose()
- */
- public void dispose() {
- viewerComp.dispose();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java b/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java
deleted file mode 100644
index cedb8cd..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/monitorui/org/eclipse/wst/internet/monitor/ui/internal/viewers/XMLViewer.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.internet.monitor.ui.internal.viewers;
-
-import java.io.*;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.internet.monitor.core.MonitorCore;
-import org.eclipse.wst.internet.monitor.ui.ContentViewer;
-import org.eclipse.wst.internet.monitor.ui.internal.ContextIds;
-import org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin;
-
-import org.w3c.dom.*;
-import org.xml.sax.*;
-/**
- * XML Viewer.
- */
-public class XMLViewer extends ContentViewer {
- protected GridData data;
- protected StackLayout layout;
- protected Text messageText;
-
- protected Composite rootComp;
- protected Composite viewerComp;
- protected Label messageLabel;
-
- protected boolean xmlTagMissing = false;
- protected boolean setEncoding = false;
- protected boolean missingEncoding = false;
- protected String originalEncoding;
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#dispose()
- */
- public void dispose() {
- viewerComp.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#setContent()
- */
- public void setContent(byte[] b) {
- String out = "";
- if (b != null)
- out = MonitorCore.parse(b);
-
- String lineSeparator = System.getProperty("line.separator");
- int ls = lineSeparator.length();
- if (out.length() > ls) {
- while (out.substring(0, ls).indexOf(lineSeparator) >= 0)
- out = out.substring(ls, out.length());
- }
-
- String out_temp = out.toLowerCase();
- if (out_temp.indexOf("<?xml") < 0)
- xmlTagMissing = true;
-
- if (out.length() > 0) {
- byte[] b1 = createDocument(out);
- String finalMsg = new String (b1);
- if (finalMsg.startsWith("Invalid XML")) {
- //case: error parsing
- messageText.setVisible(false);
- layout.topControl = messageLabel;
- messageLabel.setVisible(true);
- messageLabel.setText("<" + MonitorUIPlugin.getResource("%xmlViewInvalid") + ">");
-
- }
- else if (xmlTagMissing && finalMsg.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")) {
- int x = finalMsg.indexOf("\n") + 1;
- String Msg = finalMsg.substring(x);
- finalMsg = Msg;
-
- messageText.setText(finalMsg);
- }
-
- else if (setEncoding) {
- //change back to original Encoding
- int begin = finalMsg.indexOf("UTF-8"); //location of opening "
- int last = begin + 5; //location of closing "
- String first_half = finalMsg.substring(0,begin);
- String second_half = finalMsg.substring(last);
- finalMsg = first_half + originalEncoding + second_half;
-
- messageText.setText(finalMsg);
- }
-
- else if (missingEncoding) {
- //remove encoding completely
- int begin = finalMsg.indexOf("encoding=\"UTF-8\""); //location of opening "
- int last = begin + 16; //location of closing "
- String first_half = finalMsg.substring(0,begin);
- String second_half = finalMsg.substring(last);
- finalMsg = first_half + second_half;
-
- messageText.setText(finalMsg);
- }
- } else
- messageText.setText(out);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.internet.monitor.ui.IContentViewer#init(Composite)
- */
- public void init(Composite parent) {
- rootComp = parent;
-
- viewerComp = new Composite(parent, SWT.NONE);
- layout = new StackLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- viewerComp.setLayout(layout);
- data = new GridData(GridData.FILL_BOTH);
- viewerComp.setLayoutData(data);
-
- messageText = new Text(viewerComp, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);
- Display display = viewerComp.getDisplay();
- messageText.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- messageText.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- messageText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
- messageText.setFont(JFaceResources.getTextFont());
- messageText.setVisible(true);
- WorkbenchHelp.setHelp(messageText, ContextIds.VIEW_RESPONSE);
-
- messageLabel = new Label(viewerComp, SWT.NONE);
- messageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING));
- messageLabel.setVisible(false);
-
- layout.topControl = messageText;
- }
-
- /* (non-Javadoc)
- * @#createDocument(String)
- */
- protected byte[] createDocument(String str) {
- byte[] parseArray = null;
- Document document = null;
- byte[] result = null;
-
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- try {
- factory.setAttribute("http://apache.org/xml/features/allow-java-encodings", new Boolean(true));
- factory.setAttribute("http://apache.org/xml/features/continue-after-fatal-error", new Boolean(true));
- } catch (Exception e) {
- // ignore
- }
- DocumentBuilder parser = factory.newDocumentBuilder();
-
- if (xmlTagMissing) {
- str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + str;
- } else {
- String str_temp = str.toLowerCase();
-
- //if encoding present,then save original Encoding, change to UTF-8
- if (str_temp.indexOf("encoding=") >= 0) {
- setEncoding = true;
- String temp1 = str.substring(str_temp.indexOf("encoding="));
- int beginIndex = temp1.indexOf("\"") + 1;
- String temp2 = temp1.substring(beginIndex);
- int endIndex = temp2.indexOf("\"");
- originalEncoding = temp2.substring(0, endIndex);
- }
-
- //if no encoding at all,then no changes to be made
- else if (str_temp.indexOf("encoding") < 0) {
- setEncoding = false;
- missingEncoding = true;
- }
- }
- parseArray = str.getBytes();
- document = parser.parse(new InputSource(new ByteArrayInputStream(parseArray)));
- result = getContents(document);
-
- } catch (Exception e) {
- result = "Invalid XML".getBytes();
- }
- return result;
- }
-
- protected byte[] getContents(Document document) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- Result result = new StreamResult(out);
- Source source = new DOMSource(document);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.transform(source, result);
- }
- catch (TransformerConfigurationException e) {
- throw (IOException) (new IOException().initCause(e));
- }
- catch (TransformerException e) {
- throw (IOException) (new IOException().initCause(e));
- }
- return out.toByteArray();
- }
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties b/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties
deleted file mode 100644
index c71b803..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.properties
+++ /dev/null
@@ -1,77 +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=TCP/IP Monitor
-providerName=Eclipse.org
-
-extensionPointViewers=Viewers
-
-# --------------- TCP/IP Monitor view ---------------
-
-# Labels
-viewTitle=TCP/IP Monitor
-viewRequest=Request: {0}
-viewResponse=Response: {0}
-viewTime=Time of request: {0}
-viewType=Type: {0}
-viewResponseTime=Response Time: {0}
-viewSize=Size: {0}
-viewResponseTimeFormat={0} ms
-viewSizeFormat={0} ({1}) bytes
-viewDateFormat=h:mm.s.S a
-
-# Actions
-actionSortByResponseTime=Sort by response time
-actionClearToolTip=Clear
-actionShowHeader=Show header
-actionProperties=Properties...
-actionResend=Resend request
-actionModify=Modify request
-actionModifyResend=Send Modified Request
-
-
-# --------------- RequestResponse Viewers ---------------
-byteView=Byte View
-imageView=Image View
-xmlView=XML View
-headerLabel=Header
-imageViewInvalid=Not a valid image file
-xmlViewInvalid=Not a valid XML file
-
-# --------------- Errors ---------------
-errorDialogTitle=Error
-
-# --------------- General UI ---------------
-monitorList=TCP/IP Monitors:
-columnLocal=Local Port
-columnRemote=Host name
-columnType=Type
-columnStatus=Status
-add=Add...
-edit=Edit...
-remove=Remove
-start=Start
-stop=Stop
-started=Started
-stopped=Stopped
-
-newMonitor=New Monitor
-editMonitor=Edit Monitor
-
-localPort=Local monitoring port:
-remoteGroup=Monitor
-remoteHost=Host name:
-remotePort=Port:
-parseType=Type:
-
-preferenceTitle=TCP/IP Monitor
-preferenceDescription=Configure TCP/IP monitors on local and remote ports.
-
-prefShowView=&Show the TCP/IP Monitor view when there is activity
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml b/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml
deleted file mode 100644
index c16606f..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/plugin.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin id="org.eclipse.wst.internet.monitor.ui"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.wst.internet.monitor.ui.internal.MonitorUIPlugin">
-
-<requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.wst.internet.monitor.core"/>
-</requires>
-
-<runtime>
- <library name="monitorui.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<extension-point name="%extensionPointViewers" id="viewers" schema="schema/viewers.exsd"/>
-
-
-<extension point="org.eclipse.wst.internet.monitor.core.requestListeners">
- <requestListener
- id="org.eclipse.wst.internet.monitor.ui.requestListener"
- class="org.eclipse.wst.internet.monitor.ui.internal.RequestListener"/>
-</extension>
-
-<extension point="org.eclipse.ui.views">
- <view
- id="org.eclipse.wst.internet.monitor.view"
- name="%viewTitle"
- category="org.eclipse.debug.ui"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.MonitorView"
- icon="icons/cview16/monitorView.gif">
- </view>
-</extension>
-
-<extension point="org.eclipse.ui.preferencePages">
- <page
- id="org.eclipse.wst.internet.monitor.preferencePage"
- name="%preferenceTitle"
- category="org.eclipse.internet"
- class="org.eclipse.wst.internet.monitor.ui.internal.MonitorPreferencePage"/>
-</extension>
-
-<extension point="org.eclipse.wst.internet.monitor.ui.viewers">
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.byteviewer"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.ByteViewer"
- type="requestresponse"
- label="%byteView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.imageviewer"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.ImageViewer"
- type="requestresponse"
- label="%imageView"/>
- <viewer
- id="org.eclipse.wst.internet.monitor.viewers.XMLViewer"
- class="org.eclipse.wst.internet.monitor.ui.internal.viewers.XMLViewer"
- type="requestresponse"
- label="%xmlView"/>
-</extension>
-
-<extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.wst.internet.monitor.core.IRequest"
- id="org.eclipse.wst.internet.monitor.ui.modifyaction">
- <filter name="requestsent" value="true"/>
- <action
- label="%actionResend"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.ResendMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.ResendMessageAction"
- icon="icons/elcl16/resendRequest.gif">
- </action>
- <action
- label="%actionModify"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.ModifyMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.ModifyMessageAction"
- icon="icons/etool16/editRequest.gif">
- </action>
- </objectContribution>
- <objectContribution
- objectClass="org.eclipse.wst.internet.monitor.core.IRequest"
- id="org.eclipse.wst.internet.monitor.ui.sendmodifyaction">
- <filter name="requestsent" value="false"/>
- <action
- label="%actionModifyResend"
- menubarPath="additions"
- class="org.eclipse.wst.internet.monitor.ui.internal.view.SendModifiedMessageAction"
- enablesFor="1"
- id="org.eclipse.wst.internet.monitor.ui.internal.view.SendModifiedMessageAction"
- icon="icons/elcl16/resendRequest.gif">
- </action>
- </objectContribution>
-</extension>
-
-</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd b/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd
deleted file mode 100644
index 052ee01..0000000
--- a/plugins/org.eclipse.wst.internet.monitor.ui/schema/viewers.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.internet.monitor.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.internet.monitor.ui" id="viewers" name="Content Viewers"/>
- </appInfo>
- <documentation>
- This extension point is used to provide a viewer for a specific type of content. (e.g. a viewer for a particular image format)
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="viewer" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="viewer">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique identifier for this extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that extends <samp>org.eclipse.wst.internet.monitor.ui.ContentViewer</samp>. Viewers instances of this type will delegate to instances of this class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.wst.server.core.model.IStartup"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- a translatable name used to identify the content viewer
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- [issue: what is this used for?]
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a content viewer extension point:
-
-<p>
-<pre>
-<extension point="org.eclipse.wst.internet.monitor.ui.viewers">
- <viewer
- id="com.example.byteviewer"
- class="com.example.ByteContentViewer"
- type="requestresponse"
- label="%byteView"/>
-</extension>
-</pre>
-</p>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends the abstract class <b>org.eclipse.wst.internet.monitor.ui.ContentViewer</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2003, 2004 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Common Public License v1.0 which accompanies
-this distribution, and is available at
-<a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>