Commit 6bfc3b62 authored by Guillaume Surrel's avatar Guillaume Surrel

Initial commit of Joram designer deployment plug-in, based on FDF Deployware.

parent 94322d74
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="lib/apollon-runtime-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/asm-3.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/bsh-2.0b4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commandline-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-net-1.4.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/docbook-xsl-1.72.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/dtdparser-1.21.jar"/>
<classpathentry exported="true" kind="lib" path="lib/dumper-0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/explorer-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/explorer-reflector-plugin-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fdf-core-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/FDF-FDF-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fdf-fraclet-plugins-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fdf-fractal-adl-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/FDF-HTTP-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/FDF-JAVA-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/FDF-JORAM.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fdf-launcher-2.2-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fractal-api-2.0.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fractal-explorer-1.1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/fractal-rmi-0.3.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jdom-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jgraph-5.8.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jonathan-3.0.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jsch-0.1.29.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jtelnet-1.0.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/julia-asm-2.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/julia-mixins-2.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/julia-runtime-2.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-1.2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/monolog-2.1.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/oro-2.0.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ow-misc-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ow-trace-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/truezip-6.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.3.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis-1.0.b2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.ow2.joram.design.deploy</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>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.ow2.joram.design.deploy; singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.ui,
org.eclipse.emf.ecore.xmi,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.ow2.joram.design,
org.eclipse.ui.console,
org.eclipse.ui.ide
Bundle-Vendor: %providerName
Bundle-ClassPath: .,
lib/apollon-runtime-1.0.jar,
lib/asm-3.0.jar,
lib/bsh-2.0b4.jar,
lib/commandline-1.0.jar,
lib/commons-net-1.4.1.jar,
lib/docbook-xsl-1.72.0.jar,
lib/dtdparser-1.21.jar,
lib/dumper-0.1.jar,
lib/explorer-1.0.jar,
lib/explorer-reflector-plugin-1.0.jar,
lib/fdf-core-2.2-SNAPSHOT.jar,
lib/FDF-FDF-2.2-SNAPSHOT.jar,
lib/fdf-fraclet-plugins-2.2-SNAPSHOT.jar,
lib/fdf-fractal-adl-2.2-SNAPSHOT.jar,
lib/FDF-HTTP-2.2-SNAPSHOT.jar,
lib/FDF-JAVA-2.2-SNAPSHOT.jar,
lib/FDF-JORAM.jar,
lib/fdf-launcher-2.2-SNAPSHOT.jar,
lib/fractal-api-2.0.2.jar,
lib/fractal-explorer-1.1.2.jar,
lib/fractal-rmi-0.3.5.jar,
lib/jdom-1.0.jar,
lib/jgraph-5.8.3.1.jar,
lib/jonathan-3.0.10.jar,
lib/jsch-0.1.29.jar,
lib/jtelnet-1.0.0.jar,
lib/julia-asm-2.5.2.jar,
lib/julia-mixins-2.5.2.jar,
lib/julia-runtime-2.5.2.jar,
lib/log4j-1.2.13.jar,
lib/monolog-2.1.8.jar,
lib/oro-2.0.8.jar,
lib/ow-misc-1.0.jar,
lib/ow-trace-1.0.jar,
lib/truezip-6.6.jar,
lib/wsdl4j-1.6.1.jar,
lib/xalan-2.7.0.jar,
lib/xercesImpl-2.3.0.jar,
lib/xml-apis-1.0.b2.jar
Bundle-Activator: org.ow2.joram.design.deploy.JoramDeployPlugin
Bundle-ActivationPolicy: lazy
# Copyright (C) 2010 ScalAgent Distributed Technologies
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Initial developer(s): ScalAgent Distributed Technologies
# Contributor(s):
output.. = bin/
source.. = src/
bin.includes = plugin.xml,\
META-INF/,\
.,\
plugin.properties,\
lib/,\
lib/apollon-runtime-1.0.jar,\
lib/asm-3.0.jar,\
lib/bsh-2.0b4.jar,\
lib/commandline-1.0.jar,\
lib/commons-net-1.4.1.jar,\
lib/docbook-xsl-1.72.0.jar,\
lib/dtdparser-1.21.jar,\
lib/dumper-0.1.jar,\
lib/explorer-1.0.jar,\
lib/explorer-reflector-plugin-1.0.jar,\
lib/fdf-core-2.2-SNAPSHOT.jar,\
lib/FDF-FDF-2.2-SNAPSHOT.jar,\
lib/fdf-fraclet-plugins-2.2-SNAPSHOT.jar,\
lib/fdf-fractal-adl-2.2-SNAPSHOT.jar,\
lib/FDF-HTTP-2.2-SNAPSHOT.jar,\
lib/FDF-JAVA-2.2-SNAPSHOT.jar,\
lib/FDF-JORAM.jar,\
lib/fdf-launcher-2.2-SNAPSHOT.jar,\
lib/fractal-api-2.0.2.jar,\
lib/fractal-explorer-1.1.2.jar,\
lib/fractal-rmi-0.3.5.jar,\
lib/jdom-1.0.jar,\
lib/jgraph-5.8.3.1.jar,\
lib/jonathan-3.0.10.jar,\
lib/jsch-0.1.29.jar,\
lib/jtelnet-1.0.0.jar,\
lib/julia-asm-2.5.2.jar,\
lib/julia-mixins-2.5.2.jar,\
lib/julia-runtime-2.5.2.jar,\
lib/log4j-1.2.13.jar,\
lib/monolog-2.1.8.jar,\
lib/oro-2.0.8.jar,\
lib/ow-misc-1.0.jar,\
lib/ow-trace-1.0.jar,\
lib/truezip-6.6.jar,\
lib/wsdl4j-1.6.1.jar,\
lib/xalan-2.7.0.jar,\
lib/xercesImpl-2.3.0.jar,\
lib/xml-apis-1.0.b2.jar
# Copyright (C) 2010 ScalAgent Distributed Technologies
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Initial developer(s): ScalAgent Distributed Technologies
# Contributor(s):
pluginName = Joram Designer Deployment
providerName = ScalAgent D.T.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<!--
Copyright (C) 2010 ScalAgent Distributed Technologies
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
Initial developer(s): ScalAgent Distributed Technologies
Contributor(s):
-->
<plugin>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
id="org.ow2.joram.design.deploy.contribution1"
nameFilter="*.joram"
objectClass="org.eclipse.core.resources.IFile">
<action
label="Deploy..."
class="org.ow2.joram.design.deploy.actions.DeployAction"
menubarPath="org.ow2.joram.design.menu/deploy"
enablesFor="1"
id="org.ow2.joram.design.deploy.DeployAction">
</action>
</objectContribution>
</extension>
</plugin>
/*
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.ow2.joram.design.deploy;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class JoramDeployPlugin extends AbstractUIPlugin {
public static final String ID = "org.ow2.joram.design.deploy";
private static JoramDeployPlugin plugin;
public JoramDeployPlugin() {
plugin = this;
}
public static JoramDeployPlugin getDefault() {
return plugin;
}
}
/*
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.ow2.joram.design.deploy.actions;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.ow2.joram.design.deploy.actions.wizard.DeployWizard;
import org.ow2.joram.design.model.joram.Config;
import org.ow2.joram.design.model.joram.JoramPackage;
public class DeployAction implements IObjectActionDelegate {
private Shell shell;
private ISelection selection;
public DeployAction() {
super();
}
/**
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
shell = targetPart.getSite().getShell();
}
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
if (selection instanceof TreeSelection) {
final TreeSelection tree = (TreeSelection) selection;
final Object o = tree.getFirstElement();
if (o instanceof IFile) {
try {
final IFile joramModelFile = (IFile) o;
final JoramPackage ePackage = JoramPackage.eINSTANCE;
// Create resource set and register your generated resource factory.
final ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getPackageRegistry().put(ePackage.getNsURI(), ePackage);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("joram",
new XMIResourceFactoryImpl());
final Resource resource = resourceSet.getResource(URI.createFileURI(joramModelFile.getLocationURI()
.getPath()), true);
final Config rootElement = (Config) resource.getContents().get(0);
WizardDialog wizard = new WizardDialog(shell, new DeployWizard(rootElement, tree));
wizard.setHelpAvailable(false);
wizard.setPageSize(300, 250);
wizard.open();
} catch (Exception e) {
MessageDialog.openError(shell, "Deploy Plug-in", "Deployment failed: "
+ e.getMessage());
e.printStackTrace();
}
}
}
}
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
this.selection = selection;
}
}
/*
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.ow2.joram.design.deploy.actions;
import java.io.PrintStream;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.objectweb.fdf.components.fdf.lib.runnable.Launcher;
import org.objectweb.fdf.util.printer.lib.io.PrintStreamPrinterFactory;
import org.ow2.joram.design.deploy.JoramDeployPlugin;
public class FdfJob extends Job {
public static final String INSTALL_ACTION = "install";
public static final String START_ACTION = "start";
public static final String STOP_ACTION = "stop";
public static final String UNINSTALL_ACTION = "uninstall";
private String action;
private String path;
public FdfJob(String path, String action) {
super("FDF deployment.");
this.path = path;
this.action = action;
}
protected IStatus run(IProgressMonitor monitor) {
System.setProperty("fractal.provider", "org.objectweb.fractal.julia.Julia");
System.setProperty("julia.config", "fdf-julia.cfg");
monitor.beginTask("Deploying configuration", IProgressMonitor.UNKNOWN);
MessageConsole console = findConsole("FDF");
console.activate();
PrintStreamPrinterFactory.printStream = new PrintStream(console.newOutputStream());
try {
String[] args = { "-fractal", Launcher.class.getName() + "(" + path + "," + action + ",,,,,)", "r" };
org.objectweb.fractal.adl.Launcher.main(args);
} catch (Exception exc) {
return new Status(IStatus.ERROR, JoramDeployPlugin.ID, exc.getMessage(), exc);
}
monitor.done();
return new Status(IStatus.OK, JoramDeployPlugin.ID, "");
}
private MessageConsole findConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++)
if (name.equals(existing[i].getName()))
return (MessageConsole) existing[i];
//no console found, so create a new one
MessageConsole myConsole = new MessageConsole(name, null);
conMan.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
}
/*
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.ow2.joram.design.deploy.actions.wizard;
import java.io.File;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.wizard.WizardPage;
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.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class DeployPreferencesWizardPage extends WizardPage {
private static final int SIZING_TEXT_FIELD_WIDTH = 250;
private static final char SEPARATOR = System.getProperty("file.separator").charAt(0);
private static final String LAST_SELECTED_RELEASE_PATH = "ReleasePath";
private static final String LAST_SELECTED_DEPLOY_PATH = "DeployPath";
private Text archivePathField;
private Button archiveBrowseButton;
private Text deployDirField;
protected DeployPreferencesWizardPage() {
super(DeployPreferencesWizardPage.class.getName(), "Deployment customization.", null);
setDescription("Select deployment preferences.");
}
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout gl = new GridLayout();
gl.numColumns = 2;
composite.setLayout(gl);
Label label = new Label(composite, SWT.NONE);
label.setText("Select joram archive release file:");
GridData data = new GridData(GridData.BEGINNING);
data.horizontalSpan = 2;
label.setLayoutData(data);
archivePathField = new Text(composite, SWT.BORDER);
data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
data.widthHint = SIZING_TEXT_FIELD_WIDTH;
archivePathField.setLayoutData(data);
archiveBrowseButton = new Button(composite, SWT.PUSH);
archiveBrowseButton.setText("Browse");
data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
archiveBrowseButton.setLayoutData(data);
createLine(composite, 2);
label = new Label(composite, SWT.NONE);
label.setText("Choose existing remote installation path:");
data = new GridData(GridData.BEGINNING);
data.horizontalSpan = 2;
label.setLayoutData(data);
deployDirField = new Text(composite, SWT.BORDER);
data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
data.horizontalSpan = 2;
deployDirField.setLayoutData(data);
// Add listeners
archivePathField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
getDialogSettings().put(LAST_SELECTED_RELEASE_PATH, archivePathField.getText());
validate();
}
});
archiveBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {