You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:48:28 UTC

[09/50] [abbrv] incubator-taverna-workbench-common-activities git commit: taverna-beanshell-activity-ui/

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellActivityViewFactory.java
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellActivityViewFactory.java b/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellActivityViewFactory.java
new file mode 100644
index 0000000..5c83730
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellActivityViewFactory.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 (at your option) any later version.
+ *
+ *  This program 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 program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.beanshell.views;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.configuration.colour.ColourManager;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.file.FileManager;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.ContextualView;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+public class BeanshellActivityViewFactory implements ContextualViewFactory<Activity> {
+
+	private static final URI ACTIVITY_TYPE = URI
+			.create("http://ns.taverna.org.uk/2010/activity/beanshell");
+
+	private EditManager editManager;
+	private FileManager fileManager;
+	private ActivityIconManager activityIconManager;
+	private ColourManager colourManager;
+	private ServiceDescriptionRegistry serviceDescriptionRegistry;
+
+	private ApplicationConfiguration applicationConfiguration;
+
+	public boolean canHandle(Object object) {
+		return object instanceof Activity && ((Activity) object).getType().equals(ACTIVITY_TYPE);
+	}
+
+	public List<ContextualView> getViews(Activity activity) {
+		return Arrays.asList(new ContextualView[] { new BeanshellContextualView(activity,
+				editManager, fileManager, activityIconManager, colourManager,
+				serviceDescriptionRegistry, applicationConfiguration) });
+	}
+
+	public void setEditManager(EditManager editManager) {
+		this.editManager = editManager;
+	}
+
+	public void setFileManager(FileManager fileManager) {
+		this.fileManager = fileManager;
+	}
+
+	public void setActivityIconManager(ActivityIconManager activityIconManager) {
+		this.activityIconManager = activityIconManager;
+	}
+
+	public void setColourManager(ColourManager colourManager) {
+		this.colourManager = colourManager;
+	}
+
+	public void setServiceDescriptionRegistry(ServiceDescriptionRegistry serviceDescriptionRegistry) {
+		this.serviceDescriptionRegistry = serviceDescriptionRegistry;
+	}
+
+	public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
+		this.applicationConfiguration = applicationConfiguration;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellConfigurationPanel.java
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellConfigurationPanel.java b/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellConfigurationPanel.java
new file mode 100644
index 0000000..8489d7a
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellConfigurationPanel.java
@@ -0,0 +1,231 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 (at your option) any later version.
+ *
+ *  This program 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 program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.beanshell.views;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import net.sf.taverna.t2.lang.ui.EditorKeySetUtil;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityPortConfiguration;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.DependencyConfigurationPanel;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ListConfigurationComponent;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.MultiPageActivityConfigurationPanel;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ScriptConfigurationComponent;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ValidatingTextField;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ValidatingTextGroup;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.port.InputActivityPort;
+import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+
+/**
+ * Component for configuring a Beanshell activity.
+ *
+ * @author David Withers
+ */
+@SuppressWarnings("serial")
+public class BeanshellConfigurationPanel extends MultiPageActivityConfigurationPanel {
+
+	private ScriptConfigurationComponent scriptConfigurationComponent;
+	private ValidatingTextGroup inputTextGroup, outputTextGroup;
+	private DependencyConfigurationPanel dependencyConfigurationPanel;
+	private File libDir;
+
+	public BeanshellConfigurationPanel(Activity activity,
+			ApplicationConfiguration applicationConfiguration) {
+		super(activity);
+		libDir = new File(applicationConfiguration.getApplicationHomeDir(), "lib");
+		if (!libDir.exists()) {
+			libDir.mkdir();
+		}
+		initialise();
+	}
+
+	@Override
+	protected void initialise() {
+		super.initialise();
+		removeAllPages();
+		addPage("Script", createScriptEditPanel());
+		addPage("Input ports", createInputPanel());
+		addPage("Output ports", createOutputPanel());
+		addPage("Dependencies", createDependenciesPanel());
+		setPreferredSize(new Dimension(600, 500));
+	}
+
+	@Override
+	public void noteConfiguration() {
+		setProperty("script", scriptConfigurationComponent.getScript());
+		setProperty("classLoaderSharing", dependencyConfigurationPanel.getClassLoaderSharing());
+		List<String> localDependencies = dependencyConfigurationPanel.getLocalDependencies();
+		if (localDependencies == null || localDependencies.isEmpty()) {
+			getJson().remove("localDependency");
+		} else {
+			ArrayNode localDependenciesArray = getJson().arrayNode();
+			for (String localDependency : localDependencies) {
+				localDependenciesArray.add(localDependency);
+			}
+			getJson().put("localDependency", localDependenciesArray);
+		}
+	}
+
+	@Override
+	public boolean checkValues() {
+		return true;
+	}
+
+	private Component createScriptEditPanel() {
+		Set<String> keywords = EditorKeySetUtil.loadKeySet(getClass().getResourceAsStream(
+				"keys.txt"));
+		Set<String> ports = new HashSet<>();
+		for (InputActivityPort ip : getActivity().getInputPorts()) {
+			ports.add(ip.getName());
+		}
+		for (OutputActivityPort op : getActivity().getOutputPorts()) {
+			ports.add(op.getName());
+		}
+		scriptConfigurationComponent = new ScriptConfigurationComponent(getProperty("script"),
+				keywords, ports, "Beanshell", ".bsh");
+		return scriptConfigurationComponent;
+	}
+
+	private Component createInputPanel() {
+		inputTextGroup = new ValidatingTextGroup();
+		ListConfigurationComponent<ActivityPortConfiguration> inputPanel = new ListConfigurationComponent<ActivityPortConfiguration>(
+				"Input Port", getInputPorts()) {
+			@Override
+			protected Component createItemComponent(ActivityPortConfiguration port) {
+				return new PortComponent(port, inputTextGroup);
+			}
+
+			@Override
+			protected ActivityPortConfiguration createDefaultItem() {
+				return new ActivityPortConfiguration("in", 0);
+			}
+		};
+		return inputPanel;
+	}
+
+	private Component createOutputPanel() {
+		outputTextGroup = new ValidatingTextGroup();
+		ListConfigurationComponent<ActivityPortConfiguration> inputPanel = new ListConfigurationComponent<ActivityPortConfiguration>(
+				"Output Port", getOutputPorts()) {
+			@Override
+			protected Component createItemComponent(ActivityPortConfiguration port) {
+				return new PortComponent(port, outputTextGroup);
+			}
+
+			@Override
+			protected ActivityPortConfiguration createDefaultItem() {
+				return new ActivityPortConfiguration("out", 0);
+			}
+		};
+		return inputPanel;
+	}
+
+	private Component createDependenciesPanel() {
+		String classLoaderSharing = getProperty("classLoaderSharing");
+		List<String> localDependencies = new ArrayList<>();
+		if (getJson().has("localDependency")) {
+			for (JsonNode localDependency : getJson().get("localDependency")) {
+				localDependencies.add(localDependency.textValue());
+			}
+		}
+		dependencyConfigurationPanel = new DependencyConfigurationPanel(classLoaderSharing,
+				localDependencies, libDir);
+		return dependencyConfigurationPanel;
+	}
+
+	class PortComponent extends JPanel {
+
+		private ValidatingTextField nameField;
+		private SpinnerNumberModel depthModel;
+		private final ValidatingTextGroup validatingTextGroup;
+
+		public PortComponent(final ActivityPortConfiguration portConfiguration,
+				ValidatingTextGroup validatingTextGroup) {
+			this.validatingTextGroup = validatingTextGroup;
+
+			nameField = new ValidatingTextField(portConfiguration.getName());
+			nameField.getDocument().addDocumentListener(new DocumentListener() {
+				@Override
+				public void removeUpdate(DocumentEvent e) {
+					portConfiguration.setName(nameField.getText());
+				}
+
+				@Override
+				public void insertUpdate(DocumentEvent e) {
+					portConfiguration.setName(nameField.getText());
+				}
+
+				@Override
+				public void changedUpdate(DocumentEvent e) {
+					portConfiguration.setName(nameField.getText());
+				}
+			});
+			validatingTextGroup.addValidTextComponent(nameField);
+			depthModel = new SpinnerNumberModel(portConfiguration.getDepth(), 0, 100, 1);
+			depthModel.addChangeListener(new ChangeListener() {
+				@Override
+				public void stateChanged(ChangeEvent e) {
+					portConfiguration.setDepth(depthModel.getNumber().intValue());
+				}
+			});
+
+			setLayout(new GridBagLayout());
+			GridBagConstraints c = new GridBagConstraints();
+			c.anchor = GridBagConstraints.WEST;
+			add(new JLabel("Name"), c);
+			c.fill = GridBagConstraints.HORIZONTAL;
+			c.weightx = 1;
+			add(nameField, c);
+			c.fill = GridBagConstraints.NONE;
+			c.weightx = 0;
+			add(new JLabel("Depth"), c);
+			add(new JSpinner(depthModel), c);
+
+		}
+
+		public void removeNotify() {
+			validatingTextGroup.removeTextComponent(nameField);
+		}
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellContextualView.java
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellContextualView.java b/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellContextualView.java
new file mode 100644
index 0000000..e738e38
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/java/net/sf/taverna/t2/activities/beanshell/views/BeanshellContextualView.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 (at your option) any later version.
+ *
+ *  This program 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 program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.beanshell.views;
+
+import java.awt.Frame;
+
+import javax.swing.Action;
+
+import net.sf.taverna.t2.activities.beanshell.actions.BeanshellActivityConfigurationAction;
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.configuration.colour.ColourManager;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.file.FileManager;
+import net.sf.taverna.t2.workbench.ui.actions.activity.HTMLBasedActivityContextualView;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.port.InputActivityPort;
+import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+
+/**
+ * A simple non editable HTML table view over a {@link BeanshellActivity}.
+ * Clicking on the configure button shows the editable {@link BeanshellConfigView}
+ *
+ * @author Ian Dunlop
+ * @author Stuart Owen
+ * @author David Withers
+ */
+@SuppressWarnings("serial")
+public class BeanshellContextualView extends HTMLBasedActivityContextualView {
+
+	private EditManager editManager;
+	private FileManager fileManager;
+	private final ActivityIconManager activityIconManager;
+	private final ServiceDescriptionRegistry serviceDescriptionRegistry;
+	private final ApplicationConfiguration applicationConfiguration;
+
+	public BeanshellContextualView(Activity activity, EditManager editManager,
+			FileManager fileManager, ActivityIconManager activityIconManager,
+			ColourManager colourManager, ServiceDescriptionRegistry serviceDescriptionRegistry,
+			ApplicationConfiguration applicationConfiguration) {
+		super(activity, colourManager);
+		this.editManager = editManager;
+		this.fileManager = fileManager;
+		this.activityIconManager = activityIconManager;
+		this.serviceDescriptionRegistry = serviceDescriptionRegistry;
+		this.applicationConfiguration = applicationConfiguration;
+		init();
+	}
+
+	private void init() {
+	}
+
+	@Override
+	protected String getRawTableRowsHtml() {
+		StringBuilder html = new StringBuilder();
+		html.append("<tr><th>Input Port Name</th><th>Depth</th></tr>");
+		for (InputActivityPort inputActivityPort : getActivity().getInputPorts()) {
+			html.append("<tr><td>" + inputActivityPort.getName() + "</td><td>");
+			html.append(inputActivityPort.getDepth() + "</td></tr>");
+		}
+		html.append("<tr><th>Output Port Name</th><th>Depth</th></tr>");
+		for (OutputActivityPort outputActivityPort : getActivity().getOutputPorts()) {
+			html.append("<tr><td>" + outputActivityPort.getName() + "</td><td>");
+			html.append(outputActivityPort.getDepth() + "</td></tr>");
+		}
+		return html.toString();
+	}
+
+	@Override
+	public String getViewTitle() {
+		return "Beanshell service";
+	}
+
+	@Override
+	public Action getConfigureAction(Frame owner) {
+		return new BeanshellActivityConfigurationAction(getActivity(), owner, editManager,
+				fileManager, activityIconManager, serviceDescriptionRegistry, applicationConfiguration);
+	}
+
+	@Override
+	public int getPreferredPosition() {
+		return 100;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider
new file mode 100644
index 0000000..a77db8d
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider
@@ -0,0 +1 @@
+net.sf.taverna.t2.activities.beanshell.servicedescriptions.BeanshellTemplateService

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
new file mode 100644
index 0000000..a3c71cd
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
@@ -0,0 +1,3 @@
+net.sf.taverna.t2.activities.beanshell.menu.AddBeanshellTemplateAction
+net.sf.taverna.t2.activities.beanshell.menu.AddBeanshellTemplateMenuAction
+net.sf.taverna.t2.activities.beanshell.menu.ConfigureBeanshellMenuAction

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI
new file mode 100644
index 0000000..a268bf1
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI
@@ -0,0 +1 @@
+net.sf.taverna.t2.activities.beanshell.servicedescriptions.BeanshellActivityIcon
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
new file mode 100644
index 0000000..dcdf598
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
@@ -0,0 +1 @@
+net.sf.taverna.t2.activities.beanshell.views.BeanshellActivityViewFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context-osgi.xml b/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context-osgi.xml
new file mode 100644
index 0000000..58a3e18
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context-osgi.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans.xsd
+                      http://www.springframework.org/schema/osgi
+                      http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="BeanshellActivityIcon" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI" />
+
+	<service ref="BeanshellTemplateService" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider" />
+
+	<service ref="AddBeanshellTemplateAction" auto-export="interfaces" />
+	<service ref="AddBeanshellTemplateMenuAction" auto-export="interfaces" />
+	<service ref="ConfigureBeanshellMenuAction" auto-export="interfaces" />
+
+	<service ref="BeanshellActivityViewFactory" interface="net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory" />
+
+	<reference id="editManager" interface="net.sf.taverna.t2.workbench.edits.EditManager" />
+	<reference id="fileManager" interface="net.sf.taverna.t2.workbench.file.FileManager" />
+	<reference id="menuManager" interface="net.sf.taverna.t2.ui.menu.MenuManager" />
+	<reference id="selectionManager" interface="net.sf.taverna.t2.workbench.selection.SelectionManager" />
+	<reference id="activityIconManager" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconManager" />
+	<reference id="colourManager" interface="net.sf.taverna.t2.workbench.configuration.colour.ColourManager" />
+	<reference id="serviceDescriptionRegistry" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry" />
+	<reference id="serviceRegistry" interface="uk.org.taverna.commons.services.ServiceRegistry" />
+	<reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context.xml
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context.xml b/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context.xml
new file mode 100644
index 0000000..fc6d5d4
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/META-INF/spring/beanshell-activity-ui-context.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="BeanshellActivityIcon" class="net.sf.taverna.t2.activities.beanshell.servicedescriptions.BeanshellActivityIcon" />
+
+	<bean id="BeanshellTemplateService" class="net.sf.taverna.t2.activities.beanshell.servicedescriptions.BeanshellTemplateService" />
+
+	<bean id="AddBeanshellTemplateAction" class="net.sf.taverna.t2.activities.beanshell.menu.AddBeanshellTemplateAction">
+			<property name="editManager" ref="editManager" />
+			<property name="menuManager" ref="menuManager" />
+			<property name="selectionManager" ref="selectionManager" />
+			<property name="activityIconManager" ref="activityIconManager" />
+			<property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
+			<property name="serviceRegistry" ref="serviceRegistry" />
+	</bean>
+	<bean id="AddBeanshellTemplateMenuAction" class="net.sf.taverna.t2.activities.beanshell.menu.AddBeanshellTemplateMenuAction">
+			<property name="editManager" ref="editManager" />
+			<property name="menuManager" ref="menuManager" />
+			<property name="selectionManager" ref="selectionManager" />
+			<property name="activityIconManager" ref="activityIconManager" />
+			<property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
+			<property name="serviceRegistry" ref="serviceRegistry" />
+	</bean>
+	<bean id="ConfigureBeanshellMenuAction" class="net.sf.taverna.t2.activities.beanshell.menu.ConfigureBeanshellMenuAction">
+			<property name="editManager" ref="editManager" />
+			<property name="fileManager" ref="fileManager" />
+			<property name="activityIconManager" ref="activityIconManager" />
+			<property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
+			<property name="applicationConfiguration" ref="applicationConfiguration" />
+	</bean>
+
+	<bean id="BeanshellActivityViewFactory" class="net.sf.taverna.t2.activities.beanshell.views.BeanshellActivityViewFactory">
+			<property name="editManager" ref="editManager" />
+			<property name="fileManager" ref="fileManager" />
+			<property name="activityIconManager" ref="activityIconManager" />
+			<property name="colourManager" ref="colourManager" />
+			<property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
+			<property name="applicationConfiguration" ref="applicationConfiguration" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/beanshell.png
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/beanshell.png b/taverna-beanshell-activity-ui/src/main/resources/beanshell.png
new file mode 100644
index 0000000..8f6edfb
Binary files /dev/null and b/taverna-beanshell-activity-ui/src/main/resources/beanshell.png differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/6b540057/taverna-beanshell-activity-ui/src/main/resources/net/sf/taverna/t2/activities/beanshell/views/keys.txt
----------------------------------------------------------------------
diff --git a/taverna-beanshell-activity-ui/src/main/resources/net/sf/taverna/t2/activities/beanshell/views/keys.txt b/taverna-beanshell-activity-ui/src/main/resources/net/sf/taverna/t2/activities/beanshell/views/keys.txt
new file mode 100644
index 0000000..15cb51b
--- /dev/null
+++ b/taverna-beanshell-activity-ui/src/main/resources/net/sf/taverna/t2/activities/beanshell/views/keys.txt
@@ -0,0 +1,90 @@
+++
+--
++
+-
+~
+!
+*
+/
+%
+<<
+>>
+>>>
+<
+>
+<=
+>=
+==
+!=
+&
+^
+|
+&&
+||
+:
+=
++=
+-=
+*=
+/=
+%=
+&=
+^=
+|=
+<<=
+>>=
+>>>=
+=
+abstract
+assert
+boolean
+break
+byte
+case
+catch
+char
+class
+const
+continue
+default
+do
+double
+else
+enum
+extends
+false
+final
+finally
+float
+for
+goto
+if
+implements
+import
+instanceof
+int
+interface
+long
+native
+new
+null
+package
+private
+protected
+public
+return
+short
+static
+strictfp
+super
+switch
+synchronized
+this
+throw
+throws
+transient
+true
+try
+void
+volatile
+while 
\ No newline at end of file