http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/manager/ssh/SshInvocationMechanismEditor.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/manager/ssh/SshInvocationMechanismEditor.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/manager/ssh/SshInvocationMechanismEditor.java deleted file mode 100644 index e8291ed..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/manager/ssh/SshInvocationMechanismEditor.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * - */ -package net.sf.taverna.t2.activities.externaltool.manager.ssh; - -import java.awt.Color; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.AbstractAction; -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextField; -import javax.swing.border.CompoundBorder; - -import net.sf.taverna.t2.activities.externaltool.manager.InvocationMechanism; -import net.sf.taverna.t2.activities.externaltool.manager.InvocationMechanismEditor; -import net.sf.taverna.t2.activities.externaltool.ssh.ExternalToolSshInvocationMechanism; -import net.sf.taverna.t2.lang.ui.DeselectingButton; -import de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshNode; -import de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshNodeFactory; - -/** - * @author alanrw - * - */ -public final class SshInvocationMechanismEditor extends - InvocationMechanismEditor<ExternalToolSshInvocationMechanism> { - - private ArrayList<ExternalToolSshNodeViewer> nodeViewers = new ArrayList<ExternalToolSshNodeViewer>(); - private int inputGridy = 0; - - private ExternalToolSshInvocationMechanism mechanism = null; - - private static Insets insets = new Insets(1,5,1,5); - - private static CompoundBorder border = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createLineBorder(Color.BLACK, 1)); - - @Override - public boolean canShow(Class<?> c) { - return ExternalToolSshInvocationMechanism.class.isAssignableFrom(c); - } - - @Override - public void show(ExternalToolSshInvocationMechanism invocationMechanism) { - mechanism = invocationMechanism; - this.removeAll(); - inputGridy = 1; - final JPanel innerPanel = new JPanel(new GridBagLayout()); - - final GridBagConstraints inputConstraint = new GridBagConstraints(); - inputConstraint.anchor = GridBagConstraints.FIRST_LINE_START; - inputConstraint.gridx = 0; - inputConstraint.gridy = 0; - inputConstraint.weightx = 0.1; - inputConstraint.fill = GridBagConstraints.BOTH; - - inputConstraint.gridx = 0; - nodeViewers.clear(); - for (SshNode node : invocationMechanism.getNodes()) { - ExternalToolSshNodeViewer nodeViewer = new ExternalToolSshNodeViewer(node); - addNodeViewer(this, innerPanel, nodeViewer); - } - - this.setLayout(new GridBagLayout()); - GridBagConstraints outerPanelConstraint = new GridBagConstraints(); - outerPanelConstraint.gridx = 0; - outerPanelConstraint.gridy = 0; - outerPanelConstraint.weightx = 0.1; - outerPanelConstraint.weighty = 0.1; - outerPanelConstraint.fill = GridBagConstraints.BOTH; - this.add(new JScrollPane(innerPanel), - outerPanelConstraint); - outerPanelConstraint.weighty = 0; - final JButton addHostButton = new DeselectingButton("Add host", - new AbstractAction() { - public void actionPerformed(ActionEvent e) { - - ExternalToolSshNodeViewer newViewer = new ExternalToolSshNodeViewer(); - - addNodeViewer(SshInvocationMechanismEditor.this, innerPanel, newViewer); - innerPanel.revalidate(); - innerPanel.repaint(); - } - - }); - JPanel buttonPanel = new JPanel(); - buttonPanel.setLayout(new GridBagLayout()); - - JPanel filler = new JPanel(); - outerPanelConstraint.weightx = 0.1; - outerPanelConstraint.weighty = 0; - outerPanelConstraint.gridx = 0; - outerPanelConstraint.gridy = 0; - - buttonPanel.add(filler, outerPanelConstraint); - - outerPanelConstraint.weightx = 0; - outerPanelConstraint.weighty = 0; - outerPanelConstraint.gridx = 1; - outerPanelConstraint.gridy = 0; - - buttonPanel.add(addHostButton, outerPanelConstraint); - - outerPanelConstraint.weightx = 0; - outerPanelConstraint.weighty = 0; - outerPanelConstraint.gridx = 0; - outerPanelConstraint.gridy = 1; - outerPanelConstraint.fill = GridBagConstraints.BOTH; - this.add(buttonPanel, outerPanelConstraint); - } - - protected void addNodeViewer(final JPanel result, final JPanel innerPanel, - ExternalToolSshNodeViewer viewer) { - final JPanel subPanel = new JPanel(); - subPanel.setLayout(new GridBagLayout()); - subPanel.setBorder(border); - final GridBagConstraints inputConstraint = new GridBagConstraints(); - inputConstraint.insets = insets; - inputConstraint.anchor = GridBagConstraints.FIRST_LINE_START; - inputConstraint.weightx = 0.1; - inputConstraint.fill = GridBagConstraints.BOTH; - - inputConstraint.gridy = 0 ; - inputConstraint.gridx = 0; - - subPanel.add(new JLabel("Host: "), inputConstraint); - final JTextField hostnameField = viewer.getHostnameField(); - inputConstraint.gridx++; - subPanel.add(hostnameField, inputConstraint); - - inputConstraint.gridy++ ; - inputConstraint.gridx = 0; - subPanel.add(new JLabel("Port: "), inputConstraint); - final JTextField portField = viewer.getPortField(); - inputConstraint.gridx++; - subPanel.add(portField ,inputConstraint); - - inputConstraint.gridy++ ; - inputConstraint.gridx = 0; - subPanel.add(new JLabel("Working directory: "), inputConstraint); - final JTextField directoryField = viewer.getDirectoryField(); - inputConstraint.gridx++; - subPanel.add(directoryField ,inputConstraint); - - inputConstraint.gridy++ ; - inputConstraint.gridx = 0; - subPanel.add(new JLabel("Link command: "), inputConstraint); - final JTextField linkCommandField = viewer.getLinkCommandField(); - inputConstraint.gridx++; - subPanel.add(linkCommandField ,inputConstraint); - - inputConstraint.gridy++ ; - inputConstraint.gridx = 0; - subPanel.add(new JLabel("Copy command: "), inputConstraint); - final JTextField copyCommandField = viewer.getCopyCommandField(); - inputConstraint.gridx++; - subPanel.add(copyCommandField ,inputConstraint); - - inputConstraint.gridy++ ; - inputConstraint.gridx = 0; - subPanel.add(new JLabel("Fetch data: "), inputConstraint); - inputConstraint.gridx++; - final JCheckBox retrieveDataField = viewer.getRetrieveDataField(); - subPanel.add(retrieveDataField ,inputConstraint); - - inputConstraint.gridy++ ; - inputConstraint.gridx = 1; - inputConstraint.fill = GridBagConstraints.NONE; - inputConstraint.anchor = GridBagConstraints.EAST; - final ExternalToolSshNodeViewer v = viewer; - final JButton removeButton = new DeselectingButton("Remove", - new AbstractAction() { - - public void actionPerformed(ActionEvent e) { - synchronized(nodeViewers) { - nodeViewers.remove(v); - } - innerPanel.remove(subPanel); - innerPanel.revalidate(); - innerPanel.repaint(); - result.revalidate(); - result.repaint(); - } - - }); - subPanel.add(removeButton, inputConstraint); - - inputConstraint.gridy = ++inputGridy; - innerPanel.add(subPanel, inputConstraint); - - nodeViewers.add(viewer); - inputGridy++; - } - - private List<SshNode> getNodeList() { - List<SshNode> result = new ArrayList<SshNode>(); - for (ExternalToolSshNodeViewer viewer : nodeViewers) { - SshNode node = SshNodeFactory.getInstance().getSshNode(viewer.getHostname(), viewer.getPort(), viewer.getDirectory()); - node.setLinkCommand(viewer.getLinkCommand()); - node.setCopyCommand(viewer.getCopyCommand()); - node.setRetrieveData(viewer.getRetrieveDataField().isSelected()); - result.add(node); - } - return result; - } - - @Override - public ExternalToolSshInvocationMechanism updateInvocationMechanism() { - mechanism.setNodes(getNodeList()); - return mechanism; - } - - @Override - public InvocationMechanism createMechanism(String mechanismName) { - ExternalToolSshInvocationMechanism result = new ExternalToolSshInvocationMechanism(); - result.setName(mechanismName); - return result; - } - - @Override - public String getName() { - return ("SSH"); - } - -}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolContextualMenuAction.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolContextualMenuAction.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolContextualMenuAction.java deleted file mode 100644 index 1ebdbd1..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolContextualMenuAction.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2007-2009 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.externaltool.menu; - -import java.awt.event.ActionEvent; -import java.net.URI; - -import javax.swing.AbstractAction; -import javax.swing.Action; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.activities.externaltool.servicedescriptions.ExternalToolTemplateServiceDescription; -import net.sf.taverna.t2.ui.menu.AbstractContextualMenuAction; -import net.sf.taverna.t2.ui.menu.MenuManager; -import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager; -import net.sf.taverna.t2.workbench.edits.EditManager; -import net.sf.taverna.t2.workbench.selection.SelectionManager; -import net.sf.taverna.t2.workbench.ui.workflowview.WorkflowView; -import org.apache.taverna.workflowmodel.Dataflow; - -import org.apache.log4j.Logger; - -/** - * An action to add an external tool + a wrapping processor to the workflow. - * - * @author Alex Nenadic - * @author Alan Williamns - * - */ -@SuppressWarnings("serial") -public class AddExternalToolContextualMenuAction extends AbstractContextualMenuAction { - - private static final String ADD_EXTERNAL_TOOL = "Tool"; - - private static final URI insertSection = URI - .create("http://taverna.sf.net/2009/contextMenu/insert"); - - private static Logger logger = Logger.getLogger(AddExternalToolMenuAction.class); - - private EditManager editManager; - - private MenuManager menuManager; - - private SelectionManager selectionManager; - - private ActivityIconManager activityIconManager; - - public AddExternalToolContextualMenuAction() { - super(insertSection, 900); - } - - @Override - public boolean isEnabled() { - return super.isEnabled() && getContextualSelection().getSelection() instanceof Dataflow; - } - - @Override - protected Action createAction() { - - return new AddExternalToolAction(); - } - - protected class AddExternalToolAction extends AbstractAction { - AddExternalToolAction() { - super(ADD_EXTERNAL_TOOL, activityIconManager.iconForActivity( - new ExternalToolActivity())); - } - - public void actionPerformed(ActionEvent e) { - WorkflowView.importServiceDescription( - ExternalToolTemplateServiceDescription.getServiceDescription(), false, - editManager, menuManager, selectionManager); - } - } - - public void setEditManager(EditManager editManager) { - this.editManager = editManager; - } - - public void setMenuManager(MenuManager menuManager) { - this.menuManager = menuManager; - } - - public void setSelectionManager(SelectionManager selectionManager) { - this.selectionManager = selectionManager; - } - - public void setActivityIconManager(ActivityIconManager activityIconManager) { - this.activityIconManager = activityIconManager; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolMenuAction.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolMenuAction.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolMenuAction.java deleted file mode 100644 index ff1f11e..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/AddExternalToolMenuAction.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2007-2009 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.externaltool.menu; - -import java.awt.event.ActionEvent; -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.net.URI; - -import javax.swing.Action; -import javax.swing.KeyStroke; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.activities.externaltool.servicedescriptions.ExternalToolTemplateServiceDescription; -import net.sf.taverna.t2.ui.menu.AbstractMenuAction; -import net.sf.taverna.t2.ui.menu.DesignOnlyAction; -import net.sf.taverna.t2.ui.menu.MenuManager; -import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager; -import net.sf.taverna.t2.workbench.edits.EditManager; -import net.sf.taverna.t2.workbench.selection.SelectionManager; -import net.sf.taverna.t2.workbench.ui.workflowview.WorkflowView; -import net.sf.taverna.t2.workbench.views.graph.menu.InsertMenu; - -import org.apache.log4j.Logger; - -/** - * An action to add a externaltool activity + a wrapping processor to the workflow. - * - * @author Alex Nenadic - * @author alanrw - * - */ -@SuppressWarnings("serial") -public class AddExternalToolMenuAction extends AbstractMenuAction { - - private static final String ADD_EXTERNAL_TOOL = "Tool"; - - private static final URI ADD_EXTERNAL_TOOL_URI = URI - .create("http://taverna.sf.net/2008/t2workbench/menu#graphMenuAddExternalTool"); - - private static Logger logger = Logger - .getLogger(AddExternalToolMenuAction.class); - - private EditManager editManager; - private MenuManager menuManager; - private SelectionManager selectionManager; - - private ActivityIconManager activityIconManager; - - public AddExternalToolMenuAction() { - super(InsertMenu.INSERT, 900, ADD_EXTERNAL_TOOL_URI); - } - - @Override - protected Action createAction() { - - return new AddExternalToolAction(); - } - - protected class AddExternalToolAction extends DesignOnlyAction { - AddExternalToolAction () { - super (); - putValue(SMALL_ICON, activityIconManager.iconForActivity( - new ExternalToolActivity())); - putValue(NAME, ADD_EXTERNAL_TOOL); - putValue(SHORT_DESCRIPTION, "Tool"); - putValue(Action.ACCELERATOR_KEY, - KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK)); - } - - public void actionPerformed(ActionEvent e) { - WorkflowView.importServiceDescription(ExternalToolTemplateServiceDescription.getServiceDescription(), - false, editManager, menuManager, selectionManager); - } - } - - public void setEditManager(EditManager editManager) { - this.editManager = editManager; - } - - public void setMenuManager(MenuManager menuManager) { - this.menuManager = menuManager; - } - - public void setSelectionManager(SelectionManager selectionManager) { - this.selectionManager = selectionManager; - } - - public void setActivityIconManager(ActivityIconManager activityIconManager) { - this.activityIconManager = activityIconManager; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/ConfigureExternalToolMenuAction.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/ConfigureExternalToolMenuAction.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/ConfigureExternalToolMenuAction.java deleted file mode 100644 index f57b25c..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/ConfigureExternalToolMenuAction.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 Hajo Nils Krabbenhoeft, spratpix GmbH & Co. KG - * - * 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.externaltool.menu; - -import javax.swing.Action; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.activities.externaltool.actions.ExternalToolActivityConfigureAction; -import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager; -import net.sf.taverna.t2.workbench.activitytools.AbstractConfigureActivityMenuAction; -import net.sf.taverna.t2.workbench.edits.EditManager; -import net.sf.taverna.t2.workbench.file.FileManager; - -/** - * This class adds the plugin configuration action to the context menu of every use case activity. - * - * @author Hajo Nils Krabbenhoeft - */ -public class ConfigureExternalToolMenuAction extends - AbstractConfigureActivityMenuAction<ExternalToolActivity> { - - private EditManager editManager; - private FileManager fileManager; - private ActivityIconManager activityIconManager; - - public ConfigureExternalToolMenuAction() { - super(ExternalToolActivity.class); - } - - @Override - protected Action createAction() { - ExternalToolActivityConfigureAction configAction = new ExternalToolActivityConfigureAction( - findActivity(), getParentFrame(), editManager, fileManager, activityIconManager); - addMenuDots(configAction); - return configAction; - } - - public void setEditManager(EditManager editManager) { - this.editManager = editManager; - } - - public void setFileManager(FileManager fileManager) { - this.fileManager = fileManager; - } - - public void setActivityIconManager(ActivityIconManager activityIconManager) { - this.activityIconManager = activityIconManager; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/FeedbackMenuAction.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/FeedbackMenuAction.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/FeedbackMenuAction.java deleted file mode 100644 index 8c7a284..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/menu/FeedbackMenuAction.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 Hajo Nils Krabbenhoeft, spratpix GmbH & Co. KG - * - * 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.externaltool.menu; - -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.Icon; -import javax.swing.JOptionPane; - -import net.sf.taverna.t2.ui.menu.AbstractMenuAction; - -import org.apache.log4j.Logger; - -/** - * This class adds the feedback item to the context menu of every use case - * activity. - * - * @author Hajo Nils Krabbenhoeft - */ -public class FeedbackMenuAction extends AbstractMenuAction { - - private static Logger logger = Logger.getLogger(FeedbackMenuAction.class); - - - private static final URI feedbackSection = URI.create("http://taverna.sf.net/2009/contextMenu/configure"); - - public FeedbackMenuAction() { - super(feedbackSection, 51); - } - - protected Action createAction() { - // final ImageIcon icon = KnowARCConfigurationFactory.getConfiguration().getIcon(); - return new SendFeedbackAction("Send Feedback...", null); - } - - private final class SendFeedbackAction extends AbstractAction { - private static final long serialVersionUID = 1L; - - private static final String errTitle = "Could not open web browser for feedback:"; - private static final String feedbackUrl = "http://www.taverna.org.uk/about/contact-us/feedback?product=ExternalToolService"; - - private SendFeedbackAction(String name, Icon icon) { - super(name, icon); - } - - public void actionPerformed(ActionEvent e) { - if (Desktop.isDesktopSupported()) { - try { - Desktop.getDesktop().browse(URI.create(feedbackUrl)); - } catch (IOException e1) { - JOptionPane.showMessageDialog(null, feedbackUrl + "\n" + e1.getLocalizedMessage(), errTitle, JOptionPane.ERROR_MESSAGE); - } - } else { - JOptionPane.showMessageDialog(null, "Go to " + feedbackUrl, errTitle, JOptionPane.ERROR_MESSAGE); - } - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/AddExternalToolServiceDialog.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/AddExternalToolServiceDialog.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/AddExternalToolServiceDialog.java deleted file mode 100644 index 86b0882..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/AddExternalToolServiceDialog.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * 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.externaltool.servicedescriptions; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.io.IOException; -import java.net.URL; -import java.net.URLConnection; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTextField; -import javax.swing.border.EmptyBorder; - -import net.sf.taverna.t2.workbench.MainWindow; -import net.sf.taverna.t2.workbench.helper.HelpEnabledDialog; - -import org.apache.log4j.Logger; - -/** - * Dialog that lets user specify a URL of a Tool service they want - * to add to the Service Panel. In the case the Tool URL is behind - * HTTPS or service's endpoints require HTTPS it will ask user to confirm - * if they want to trust it. - * - * @author Alex Nenadic - * - */ -@SuppressWarnings("serial") -public abstract class AddExternalToolServiceDialog extends HelpEnabledDialog { - - private JTextField toolLocationField; - private Logger logger = Logger.getLogger(AddExternalToolServiceDialog.class); - - public AddExternalToolServiceDialog() { - super(MainWindow.getMainWindow(), "Add tool service", true, null); // create a non-modal dialog - initComponents(); - setLocationRelativeTo(getParent()); - } - - private void initComponents() { - JPanel mainPanel = new JPanel(new GridBagLayout()); - mainPanel.setBorder(new EmptyBorder(10,10,10,10)); - - JLabel toolLocatitionLabel = new JLabel("Tool registry location",ExternalToolActivityIcon.getExternalToolIcon(), JLabel.LEFT); - GridBagConstraints gbc = new GridBagConstraints(); - gbc.weighty = 0.0; - - gbc.weightx = 0.0; - gbc.gridx = 0; - gbc.gridy = 0; - gbc.fill = GridBagConstraints.NONE; - gbc.anchor = GridBagConstraints.WEST; - gbc.insets = new Insets(5, 10, 0, 0); - mainPanel.add(toolLocatitionLabel, gbc); - - toolLocationField = new JTextField("http://taverna.nordugrid.org/sharedRepository/xml.php"); - gbc.weightx = 1.0; - gbc.gridx = 1; - gbc.gridy = 0; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.anchor = GridBagConstraints.WEST; - gbc.insets = new Insets(5, 10, 0, 5); - mainPanel.add(toolLocationField, gbc); - - final JButton addServiceButton = new JButton("Add"); - addServiceButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent evt) - { - addPressed(); - } - }); - - // When user presses "Return" key fire the action on the "Add" button - addServiceButton.addKeyListener(new java.awt.event.KeyAdapter() { - public void keyPressed(java.awt.event.KeyEvent evt) { - if (evt.getKeyCode() == KeyEvent.VK_ENTER) { - addPressed(); - } - } - }); - getRootPane().setDefaultButton(addServiceButton); - - JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - buttonsPanel.add(addServiceButton); - - getContentPane().setLayout(new BorderLayout()); - getContentPane().add(mainPanel, BorderLayout.CENTER); - getContentPane().add(buttonsPanel, BorderLayout.SOUTH); - - setSize(getPreferredSize()); - pack(); - } - - /** - * 'Add service' button pressed or otherwise activated. - */ - private void addPressed() - { - final String toolURLString = toolLocationField.getText().trim(); - new Thread("Adding tool " + toolURLString) { - public void run() { - // Only add the service provider for this service if service URL - // starts with 'http' - // or if it starts with 'https' and user explicitly said they - // wanted to trust this service. - /* - * if (shouldTrust(toolURLString)){ addRegistry(toolURLString); - * } - */ - try { - URL url = new URL(toolURLString); - URLConnection connection = url.openConnection(); - try { - // If the url starts with 'https' - security hook for - // https connection's trust manager - // will be engaged and user will be asked automatically - // if they want - // to trust the connection (if it is not already - // trusted). If the urls starts with 'http' - - // this will not have any effect apart from checking if - // we can open a connection. - connection.connect(); // if this does not fail - add the - // tool - // service provider for this service to - // the registry - } finally { - try { - connection.getInputStream().close(); - } catch (IOException ex) { - } - } - addRegistry(toolURLString); - } catch (Exception ex) { // anything failed - JOptionPane.showMessageDialog(null, - "Could not read the tool descriptions from " - + toolURLString + ":\n" + ex, - "Could not add tool service", - JOptionPane.ERROR_MESSAGE); - - logger.error( - "Failed to add tool description provider for service: " - + toolURLString, ex); - - } - }; - }.start(); - closeDialog(); - } - - protected abstract void addRegistry(String tool); - - /** - * Closes the dialog. - */ - private void closeDialog() { - setVisible(false); - dispose(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolActivityIcon.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolActivityIcon.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolActivityIcon.java deleted file mode 100644 index 566389c..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolActivityIcon.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2009 Hajo Nils Krabbenhoeft, INB, University of Luebeck - * - * 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.externaltool.servicedescriptions; - -import java.awt.Color; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI; -import net.sf.taverna.t2.workbench.configuration.colour.ColourManager; -import org.apache.taverna.workflowmodel.processor.activity.Activity; - -/** - * This class provides an icon for the use case activity. - * - * @author Hajo Nils Krabbenhoeft - */ -public class ExternalToolActivityIcon implements ActivityIconSPI { - - private static final String PROCESSOR_COLOUR_STRING = "#F28C55"; - - private static Icon icon; - - public int canProvideIconScore(Activity<?> activity) { - if (activity.getClass().getName().equals(ExternalToolActivity.class.getName())) - return DEFAULT_ICON + 1; - else - return NO_ICON; - } - - public Icon getIcon(Activity<?> activity) { - return getExternalToolIcon(); - } - - public static Icon getExternalToolIcon() { - if (icon == null) { - icon = new ImageIcon(ExternalToolActivityIcon.class.getResource("/externaltool.png")); - } - return icon; - } - - public static String getColourString() { - return PROCESSOR_COLOUR_STRING; - } - - public void setColourManager(ColourManager colourManager) { - // set colour for XPath processors in the workflow diagram - colourManager.setPreferredColour(ExternalToolActivity.class.getCanonicalName(), - Color.decode(PROCESSOR_COLOUR_STRING)); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceDescription.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceDescription.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceDescription.java deleted file mode 100644 index c0a9c72..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceDescription.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2009 Hajo Nils Krabbenhoeft, INB, University of Luebeck - * - * 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.externaltool.servicedescriptions; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import org.apache.log4j.Logger; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean; -import net.sf.taverna.t2.activities.externaltool.manager.InvocationGroupManager; -import net.sf.taverna.t2.activities.externaltool.manager.impl.InvocationGroupManagerImpl; -import net.sf.taverna.t2.servicedescriptions.ServiceDescription; -import org.apache.taverna.workflowmodel.processor.activity.Activity; -import de.uni_luebeck.inb.knowarc.usecases.UseCaseDescription; - -/** - * ExternalToolServiceDescription stores the repository URL and the use case id so - * that it can create an ExternalToolActivityConfigurationBean - * - * @author Hajo Nils Krabbenhoeft - */ -public class ExternalToolServiceDescription extends ServiceDescription<ExternalToolActivityConfigurationBean> { - - private static Logger logger = Logger - .getLogger(ExternalToolServiceDescription.class); - - - private static InvocationGroupManager manager = InvocationGroupManagerImpl.getInstance(); - - private String repositoryUrl; - private String externaltoolid; - private UseCaseDescription useCaseDescription; - - public String getRepositoryUrl() { - return repositoryUrl; - } - - public void setRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - } - - public String getExternaltoolid() { - return externaltoolid; - } - - public void setExternaltoolid(String externaltoolid) { - this.externaltoolid = externaltoolid; - } - - public Icon getIcon() { - if (useCaseDescription != null) { - String icon_url = useCaseDescription.getIcon_url(); - if ((icon_url != null) && !icon_url.isEmpty() && !icon_url.endsWith(".ico")) - try { - ImageIcon result = new ImageIcon(new URL(icon_url)); - if ((result != null) && (result.getIconHeight() != 0) && (result.getIconWidth() != 0)){ - return result; - } - } catch (MalformedURLException e) { - logger.error("Problematic URL" + icon_url, e); - } - } - return ExternalToolActivityIcon.getExternalToolIcon(); - } - - public Class<? extends Activity<ExternalToolActivityConfigurationBean>> getActivityClass() { - return ExternalToolActivity.class; - } - - public ExternalToolActivityConfigurationBean getActivityConfiguration() { - ExternalToolActivityConfigurationBean bean = new ExternalToolActivityConfigurationBean(); - bean.setRepositoryUrl(repositoryUrl); - bean.setExternaltoolid(externaltoolid); - bean.setUseCaseDescription(useCaseDescription); - bean.setMechanism(manager.getDefaultMechanism()); - - return bean; - } - - public String getName() { - return externaltoolid; - } - - @SuppressWarnings("unchecked") - public List<? extends Comparable> getPath() { - List<String> result = new ArrayList<String>(); - result.add("Tools decribed @ " + repositoryUrl); - String group = useCaseDescription.getGroup(); - if ((group != null) && !group.isEmpty()) { - String[] groups = group.split(":"); - for (String g : groups) { - result.add(g); - } - } - return result; - } - - protected List<Object> getIdentifyingData() { - // we require use cases inside one XML file to have unique IDs, which - // means every externaltool is uniquely identified by its repository URL and - // its use case ID. - return Arrays.<Object> asList(repositoryUrl, externaltoolid); - } - - public String getDescription() { - if (useCaseDescription != null) { - String description = useCaseDescription.getDescription(); - if (description == null) { - return ""; - } - return description; - } - return ""; - } - - public void setUseCaseDescription(UseCaseDescription usecase) { - this.useCaseDescription = usecase; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProvider.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProvider.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProvider.java deleted file mode 100644 index 8eee3f2..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProvider.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2009 Hajo Nils Krabbenhoeft, INB, University of Luebeck - * - * 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.externaltool.servicedescriptions; - -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.swing.Icon; - -import net.sf.taverna.t2.servicedescriptions.AbstractConfigurableServiceProvider; -import net.sf.taverna.t2.servicedescriptions.CustomizedConfigurePanelProvider; -import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry; -import de.uni_luebeck.inb.knowarc.usecases.UseCaseDescription; -import de.uni_luebeck.inb.knowarc.usecases.UseCaseEnumeration; - -/** - * ExternalToolServiceProvider searches an use case repository XML for use case - * descriptions. - * - * @author Hajo Nils Krabbenhoeft - */ -public class ExternalToolServiceProvider extends AbstractConfigurableServiceProvider<ExternalToolServiceProviderConfig> - implements CustomizedConfigurePanelProvider<ExternalToolServiceProviderConfig> { - - private static final URI providerId = URI - .create("http://taverna.sf.net/2010/service-provider/externaltool"); - - public ExternalToolServiceProvider() { - super(new ExternalToolServiceProviderConfig("http://taverna.nordugrid.org/sharedRepository/xml.php")); - } - - public String getName() { - return "Tool service"; - } - - public List<ExternalToolServiceProviderConfig> getDefaultConfigurations() { - List<ExternalToolServiceProviderConfig> defaults = new ArrayList<ExternalToolServiceProviderConfig>(); - // Disabled until sensible set -// defaults.add(new ExternalToolServiceProviderConfig("http://taverna.nordugrid.org/sharedRepository/xml.php")); - return defaults; - } - - public void findServiceDescriptionsAsync(FindServiceDescriptionsCallBack callBack) { - String repositoryUrl = serviceProviderConfig.getRepositoryUrl(); - callBack.status("Parsing use case repository:" + repositoryUrl); - // prepare a list of all use case descriptions which are stored in - // the given repository URL - List<UseCaseDescription> usecases = new ArrayList<UseCaseDescription> (); - try { - usecases = UseCaseEnumeration.readDescriptionsFromUrl( - repositoryUrl); - } catch (IOException e) { - callBack.fail("Unable to read tool descriptions", e); - } - callBack.status("Found " + usecases.size() + " use cases:" + repositoryUrl); - // convert all the UseCaseDescriptions in the XML file into - // ExternalToolServiceDescription items - List<ExternalToolServiceDescription> items = new ArrayList<ExternalToolServiceDescription>(); - for (UseCaseDescription usecase : usecases) { - ExternalToolServiceDescription item = new ExternalToolServiceDescription(); - item.setRepositoryUrl(repositoryUrl); - item.setExternaltoolid(usecase.getUsecaseid()); - item.setUseCaseDescription(usecase); - items.add(item); - } - // we dont have streaming data loading or partial results, so return - // results and finish - callBack.partialResults(items); - callBack.finished(); - } - - @Override - public String toString() { - return getName() + " " + getConfiguration().getRepositoryUrl(); - } - - public Icon getIcon() { - return ExternalToolActivityIcon.getExternalToolIcon(); - } - - @Override - protected List<? extends Object> getIdentifyingData() { - List<String> result; - // one can fully identify an use case repository by its URL - result = Arrays.asList(getConfiguration().getRepositoryUrl()); - return result; - } - - public void setServiceDescriptionRegistry(ServiceDescriptionRegistry registry) { - } - - @SuppressWarnings("serial") - public void createCustomizedConfigurePanel(final CustomizedConfigureCallBack<ExternalToolServiceProviderConfig> callBack) { - - AddExternalToolServiceDialog addWSDLServiceDialog = new AddExternalToolServiceDialog() { - @Override - protected void addRegistry(String externalToolURL) { - - ExternalToolServiceProviderConfig providerConfig = new ExternalToolServiceProviderConfig(externalToolURL); - callBack.newProviderConfiguration(providerConfig); - } - }; - addWSDLServiceDialog.setVisible(true); - } - - - public String getId() { - return providerId.toString(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProviderConfig.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProviderConfig.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProviderConfig.java deleted file mode 100644 index 0967a6e..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolServiceProviderConfig.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2009 Hajo Nils Krabbenhoeft, INB, University of Luebeck - * - * 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.externaltool.servicedescriptions; - -import net.sf.taverna.t2.lang.beans.PropertyAnnotated; -import net.sf.taverna.t2.lang.beans.PropertyAnnotation; - -/** - * ExternalToolServiceProviderConfig stores the URL of the use case repository XML file - * - * @author Hajo Nils Krabbenhoeft - */ -public class ExternalToolServiceProviderConfig extends PropertyAnnotated { - private String repositoryUrl; - - public ExternalToolServiceProviderConfig() { - } - - public ExternalToolServiceProviderConfig(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - } - - @PropertyAnnotation(displayName = "Tool registry location", preferred = true) - public String getRepositoryUrl() { - return repositoryUrl; - } - - public void setRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - } - - @Override - public String toString() { - return repositoryUrl; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolTemplateServiceDescription.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolTemplateServiceDescription.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolTemplateServiceDescription.java deleted file mode 100644 index 23f2d7d..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/servicedescriptions/ExternalToolTemplateServiceDescription.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * - */ -package net.sf.taverna.t2.activities.externaltool.servicedescriptions; - -import java.net.URI; -import java.util.UUID; - -import javax.swing.Icon; - -import de.uni_luebeck.inb.knowarc.usecases.UseCaseDescription; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean; -import net.sf.taverna.t2.activities.externaltool.manager.InvocationGroupManager; -import net.sf.taverna.t2.activities.externaltool.manager.impl.InvocationGroupManagerImpl; -import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService; -import net.sf.taverna.t2.servicedescriptions.ServiceDescription; -import org.apache.taverna.workflowmodel.processor.activity.Activity; - -/** - * @author alanrw - * - */ -public class ExternalToolTemplateServiceDescription extends - AbstractTemplateService<ExternalToolActivityConfigurationBean> { - - private static final URI providerId = URI - .create("http://taverna.sf.net/2010/service-provider/external-tool"); - - private static final String EXTERNAL_TOOL = "Tool"; - - private static InvocationGroupManager manager = InvocationGroupManagerImpl.getInstance(); - - @Override - public Class<? extends Activity<ExternalToolActivityConfigurationBean>> getActivityClass() { - return ExternalToolActivity.class; - } - - @Override - public ExternalToolActivityConfigurationBean getActivityConfiguration() { - ExternalToolActivityConfigurationBean result = new ExternalToolActivityConfigurationBean(); - result.setExternaltoolid(UUID.randomUUID().toString()); - result.setUseCaseDescription(new UseCaseDescription("")); - result.setMechanism(manager.getDefaultMechanism()); - return result; - } - - @Override - public Icon getIcon() { - return ExternalToolActivityIcon.getExternalToolIcon(); - } - - @Override - public String getDescription() { - return "A service that allows tools to be used as services"; - } - - @SuppressWarnings("unchecked") - public static ServiceDescription getServiceDescription() { - ExternalToolTemplateServiceDescription bts = new ExternalToolTemplateServiceDescription(); - return bts.templateService; - } - - - - @Override - public String getId() { - return providerId.toString(); - } - - @Override - public String getName() { - return EXTERNAL_TOOL; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/utils/Tools.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/utils/Tools.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/utils/Tools.java deleted file mode 100644 index 55cda5c..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/utils/Tools.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * - */ -package net.sf.taverna.t2.activities.externaltool.utils; - -import java.awt.Color; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.util.List; -import java.util.Map; - -import javax.swing.AbstractAction; -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.border.CompoundBorder; - -import de.uni_luebeck.inb.knowarc.usecases.ScriptInput; -import de.uni_luebeck.inb.knowarc.usecases.ScriptInputUser; - -import net.sf.taverna.t2.lang.ui.DeselectingButton; - -/** - * @author alanrw - * - */ -public class Tools { - - private static CompoundBorder border = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,5,5,5), BorderFactory.createLineBorder(Color.BLACK, 1)); - - private static Insets insets = new Insets(5,5,5,5); - - public static void addViewer(final JPanel innerPanel, String[] labels, JComponent[] elements, - final List viewerList, final Object viewer, final JPanel outerPanel) { - final JPanel subPanel = new JPanel(); - subPanel.setLayout(new GridBagLayout()); - subPanel.setBorder(border); - - final GridBagConstraints labelConstraint = new GridBagConstraints(); - labelConstraint.insets = insets; - labelConstraint.anchor = GridBagConstraints.FIRST_LINE_START; - labelConstraint.fill = GridBagConstraints.BOTH; - labelConstraint.gridy = 0; - labelConstraint.gridx = 0; - labelConstraint.weightx = 0; - - final GridBagConstraints elementConstraint = new GridBagConstraints(); - elementConstraint.insets = insets; - elementConstraint.anchor = GridBagConstraints.FIRST_LINE_START; - elementConstraint.fill = GridBagConstraints.BOTH; - elementConstraint.gridy = 0; - elementConstraint.gridx = 1; - elementConstraint.weightx = 1.0; - - final GridBagConstraints removeConstraint = new GridBagConstraints(); - removeConstraint.insets = insets; - removeConstraint.anchor = GridBagConstraints.FIRST_LINE_START; - removeConstraint.fill = GridBagConstraints.BOTH; - removeConstraint.gridx = 1; - removeConstraint.weightx = 0; - removeConstraint.fill = GridBagConstraints.NONE; - removeConstraint.anchor = GridBagConstraints.EAST; - - final GridBagConstraints subPanelConstraint = new GridBagConstraints(); - subPanelConstraint.insets = insets; - subPanelConstraint.anchor = GridBagConstraints.FIRST_LINE_START; - subPanelConstraint.fill = GridBagConstraints.BOTH; - subPanelConstraint.gridx = 1; -// subPanelConstraint.gridy = ++stringReplacementGridy; - subPanelConstraint.weightx = 1.00; - subPanelConstraint.fill = GridBagConstraints.HORIZONTAL; - subPanelConstraint.anchor = GridBagConstraints.WEST; - - for (int i = 0; i < labels.length; i++) { - subPanel.add(new JLabel(labels[i] + ":"), labelConstraint); - subPanel.add(elements[i], elementConstraint); - labelConstraint.gridy++; - elementConstraint.gridy++; - } - - removeConstraint.gridy = labelConstraint.gridy + 1; - final JButton removeButton = new DeselectingButton("Remove", - new AbstractAction() { - - public void actionPerformed(ActionEvent e) { - synchronized (viewerList) { - viewerList.remove(viewer); - } - innerPanel.remove(subPanel); - innerPanel.revalidate(); - innerPanel.repaint(); - outerPanel.revalidate(); - outerPanel.repaint(); - } - - }); - subPanel.add(removeButton, removeConstraint); - innerPanel.add(subPanel, subPanelConstraint); - } - - public static boolean isStringReplacement(ScriptInputUser si) { - return !si.isList() && !si.isFile() && !si.isTempFile(); - } - - public static boolean isInputFile(ScriptInputUser si) { - return !si.isList() && si.isFile(); - } - - public static boolean isFileList(ScriptInputUser si) { - return si.isList() && si.isFile(); - } - - public static boolean isUnderstood(ScriptInputUser si) { - return isStringReplacement(si) || isInputFile(si) || isFileList(si); - } - - public static boolean areAllUnderstood(Map<String, ScriptInput> inputs) { - for (ScriptInput si : inputs.values()) { - if ((si instanceof ScriptInputUser) && !isUnderstood((ScriptInputUser) si)) { - return false; - } - } - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/AnnotationPanel.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/AnnotationPanel.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/AnnotationPanel.java deleted file mode 100644 index 83e75e8..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/AnnotationPanel.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - */ -package net.sf.taverna.t2.activities.externaltool.views; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.FlowLayout; - -import javax.swing.JLabel; -import javax.swing.JPanel; - -/** - * @author alanrw - * - */ -public class AnnotationPanel extends JPanel { - - public AnnotationPanel(Component nameField, Component descriptionArea, Component groupField) { - super(); - this.setLayout(new BorderLayout()); - JPanel subPanel = new JPanel(new BorderLayout()); - JPanel namePanel = new JPanel(); - namePanel.setLayout(new FlowLayout(FlowLayout.LEFT)); - namePanel.add(new JLabel("Name: ")); - namePanel.add(nameField); - subPanel.add(namePanel, BorderLayout.NORTH); - JPanel groupPanel = new JPanel(); - groupPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); - groupPanel.add(new JLabel("Group: ")); - groupPanel.add(groupField); - subPanel.add(groupPanel, BorderLayout.SOUTH); - this.add(subPanel, BorderLayout.NORTH); - JPanel descriptionPanel = new JPanel(); - descriptionPanel.setLayout(new BorderLayout()); - descriptionPanel.add(new JLabel("Description:"), BorderLayout.NORTH); - descriptionPanel.add(descriptionArea, BorderLayout.CENTER); - this.add(descriptionPanel, BorderLayout.CENTER); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/EditablePanel.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/EditablePanel.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/EditablePanel.java deleted file mode 100644 index b395983..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/EditablePanel.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * - */ -package net.sf.taverna.t2.activities.externaltool.views; - -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.AbstractAction; -import javax.swing.JButton; -import javax.swing.JOptionPane; -import javax.swing.JPanel; - -import de.uni_luebeck.inb.knowarc.usecases.UseCaseDescription; -import de.uni_luebeck.inb.knowarc.usecases.UseCaseEnumeration; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean; -import net.sf.taverna.t2.activities.externaltool.servicedescriptions.ExternalToolServiceDescription; -import net.sf.taverna.t2.activities.externaltool.utils.Tools; -import net.sf.taverna.t2.lang.ui.DeselectingButton; - -/** - * @author alanrw - * - */ -public class EditablePanel extends JPanel { - public EditablePanel(final ExternalToolConfigView view) { - super(new FlowLayout()); - - JButton update = new DeselectingButton("Update tool description", - new AbstractAction() { - - @Override - public void actionPerformed(ActionEvent e) { - ExternalToolActivityConfigurationBean bean = view.getConfiguration(); - String repositoryUrl = bean.getRepositoryUrl(); - String id = bean.getExternaltoolid(); - UseCaseDescription usecase = null; - try { - usecase = UseCaseEnumeration.readDescriptionFromUrl( - repositoryUrl, id); - } - catch (IOException ex) { - // Already logged - } - if (usecase != null) { - bean.setUseCaseDescription(usecase); - view.refreshConfiguration(bean); - } else { - JOptionPane.showMessageDialog(view, "Unable to find tool description " + id, "Missing tool description", JOptionPane.ERROR_MESSAGE); - } - }}); - this.add(update); - - JButton makeEditable = new DeselectingButton("Edit tool description", - new AbstractAction() { - - @Override - public void actionPerformed(ActionEvent arg0) { - ExternalToolActivityConfigurationBean config = view.makeConfiguration(); - view.setEditable(true, config); - - } - }); - makeEditable.setToolTipText("Edit the tool description"); - if (Tools.areAllUnderstood(view.getConfiguration().getUseCaseDescription().getInputs())) { - this.add(makeEditable); - } - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityContextualView.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityContextualView.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityContextualView.java deleted file mode 100644 index 39b2c5e..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityContextualView.java +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 Hajo Nils Krabbenhoeft, INB, University of Luebeck - * - * 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.externaltool.views; - -import java.awt.Frame; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TreeMap; - -import javax.swing.Action; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean; -import net.sf.taverna.t2.activities.externaltool.actions.ExternalToolActivityConfigureAction; -import net.sf.taverna.t2.activities.externaltool.servicedescriptions.ExternalToolActivityIcon; -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 org.apache.taverna.workflowmodel.processor.activity.Activity; -import de.uni_luebeck.inb.knowarc.usecases.ScriptInput; -import de.uni_luebeck.inb.knowarc.usecases.ScriptInputStatic; -import de.uni_luebeck.inb.knowarc.usecases.ScriptOutput; -import de.uni_luebeck.inb.knowarc.usecases.UseCaseDescription; - -/** - * ExternalToolActivityContextualView displays the use case information in a HTML table. Currently, - * this is only the use case ID. - * - * @author Hajo Nils Krabbenhoeft - */ -public class ExternalToolActivityContextualView extends - HTMLBasedActivityContextualView<ExternalToolActivityConfigurationBean> { - private static final long serialVersionUID = 1L; - private final EditManager editManager; - private final FileManager fileManager; - private final ActivityIconManager activityIconManager; - - public ExternalToolActivityContextualView(Activity<?> activity, EditManager editManager, - FileManager fileManager, ColourManager colourManager, ActivityIconManager activityIconManager) { - super(activity, colourManager); - this.editManager = editManager; - this.fileManager = fileManager; - this.activityIconManager = activityIconManager; - } - - @Override - protected String getRawTableRowsHtml() { - String html = ""; - ExternalToolActivityConfigurationBean bean = getConfigBean(); - String repositoryUrl = bean.getRepositoryUrl(); - if ((repositoryUrl == null) || repositoryUrl.isEmpty()) { - repositoryUrl = "<b>Not specified</b>"; - } - html += "<tr><td>Repository URL</td><td>" + repositoryUrl + "</td></tr>"; - - String id = bean.getExternaltoolid(); - if ((id == null) || id.isEmpty()) { - id = "<b>Not specified</b>"; - } - html += "<tr><td>Id</td><td>" + id + "</td></tr>"; - - UseCaseDescription useCaseDescription = bean.getUseCaseDescription(); - String name = useCaseDescription.getUsecaseid(); - if ((name == null) || name.isEmpty()) { - name = "<b>Not specified</b>"; - } - html += "<tr><td>Name</td><td>" + name + "</td></tr>"; - - Map<String, ScriptInput> stringReplacements = new TreeMap<String, ScriptInput>(); - Map<String, ScriptInput> fileInputs = new TreeMap<String, ScriptInput>(); - - for (Entry<String, ScriptInput> entry : useCaseDescription.getInputs().entrySet()) { - String key = entry.getKey(); - ScriptInput value = entry.getValue(); - if (value.isFile()) { - fileInputs.put(key, value); - } else if (value.isTempFile()) { - // Nothing - } else { - stringReplacements.put(key, value); - } - } - - if (!stringReplacements.isEmpty()) { - html += "<tr><td colspan=2 align=center><b>String replacements</b></td></tr>"; - html += "<tr><td><b>Port name</b></td><td><b>Replaces</b></td></tr>"; - for (String siName : stringReplacements.keySet()) { - html += "<tr><td>" + siName + "</td>"; - ScriptInput si = stringReplacements.get(siName); - html += "<td>%%" + si.getTag() + "%%</td>"; - - html += "</tr>"; - } - } - - if (!fileInputs.isEmpty()) { - html += "<tr><td colspan=2 align=center><b>File inputs</b></td></tr>"; - html += "<tr><td><b>Port name</b></td><td><b>To file</b></td></tr>"; - for (String siName : fileInputs.keySet()) { - html += "<tr><td>" + siName + "</td>"; - ScriptInput si = fileInputs.get(siName); - html += "<td>" + si.getTag() + "</td>"; - - html += "</tr>"; - } - } - - List<ScriptInputStatic> staticInputs = useCaseDescription.getStatic_inputs(); - if (!staticInputs.isEmpty()) { - html += "<tr><td colspan=2 align=center><b>Static inputs</b></td></tr>"; - html += "<tr><td><b>Type</b></td><td><b>To file</b></td></tr>"; - for (ScriptInputStatic si : staticInputs) { - if (si.getUrl() != null) { - html += "<td><b>URL</b></td>"; - } else { - html += "<td><b>Explicit content</b></td>"; - } - if (si.isFile()) { - html += "<td>" + si.getTag() + "</td>"; - } - html += "</tr>"; - } - } - Map<String, ScriptOutput> outputs = useCaseDescription.getOutputs(); - if (!outputs.isEmpty()) { - html += "<tr><td colspan=2 align=center><b>File outputs</b></td></tr>"; - html += "<tr><td><b>Port name</b></td><td><b>From file</b></td></tr>"; - for (String soName : outputs.keySet()) { - html += "<tr><td>" + soName + "</td>"; - ScriptOutput so = outputs.get(soName); - html += "<td>" + so.getPath() + "</td>"; - html += "</tr>"; - } - } - return html; - } - - @Override - public String getViewTitle() { - return "Tool service"; - } - - @Override - public Action getConfigureAction(final Frame owner) { - return new ExternalToolActivityConfigureAction((ExternalToolActivity) getActivity(), owner, - editManager, fileManager, activityIconManager); - } - - public String getBackgroundColour() { - - return ExternalToolActivityIcon.getColourString(); - } - - @Override - public int getPreferredPosition() { - return 100; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench-common-activities/blob/163747de/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityViewFactory.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityViewFactory.java b/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityViewFactory.java deleted file mode 100644 index 902c736..0000000 --- a/taverna-external-tool-activity-ui/src/main/java/net/sf/taverna/t2/activities/externaltool/views/ExternalToolActivityViewFactory.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 Hajo Nils Krabbenhoeft, INB, University of Luebeck - * - * 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.externaltool.views; - -import java.util.Arrays; -import java.util.List; - -import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity; -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; - -/** - * ExternalToolActivityViewFactory produces an ExternalToolActivityContextualView to show - * information for a use case activity. - * - * @author Hajo Nils Krabbenhoeft - */ -public class ExternalToolActivityViewFactory implements ContextualViewFactory<ExternalToolActivity> { - - private EditManager editManager; - private FileManager fileManager; - private ActivityIconManager activityIconManager; - private ColourManager colourManager; - - public boolean canHandle(Object object) { - if (object instanceof ExternalToolActivity) { - return true; - } - return false; - } - - public List<ContextualView> getViews(ExternalToolActivity selection) { - return Arrays.asList(new ContextualView[] { new ExternalToolActivityContextualView( - selection, editManager, fileManager, colourManager, activityIconManager) }); - } - - 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; - } - -}
