diff options
Diffstat (limited to 'plugins/org.eclipse.wst.server.http.ui/src')
11 files changed, 0 insertions, 997 deletions
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/ContextIds.java deleted file mode 100644 index 85726794b..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/ContextIds.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; -/** - * Constant ids for context help. - */ -public interface ContextIds { - public static final String SERVER_EDITOR = HttpUIPlugin.PLUGIN_ID + ".teig0000"; - public static final String RUNTIME_COMPOSITE = HttpUIPlugin.PLUGIN_ID + ".twnr0000"; -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeComposite.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeComposite.java deleted file mode 100644 index 58aa03053..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeComposite.java +++ /dev/null @@ -1,204 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -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.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.server.core.IRuntimeWorkingCopy; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.http.core.internal.HttpRuntime; -import org.eclipse.wst.server.ui.wizard.IWizardHandle; -/** - * Wizard page to set the server install directory. - */ -public class HttpRuntimeComposite extends Composite { - protected IRuntimeWorkingCopy runtimeWC; - protected HttpRuntime runtime; - protected Text name; - protected Text publishDir; - protected Button browseButton; - protected IWizardHandle wizard; - - /** - * HttpRuntimeComposite - * - * @param parent the parent composite - * @param wizard the wizard handle - */ - public HttpRuntimeComposite(Composite parent, IWizardHandle wizard) { - super(parent, SWT.NONE); - this.wizard = wizard; - wizard.setTitle(Messages.wizardTitle); - wizard.setDescription(Messages.wizardDescription); - wizard.setImageDescriptor(HttpUIPlugin.getImageDescriptor(HttpUIPlugin.IMG_WIZ_SERVER)); - - createControl(); - } - - protected void setRuntime(IRuntimeWorkingCopy newRuntime) { - if (newRuntime == null) { - runtimeWC = null; - runtime = null; - } else { - runtimeWC = newRuntime; - runtime = (HttpRuntime) newRuntime.loadAdapter(HttpRuntime.class, null); - } - - init(); - validate(); - } - - /** - * Provide a wizard page to change the Apache installation directory. - */ - protected void createControl() { - GridLayout layout = new GridLayout(1, true); - setLayout(layout); - setLayoutData(new GridData(GridData.FILL_BOTH)); - - Composite nameGroup = new Composite(this, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = 0; - layout.marginHeight = 0; - nameGroup.setLayout(layout); - nameGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.RUNTIME_COMPOSITE); - - Label label = new Label(nameGroup, SWT.NONE); - label.setText(Messages.runtimeName); - GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END); - data.horizontalSpan = 2; - label.setLayoutData(data); - - name = new Text(nameGroup, SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - name.setLayoutData(data); - name.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - runtimeWC.setName(name.getText()); - validate(); - } - }); - - createPublishLocationGroup(nameGroup); - - init(); - validate(); - - Dialog.applyDialogFont(this); - - name.forceFocus(); - } - - protected void init() { - if (name == null || runtimeWC == null || runtime == null) - return; - - name.setText(runtimeWC.getName()); - if (runtimeWC.getLocation() != null) - publishDir.setText(runtimeWC.getLocation().toOSString()); - } - - protected void validate() { - if (runtime == null) { - wizard.setMessage("", IMessageProvider.ERROR); - return; - } - - wizard.setMessage(null, IMessageProvider.NONE); - - if (runtimeWC != null) { - String name2 = runtimeWC.getName(); - if (name2 == null || name2.trim().equals("")) { - wizard.setMessage(Messages.wizardMissingRuntimeName, IMessageProvider.ERROR); - } else { - boolean ok = checkRuntimeName(name2); - if (!ok) { - wizard.setMessage(Messages.wizardDuplicateName, IMessageProvider.ERROR); - } - } - } - } - - private void createPublishLocationGroup(Composite publishInfoGroup) { - Font font = publishInfoGroup.getFont(); - // location label - Label locationLabel = new Label(publishInfoGroup, SWT.NONE); - locationLabel.setFont(font); - locationLabel.setText(Messages.publishDir); - GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_END); - data.horizontalSpan = 2; - locationLabel.setLayoutData(data); - - // project location entry field - publishDir = new Text(publishInfoGroup, SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - publishDir.setLayoutData(data); - publishDir.setFont(font); - publishDir.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - runtimeWC.setLocation(new Path(publishDir.getText())); - validate(); - } - }); - - // browse button - browseButton = new Button(publishInfoGroup, SWT.PUSH); - browseButton.setFont(font); - browseButton.setText(Messages.browse); - browseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - DirectoryDialog dialog = new DirectoryDialog(HttpRuntimeComposite.this.getShell()); - dialog.setMessage(Messages.selectInstallDir); - dialog.setFilterPath(publishDir.getText()); - String selectedDirectory = dialog.open(); - if (selectedDirectory != null) - publishDir.setText(selectedDirectory); - } - }); - } - - private boolean checkRuntimeName(String name2) { - name2 = name2.trim(); - if (name2.equals(runtimeWC.getName())) { - return true; - } - IRuntime[] allRuntimes = ServerCore.getRuntimes(); - - if (allRuntimes != null) { - int size = allRuntimes.length; - for (int i = 0; i < size; i++) { - IRuntime runtime2 = allRuntimes[i]; - if (name2.equals(runtime2.getName())) - return false; - } - } - return true; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeWizardFragment.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeWizardFragment.java deleted file mode 100644 index 1739b2afc..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeWizardFragment.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.wst.server.core.IRuntimeWorkingCopy; -import org.eclipse.wst.server.core.TaskModel; -import org.eclipse.wst.server.ui.wizard.IWizardHandle; -import org.eclipse.wst.server.ui.wizard.WizardFragment; -/** - * HTTP runtime wizard fragment. - */ -public class HttpRuntimeWizardFragment extends WizardFragment { - protected HttpRuntimeComposite comp; - - /** - * ServerWizardFragment constructor - */ - public HttpRuntimeWizardFragment() { - // do nothing - } - - public boolean hasComposite() { - return true; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.ui.task.WizardFragment#createComposite() - */ - public Composite createComposite(Composite parent, IWizardHandle wizard) { - comp = new HttpRuntimeComposite(parent, wizard); - return comp; - } - - /* - * @see org.eclipse.wst.server.ui.wizard.WizardFragment#enter() - */ - public void enter() { - if (comp != null) { - IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME); - comp.setRuntime(runtime); - } - } - - public boolean isComplete() { - IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME); - if (runtime == null) - return false; - IStatus status = runtime.validate(null); - return (status == null || status.getSeverity() != IStatus.ERROR); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpSection.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpSection.java deleted file mode 100644 index 43d9d0aa5..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpSection.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Spinner; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.forms.IFormColors; -import org.eclipse.ui.forms.widgets.ExpandableComposite; -import org.eclipse.ui.forms.widgets.FormToolkit; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.wst.server.http.core.internal.HttpServer; -import org.eclipse.wst.server.http.core.internal.command.ModifyPortCommand; -import org.eclipse.wst.server.http.core.internal.command.ModifyPublishingCommand; -import org.eclipse.wst.server.http.core.internal.command.ModifyURLPrefixCommand; -import org.eclipse.wst.server.ui.editor.ServerEditorSection; - -public class HttpSection extends ServerEditorSection { - protected HttpServer httpServer; - protected boolean updating; - protected Text urlPrefixText; - protected Button publishCheckBox; - protected Spinner portSpinner; - protected PropertyChangeListener listener; - - public HttpSection() { - super(); - } - - protected void addChangeListener() { - listener = new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - if (updating) - return; - updating = true; - if (HttpServer.PROPERTY_PORT.equals(event.getPropertyName())) { - Integer i = (Integer) event.getNewValue(); - portSpinner.setSelection(i.intValue()); - } else if (HttpServer.PROPERTY_URL_PREFIX.equals(event.getPropertyName())) { - String s = (String) event.getNewValue(); - if (s != null) - urlPrefixText.setText(s); - } else if (HttpServer.PROPERTY_IS_PUBLISHING.equals(event.getPropertyName())) { - Boolean b = (Boolean) event.getNewValue(); - if (b != null) - publishCheckBox.setSelection(b.booleanValue()); - } - updating = false; - } - }; - server.addPropertyChangeListener(listener); - } - - public void createSection(Composite parent) { - super.createSection(parent); - - FormToolkit toolkit = getFormToolkit(parent.getDisplay()); - Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | Section.DESCRIPTION); - section.setText(Messages.editorSectionTitle); - section.setDescription(Messages.editorSectionDescription); - section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); - - Composite composite = toolkit.createComposite(section); - GridLayout layout = new GridLayout(); - layout.marginHeight = 8; - layout.marginWidth = 8; - layout.numColumns = 2; - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL)); - toolkit.paintBordersFor(composite); - section.setClient(composite); - - // URL prefix - Label label = createLabel(toolkit, composite, Messages.editorURLPrefix); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - //data.horizontalSpan = 2; - label.setLayoutData(data); - - urlPrefixText = toolkit.createText(composite, ""); - data = new GridData(GridData.FILL_HORIZONTAL); - //data.horizontalSpan = 2; - urlPrefixText.setLayoutData(data); - urlPrefixText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (updating) - return; - updating = true; - execute(new ModifyURLPrefixCommand(httpServer, urlPrefixText.getText())); - updating = false; - } - }); - - // port - createLabel(toolkit, composite, Messages.editorPort); - - portSpinner = new Spinner(composite, SWT.BORDER); - portSpinner.setMinimum(0); - portSpinner.setMinimum(999999); - data = new GridData(GridData.FILL_HORIZONTAL); - portSpinner.setLayoutData(data); - portSpinner.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (updating) - return; - updating = true; - execute(new ModifyPortCommand(httpServer, portSpinner.getSelection())); - updating = false; - } - }); - - // is publishing - publishCheckBox = new Button(composite, SWT.CHECK); - publishCheckBox.setText(Messages.editorShouldPublish); - data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - publishCheckBox.setLayoutData(data); - publishCheckBox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent se) { - Button b = (Button) se.getSource(); - if (updating) - return; - updating = true; - execute(new ModifyPublishingCommand(httpServer, b.getSelection())); - updating = false; - } - }); - - initialize(); - } - - protected Label createLabel(FormToolkit toolkit, Composite parent, String text) { - Label label = toolkit.createLabel(parent, text); - label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); - return label; - } - - public void dispose() { - if (server != null) - server.removePropertyChangeListener(listener); - } - - /* - * (non-Javadoc) Initializes the editor part with a site and input. - */ - public void init(IEditorSite site, IEditorInput input) { - super.init(site, input); - - httpServer = (HttpServer) server.loadAdapter(HttpServer.class, null); - addChangeListener(); - initialize(); - } - - /** - * Initialize the fields in this editor. - */ - protected void initialize() { - if (urlPrefixText == null) - return; - updating = true; - - String urlPrefix = httpServer.getURLPrefix(); - if (urlPrefix != null) - urlPrefixText.setText(urlPrefix); - urlPrefixText.setEnabled(!readOnly); - - portSpinner.setSelection(httpServer.getPort()); - portSpinner.setEnabled(!readOnly); - - publishCheckBox.setSelection(httpServer.isPublishing()); - publishCheckBox.setEnabled(!readOnly); - updating = false; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpServerComposite.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpServerComposite.java deleted file mode 100644 index ef7e127b2..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpServerComposite.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -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.Spinner; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.server.core.IServerWorkingCopy; -import org.eclipse.wst.server.http.core.internal.HttpServer; -import org.eclipse.wst.server.ui.wizard.IWizardHandle; -/** - * Wizard page to set the server properties. - */ -public class HttpServerComposite extends Composite { - protected IServerWorkingCopy serverWC; - protected HttpServer server; - protected Text prefix; - protected Spinner port; - protected Button publishCheckBox; - protected IWizardHandle wizard; - - /** - * HttpServerComposite - * - * @param parent the parent composite - * @param wizard the wizard handle - */ - public HttpServerComposite(Composite parent, IWizardHandle wizard) { - super(parent, SWT.NONE); - this.wizard = wizard; - wizard.setTitle(Messages.wizardTitle); - wizard.setDescription(Messages.wizardDescription); - wizard.setImageDescriptor(HttpUIPlugin.getImageDescriptor(HttpUIPlugin.IMG_WIZ_SERVER)); - - createControl(); - } - - protected void setServer(IServerWorkingCopy newServer) { - if (newServer == null) { - serverWC = null; - server = null; - } else { - serverWC = newServer; - server = (HttpServer) newServer.loadAdapter(HttpServer.class, null); - } - - if (!isDisposed()) - init(); - validate(); - } - - /** - * Provide a wizard page to change the Apache installation directory. - */ - protected void createControl() { - GridLayout layout = new GridLayout(); - setLayout(layout); - setLayoutData(new GridData(GridData.FILL_BOTH)); - - Composite comp = new Composite(this, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - comp.setLayout(layout); - comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.RUNTIME_COMPOSITE); - - createServerInfoGroup(comp); - - Font font = comp.getFont(); - publishCheckBox = new Button(comp, SWT.CHECK); - publishCheckBox.setText(Messages.shouldPublish); - publishCheckBox.setFont(font); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 2; - publishCheckBox.setLayoutData(data); - - publishCheckBox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent se) { - Button b = (Button) se.getSource(); - server.setPublishing(b.getSelection()); - validate(); - } - }); - - init(); - validate(); - - Dialog.applyDialogFont(this); - - port.forceFocus(); - } - - protected void init() { - if (port == null || serverWC == null || server == null) - return; - - port.setSelection(server.getPort()); - prefix.setText(server.getURLPrefix()); - - boolean canPublish = server.isPublishing(); - publishCheckBox.setSelection(canPublish); - } - - protected void validate() { - /*if (server == null) { - wizard.setMessage("", IMessageProvider.ERROR); - return; - } - - wizard.setMessage(null, IMessageProvider.NONE);*/ - } - - private void createServerInfoGroup(Composite parent) { - Font font = parent.getFont(); - - // port label - Label portLabel = new Label(parent, SWT.NONE); - portLabel.setFont(font); - portLabel.setText(Messages.port); - - // port entry field - port = new Spinner(parent, SWT.BORDER); - port.setMinimum(0); - port.setMaximum(999999); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = 305; - port.setLayoutData(data); - port.setFont(font); - port.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (server != null) - try { - server.setPort(port.getSelection()); - } catch (Exception ex) { - // ignore - } - validate(); - } - }); - - // prefix label - Label prefixLabel = new Label(parent, SWT.NONE); - prefixLabel.setFont(font); - prefixLabel.setText(Messages.URLPrefix); - - // prefix entry field - prefix = new Text(parent, SWT.BORDER); - data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = 305; - prefix.setLayoutData(data); - prefix.setFont(font); - prefix.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - server.setURLPrefix(prefix.getText()); - validate(); - } - }); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpServerWizardFragment.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpServerWizardFragment.java deleted file mode 100644 index dea121069..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpServerWizardFragment.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.wst.server.core.IServerWorkingCopy; -import org.eclipse.wst.server.core.TaskModel; -import org.eclipse.wst.server.ui.wizard.IWizardHandle; -import org.eclipse.wst.server.ui.wizard.WizardFragment; -/** - * HTTP server wizard fragment. - */ -public class HttpServerWizardFragment extends WizardFragment { - protected HttpServerComposite comp; - - /** - * ServerWizardFragment constructor - */ - public HttpServerWizardFragment() { - setComplete(true); - } - - public boolean hasComposite() { - return true; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.server.ui.task.WizardFragment#createComposite() - */ - public Composite createComposite(Composite parent, IWizardHandle wizard) { - comp = new HttpServerComposite(parent, wizard); - return comp; - } - - /* - * @see org.eclipse.wst.server.ui.wizard.WizardFragment#enter() - */ - public void enter() { - if (comp != null) { - IServerWorkingCopy runtime = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER); - comp.setServer(runtime); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpUIPlugin.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpUIPlugin.java deleted file mode 100644 index 0d9a794aa..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpUIPlugin.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -/** - * The activator class controls the plug-in life cycle - */ -public class HttpUIPlugin extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.wst.server.http.ui"; - - private Map imageDescriptors = new HashMap(); - - // base url for icons - private static URL ICON_BASE_URL; - private static final String URL_WIZBAN = "wizban/"; - public static final String IMG_WIZ_SERVER = "wizServer"; - - // The shared instance - private static HttpUIPlugin plugin; - - /** - * The constructor - */ - public HttpUIPlugin() { - plugin = this; - } - - /** - * Returns the singleton instance of this plugin. - * - * @return HttpUIPlugin - */ - public static HttpUIPlugin getInstance() { - return plugin; - } - - protected ImageRegistry createImageRegistry() { - ImageRegistry registry = new ImageRegistry(); - registerImage(registry, IMG_WIZ_SERVER, URL_WIZBAN + "server_wiz.gif"); - - return registry; - } - - /** - * Return the image with the given key from the image registry. - * - * @param key java.lang.String - * @return org.eclipse.jface.parts.IImage - */ - public static Image getImage(String key) { - return getInstance().getImageRegistry().get(key); - } - - /** - * Return the image with the given key from the image registry. - * - * @param key java.lang.String - * @return org.eclipse.jface.parts.IImage - */ - public static ImageDescriptor getImageDescriptor(String key) { - try { - getInstance().getImageRegistry(); - return (ImageDescriptor) getInstance().imageDescriptors.get(key); - } catch (Exception e) { - return null; - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Register an image with the registry. - * - * @param key java.lang.String - * @param partialURL java.lang.String - */ - private void registerImage(ImageRegistry registry, String key, String partialURL) { - if (ICON_BASE_URL == null) { - String pathSuffix = "icons/"; - ICON_BASE_URL = plugin.getBundle().getEntry(pathSuffix); - } - - try { - ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, - partialURL)); - registry.put(key, id); - imageDescriptors.put(key, id); - } catch (Exception e) { - Trace.trace(Trace.WARNING, "Error registering image", e); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.java deleted file mode 100644 index f005018bf..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import org.eclipse.osgi.util.NLS; -/** - * Translated messages. - */ -public class Messages extends NLS { - public static String browse; - public static String runtimeName; - public static String port; - public static String URLPrefix; - public static String shouldPublish; - public static String publishDir; - public static String selectInstallDir; - public static String wizardDescription; - public static String wizardDuplicateName; - public static String wizardMissingRuntimeName; - public static String wizardTitle; - public static String editorSectionTitle; - public static String editorSectionDescription; - public static String editorURLPrefix; - public static String editorPort; - public static String editorShouldPublish; - - static { - NLS.initializeMessages(HttpUIPlugin.PLUGIN_ID + ".internal.Messages", Messages.class); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.properties deleted file mode 100644 index 61267caa6..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.properties +++ /dev/null @@ -1,31 +0,0 @@ -############################################################################### -# Copyright (c) 2007 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -runtimeName=Na&me: -browse=B&rowse... -port=HTTP &Port: -URLPrefix=&URL Prefix: -publishDir=Publishing &Directory: -shouldPublish=Enable p&ublishing to this server - -selectInstallDir=Select HTTP server document root. - -# Apache server wizard and editor -wizardTitle=HTTP Server -wizardDescription=Specify the HTTP server information -wizardDuplicateName=Duplicate Server Name -wizardMissingRuntimeName=Missing Runtime Name - -editorSectionTitle=HTTP Server -editorSectionDescription=Specify publishing directory and URL. -editorURLPrefix=URL Prefix: -editorPort=HTTP Port: -editorShouldPublish=Enable publishing to this server
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/RuntimeLabelProvider.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/RuntimeLabelProvider.java deleted file mode 100644 index 50af50866..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/RuntimeLabelProvider.java +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2005 BEA Systems, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Konstantin Komissarchik - initial API and implementation - * IBM Corporation - Support for all server types - ******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent; -import org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider; -/** - * - */ -public final class RuntimeLabelProvider implements IRuntimeComponentLabelProvider { - private final IRuntimeComponent rc; - - public RuntimeLabelProvider(final IRuntimeComponent rc) { - this.rc = rc; - } - - public String getLabel() { - return rc.getProperty("type"); - } - - public static final class Factory implements IAdapterFactory { - private static final Class[] ADAPTER_TYPES = { IRuntimeComponentLabelProvider.class }; - - public Object getAdapter(final Object adaptable, final Class adapterType) { - final IRuntimeComponent rc = (IRuntimeComponent) adaptable; - return new RuntimeLabelProvider(rc); - } - - public Class[] getAdapterList() { - return ADAPTER_TYPES; - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java deleted file mode 100644 index d0a557c01..000000000 --- a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.server.http.ui.internal; -/** - * Helper class to route trace output. - */ -public class Trace { - public static byte CONFIG = 0; - public static byte WARNING = 1; - public static byte SEVERE = 2; - public static byte FINEST = 3; - public static byte FINER = 4; - - /** - * Trace constructor comment. - */ - private Trace() { - super(); - } - - /** - * Trace the given text. - * - * @param level the trace level - * @param s a message - */ - public static void trace(byte level, String s) { - Trace.trace(level, s, null); - } - - /** - * Trace the given message and exception. - * - * @param level the trace level - * @param s a message - * @param t a throwable - */ - public static void trace(byte level, String s, Throwable t) { - if (!HttpUIPlugin.getInstance().isDebugging()) - return; - - System.out.println(HttpUIPlugin.PLUGIN_ID + " " + s); - if (t != null) - t.printStackTrace(); - } -}
\ No newline at end of file |