Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jst.server.pde/src/org')
-rw-r--r--plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/ServerPdePlugin.java63
-rw-r--r--plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerPluginNewWizard.java31
-rw-r--r--plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerTemplate.java285
-rw-r--r--plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/Messages.java44
-rw-r--r--plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/messages.properties19
5 files changed, 0 insertions, 442 deletions
diff --git a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/ServerPdePlugin.java b/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/ServerPdePlugin.java
deleted file mode 100644
index c1d8770c5..000000000
--- a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/ServerPdePlugin.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gorkem Ercan - initial API and implementation
- *
- **************************************************************************************************/
-package org.eclipse.jst.server.generic.pde;
-
-import org.eclipse.ui.plugin.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class ServerPdePlugin extends AbstractUIPlugin {
-
- //The shared instance.
- private static ServerPdePlugin plugin;
-
- /**
- * The constructor.
- */
- public ServerPdePlugin() {
- plugin = this;
- }
-
- /**
- * 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);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static ServerPdePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.jst.server.generic.pde", path);
- }
-}
diff --git a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerPluginNewWizard.java b/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerPluginNewWizard.java
deleted file mode 100644
index 0cda4ac06..000000000
--- a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerPluginNewWizard.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gorkem Ercan - initial API and implementation
- *
- **************************************************************************************************/
-package org.eclipse.jst.server.generic.pde.internal;
-
-
-import org.eclipse.pde.ui.IFieldData;
-import org.eclipse.pde.ui.templates.ITemplateSection;
-import org.eclipse.pde.ui.templates.NewPluginTemplateWizard;
-/**
- * New Generic server plug-in wizard.
- * @author Gorkem Ercan
- *
- */
-public class GenericServerPluginNewWizard extends NewPluginTemplateWizard {
-
- public ITemplateSection[] createTemplateSections(){
- return new ITemplateSection[] {new GenericServerTemplate()};
- }
-
- public void init(IFieldData data) {
- super.init(data);
- setWindowTitle(Messages.windowTitleWizard);
- }
-}
diff --git a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerTemplate.java b/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerTemplate.java
deleted file mode 100644
index 922ac38ec..000000000
--- a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/GenericServerTemplate.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gorkem Ercan - initial API and implementation
- *
- **************************************************************************************************/
-package org.eclipse.jst.server.generic.pde.internal;
-
-import java.net.URL;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.server.generic.pde.ServerPdePlugin;
-import org.eclipse.pde.core.plugin.IPluginBase;
-import org.eclipse.pde.core.plugin.IPluginElement;
-import org.eclipse.pde.core.plugin.IPluginExtension;
-import org.eclipse.pde.core.plugin.IPluginModelFactory;
-import org.eclipse.pde.core.plugin.IPluginReference;
-import org.eclipse.pde.internal.ui.wizards.templates.PluginReference;
-import org.eclipse.pde.ui.templates.OptionTemplateSection;
-import org.eclipse.pde.ui.templates.TemplateOption;
-/**
- * Simple generic server plug-in template
- *
- * @author Gorkem Ercan
- *
- */
-public class GenericServerTemplate extends OptionTemplateSection {
-
- private static final String KEY_SERVER_VERSION = "server_version"; //$NON-NLS-1$
- private static final String KEY_SERVER_START_BEFORE_PUBLISH = "server_start_before_publish"; //$NON-NLS-1$
- private static final String KEY_SERVER_LAUNCHTYPE = "server_launchtype"; //$NON-NLS-1$
- private static final String KEY_SERVER_VENDOR = "server_vendor"; //$NON-NLS-1$
- private static final String KEY_SERVER_DESCRIPTION = "server_description"; //$NON-NLS-1$
- private static final String KEY_SERVER_NAME = "server_name"; //$NON-NLS-1$
- private static final String[][] launchOpts = {{"java",Messages.labelJavaLaunchConfiguration},{"external",Messages.labelExternalLaunchConfiguration}}; //$NON-NLS-1$ //$NON-NLS-3$
-
- private TemplateOption fServerNameOption;
- private TemplateOption fServerDescriptionOption;
- private TemplateOption fServerVendorOption;
- private TemplateOption fServerVersionOption;
- private TemplateOption fLaunchTypeOption;
- private TemplateOption fStartBeforPublishOption;
-
- public GenericServerTemplate() {
- setPageCount(1);
- createOptions();
- }
-
-
- private void createOptions(){
-
- fServerNameOption= addOption(KEY_SERVER_NAME,Messages.labelServerName,"your server's name",0); //$NON-NLS-2$
- fServerDescriptionOption = addOption(KEY_SERVER_DESCRIPTION,"Description","User description of your server",0); //$NON-NLS-1$ //$NON-NLS-2$
- fServerVendorOption= addOption(KEY_SERVER_VENDOR,Messages.labelServerVendor,"Server vendor' s name",0); //$NON-NLS-2$
- fServerVersionOption= addOption(KEY_SERVER_VERSION,Messages.labelServerVesion,"0",0); //$NON-NLS-2$
- fLaunchTypeOption= addOption(KEY_SERVER_LAUNCHTYPE,Messages.labelLaunchType,launchOpts,"java",0); //$NON-NLS-2$
- fStartBeforPublishOption= addOption(KEY_SERVER_START_BEFORE_PUBLISH,Messages.labelStartBeforePublish,false,0);
-
- fServerNameOption.setRequired(true);
- fServerDescriptionOption.setRequired(true);
- fServerVendorOption.setRequired(true);
- fServerVersionOption.setRequired(true);
- }
-
- public String getSectionId() {
- return "genericserver"; //$NON-NLS-1$
- }
-
- protected void updateModel(IProgressMonitor monitor) throws CoreException{
- IPluginBase plugin = model.getPluginBase();
- IPluginModelFactory factory = model.getPluginFactory();
- addRuntimeType(plugin, factory);
- addServerType(plugin, factory);
- addWizardFragment(plugin, factory);
- addServerImage(plugin, factory);
- addRuntimeTargetHandler(plugin, factory);
- addServerDefinition(plugin, factory);
- }
-
- private void addServerDefinition(IPluginBase plugin, IPluginModelFactory factory) throws CoreException {
- IPluginExtension definitionExtension = createExtension("org.eclipse.jst.server.generic.core.serverdefinition",true); //$NON-NLS-1$
- IPluginElement serverDef = factory.createElement(definitionExtension);
- serverDef.setName("serverdefinition"); //$NON-NLS-1$
- serverDef.setAttribute("id",getRuntimeId()); //$NON-NLS-1$
- serverDef.setAttribute("definitionfile","/servers/"+getStringOption(KEY_SERVER_NAME)+".serverdef"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- definitionExtension.add(serverDef);
- if(!definitionExtension.isInTheModel())
- plugin.add(definitionExtension);
- }
-
-
- private void addRuntimeTargetHandler(IPluginBase plugin, IPluginModelFactory factory) throws CoreException {
- IPluginExtension handlerExtension = createExtension("org.eclipse.wst.server.core.runtimeTargetHandlers",true); //$NON-NLS-1$
- IPluginElement handler= factory.createElement(handlerExtension);
- handler.setName("runtimeTargetHandler"); //$NON-NLS-1$
- handler.setAttribute("id",getNamespace()+".runtimeTarget"); //$NON-NLS-1$ //$NON-NLS-2$
- handler.setAttribute("runtimeTypeIds",getRuntimeId()); //$NON-NLS-1$
- handler.setAttribute("class","org.eclipse.jst.server.generic.core.internal.GenericServerRuntimeTargetHandler"); //$NON-NLS-1$ //$NON-NLS-2$
- handlerExtension.add(handler);
- if(!handlerExtension.isInTheModel())
- plugin.add(handlerExtension);
- }
-
-
- private void addServerImage(IPluginBase plugin, IPluginModelFactory factory) throws CoreException {
- IPluginExtension imageExtension = createExtension("org.eclipse.wst.server.ui.serverImages",true); //$NON-NLS-1$
- IPluginElement serverImage = factory.createElement(imageExtension);
- serverImage.setName("image"); //$NON-NLS-1$
- serverImage.setAttribute("id",getNamespace()+".serverImage"); //$NON-NLS-1$ //$NON-NLS-2$
- serverImage.setAttribute("icon","icons/server.gif"); //$NON-NLS-1$ //$NON-NLS-2$
- serverImage.setAttribute("typeIds",getServerId()); //$NON-NLS-1$
- imageExtension.add(serverImage);
-
- IPluginElement runtimeImage = factory.createElement(imageExtension);
- runtimeImage.setName("image"); //$NON-NLS-1$
- runtimeImage.setAttribute("id",getNamespace()+".runtimeImage"); //$NON-NLS-1$ //$NON-NLS-2$
- runtimeImage.setAttribute("icon","icons/server.gif"); //$NON-NLS-1$ //$NON-NLS-2$
- runtimeImage.setAttribute("typeIds",getRuntimeId()); //$NON-NLS-1$
- imageExtension.add(runtimeImage);
- if(!imageExtension.isInTheModel())
- plugin.add(imageExtension);
- }
-
-
- private void addWizardFragment(IPluginBase plugin, IPluginModelFactory factory) throws CoreException {
- IPluginExtension wizardExtension = createExtension("org.eclipse.wst.server.ui.wizardFragments",true); //$NON-NLS-1$
- IPluginElement runtimeWiz = factory.createElement(wizardExtension);
- runtimeWiz.setName("fragment"); //$NON-NLS-1$
- runtimeWiz.setAttribute("id",getNamespace()+".runtimeWizard"); //$NON-NLS-1$ //$NON-NLS-2$
- runtimeWiz.setAttribute("class","org.eclipse.jst.server.generic.ui.internal.GenericServerRuntimeWizardFragment"); //$NON-NLS-1$ //$NON-NLS-2$
- runtimeWiz.setAttribute("typeIds",getRuntimeId()); //$NON-NLS-1$
- wizardExtension.add(runtimeWiz);
- if(!wizardExtension.isInTheModel())
- plugin.add(wizardExtension);
-
- IPluginElement serverWiz = factory.createElement(wizardExtension);
- serverWiz.setName("fragment"); //$NON-NLS-1$
- serverWiz.setAttribute("id",getNamespace()+".serverWizard"); //$NON-NLS-1$ //$NON-NLS-2$
- serverWiz.setAttribute("class","org.eclipse.jst.server.generic.ui.internal.GenericServerWizardFragment"); //$NON-NLS-1$ //$NON-NLS-2$
- serverWiz.setAttribute("typeIds",getServerId()); //$NON-NLS-1$
- wizardExtension.add(serverWiz);
- }
-
-
- private void addServerType(IPluginBase plugin, IPluginModelFactory factory) throws CoreException {
- IPluginExtension serverExtension =createExtension("org.eclipse.wst.server.core.serverTypes",true); //$NON-NLS-1$
- IPluginElement serverType = factory.createElement(serverExtension);
- serverType.setName("serverType"); //$NON-NLS-1$
- serverType.setAttribute("runtime","true"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("class","org.eclipse.jst.server.generic.core.internal.GenericServer"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("id",getServerId()); //$NON-NLS-1$
- serverType.setAttribute("initialState","stopped"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("supportsRemoteHosts","false"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("runtimeTypeId",getRuntimeId()); //$NON-NLS-1$
- serverType.setAttribute("description",getStringOption(KEY_SERVER_DESCRIPTION)); //$NON-NLS-1$
- serverType.setAttribute("launchConfigId",getSelectedConfigType()); //$NON-NLS-1$
- serverType.setAttribute("behaviourClass",getSelectedBehaviourClass()); //$NON-NLS-1$
- serverType.setAttribute("name",getStringOption(KEY_SERVER_NAME)); //$NON-NLS-1$
- serverType.setAttribute("startTimeout","75000"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("stopTimeout","30000"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("hasConfiguration","false"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("launchModes","run,debug"); //$NON-NLS-1$ //$NON-NLS-2$
- serverType.setAttribute("startBeforePublish", Boolean.toString(getBooleanOption(KEY_SERVER_START_BEFORE_PUBLISH))); //$NON-NLS-1$
- serverExtension.add(serverType);
- if(!serverExtension.isInTheModel())
- plugin.add(serverExtension);
- }
-
-
- private void addRuntimeType(IPluginBase plugin, IPluginModelFactory factory) throws CoreException {
- IPluginExtension extension =createExtension("org.eclipse.wst.server.core.runtimeTypes",true); //$NON-NLS-1$
- IPluginElement runtimeType = factory.createElement(extension);
- runtimeType.setName("runtimeType"); //$NON-NLS-1$
- runtimeType.setAttribute("id",getRuntimeId()); //$NON-NLS-1$
- runtimeType.setAttribute("name",getStringOption(KEY_SERVER_NAME)); //$NON-NLS-1$
- runtimeType.setAttribute("description",getStringOption(KEY_SERVER_DESCRIPTION)); //$NON-NLS-1$
- runtimeType.setAttribute("vendor",getStringOption(KEY_SERVER_VENDOR)); //$NON-NLS-1$
- runtimeType.setAttribute("version",getStringOption(KEY_SERVER_VERSION)); //$NON-NLS-1$
- runtimeType.setAttribute("class","org.eclipse.jst.server.generic.core.internal.GenericServerRuntime"); //$NON-NLS-1$ //$NON-NLS-2$
-
- IPluginElement moduleType = factory.createElement(runtimeType);
- moduleType.setName("moduleType"); //$NON-NLS-1$
- moduleType.setAttribute("types","jst.web"); //$NON-NLS-1$ //$NON-NLS-2$
- moduleType.setAttribute("versions","1.2, 1.3"); //$NON-NLS-1$ //$NON-NLS-2$
- runtimeType.add(moduleType);
-
- extension.add(runtimeType);
- if(!extension.isInTheModel())
- plugin.add(extension);
- }
-
- private String getRuntimeId(){
- return getNamespace()+".runtime"; //$NON-NLS-1$
- }
-
- private String getServerId(){
- return getNamespace()+".server"; //$NON-NLS-1$
- }
- private String getNamespace()
- {
- return model.getPluginBase().getId();
- }
- private String getSelectedBehaviourClass() {
- if(isExternalSelected())
- return "org.eclipse.jst.server.generic.core.internal.ExternalServerBehaviour"; //$NON-NLS-1$
- return "org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour"; //$NON-NLS-1$
- }
-
- private boolean isExternalSelected(){
- String selectedType = getStringOption(KEY_SERVER_LAUNCHTYPE);
- return "external".equals(selectedType); //$NON-NLS-1$
- }
-
- private String getSelectedConfigType(){
- if(isExternalSelected())
- return "org.eclipse.jst.server.generic.core.ExternalLaunchConfigurationType"; //$NON-NLS-1$
- return "org.eclipse.jst.server.generic.core.launchConfigurationType"; //$NON-NLS-1$
- }
-
- protected ResourceBundle getPluginResourceBundle(){
- return null;
- }
-
- public String[] getNewFiles(){
- return new String[]{"icons/", "server/","buildfiles/"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public String getUsedExtensionPoint(){
- return null;
- }
-
- public void validateOptions(TemplateOption changed){
- if(changed.isRequired() && changed.isEmpty()){
- flagMissingRequiredOption(changed);
- return;
- }
- TemplateOption[] options = getOptions(0);
- for (int i = 0; i < options.length; i++) {
- if(options[i].isRequired() && options[i].isEmpty()){
- flagMissingRequiredOption(options[i]);
- return;
- }
- }
- resetPageState();
- }
-
-
-
- public void addPages(Wizard wizard) {
- WizardPage page = createPage(0);
- page.setTitle(Messages.pageTitle);
- page.setDescription(Messages.pageDescription);
- wizard.addPage(page);
- markPagesAdded();
- }
-
-
-
- protected URL getInstallURL() {
- return ServerPdePlugin.getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#getDependencies(java.lang.String)
- */
- public IPluginReference[] getDependencies(String schemaVersion) {
- IPluginReference[] dep = new IPluginReference[4];
- dep[0] = new PluginReference("org.eclipse.core.runtime", null, 0); //$NON-NLS-1$
- dep[1] = new PluginReference("org.eclipse.ui", null, 0); //$NON-NLS-1$
- dep[2] = new PluginReference("org.eclipse.jst.server.generic.core", null, 0); //$NON-NLS-1$
- dep[3] = new PluginReference("org.eclipse.jst.server.generic.ui", null, 0); //$NON-NLS-1$
- return dep;
- }
-
- public Object getValue(String variable) {
- return super.getValue(variable);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/Messages.java b/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/Messages.java
deleted file mode 100644
index 2f357ead8..000000000
--- a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/Messages.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gorkem Ercan - initial API and implementation
- *
- **************************************************************************************************/
-package org.eclipse.jst.server.generic.pde.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.server.generic.pde.internal.messages"; //$NON-NLS-1$
-
- private Messages() {
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String labelJavaLaunchConfiguration;
-
- public static String labelExternalLaunchConfiguration;
-
- public static String labelServerName;
-
- public static String labelServerVendor;
-
- public static String labelServerVesion;
-
- public static String labelLaunchType;
-
- public static String labelStartBeforePublish;
-
- public static String pageTitle;
-
- public static String pageDescription;
-
- public static String windowTitleWizard;
-}
diff --git a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/messages.properties b/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/messages.properties
deleted file mode 100644
index 5890ce9d0..000000000
--- a/plugins/org.eclipse.jst.server.pde/src/org/eclipse/jst/server/generic/pde/internal/messages.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-##################################################################################################
-# Copyright (c) 2005 Eteration A.S. and Gorkem Ercan. All rights reserved. This program and the
-# accompanying materials are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors: Gorkem Ercan - initial API and implementation
-#
-###################################################################################################
-labelJavaLaunchConfiguration=Java launch cofiguration
-labelExternalLaunchConfiguration=External launch configuration
-labelServerName=Server Name
-labelServerVendor=Server Vendor
-labelServerVesion=Server Version
-labelLaunchType=Launch type
-labelStartBeforePublish=Start Before publish
-pageTitle=Generic Server Plug-in
-pageDescription=Create a new Generic server plug-in
-windowTitleWizard=New Generic Server plug-in

Back to the top