@@ -0,0 +1,2762 @@
+/**********************************************************************%0A * Copyright (C) 2007-2009 The University of Manchester   %0A * %0A *  Modifications to the initial code base are copyright of their%0A *  respective authors, or their employers as appropriate.%0A * %0A *  This program is free software; you can redistribute it and/or%0A *  modify it under the terms of the GNU Lesser General Public License%0A *  as published by the Free Software Foundation; either version 2.1 of%0A *  the License, or (at your option) any later version.%0A *    %0A *  This program is distributed in the hope that it will be useful, but%0A *  WITHOUT ANY WARRANTY; without even the implied warranty of%0A *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A *  Lesser General Public License for more details.%0A *    %0A *  You should have received a copy of the GNU Lesser General Public%0A *  License along with this program; if not, write to the Free Software%0A *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307%0A **********************************************************************/%0Apackage net.sf.taverna.t2.ui.menu.items.dataflow;%0A%0Aimport java.net.URI;%0A%0Aimport javax.swing.Action;%0A%0Aimport net.sf.taverna.t2.lang.ui.ShadedLabel;%0Aimport net.sf.taverna.t2.ui.menu.AbstractMenuSection;%0Aimport net.sf.taverna.t2.ui.menu.ContextualMenuComponent;%0Aimport net.sf.taverna.t2.ui.menu.ContextualSelection;%0Aimport net.sf.taverna.t2.ui.menu.DefaultContextualMenu;%0Aimport net.sf.taverna.t2.workflowmodel.Dataflow;%0A%0A/**%0A * Menu section containing the actions to add service templates, i.e. activities %0A * than are not readily runnable but need to be configured first. The actual actions that%0A * go into this menu can be found in the ui modules for the activities.%0A * %0A * @author Alex Nenadic%0A *%0A */%0Apublic class EditSection extends AbstractMenuSection%0A%09%09implements ContextualMenuComponent %7B%0A%0A%09private static final String EDIT = %22Edit%22;%0A%09public static final URI editSection = URI%0A%09%09%09.create(%22http://taverna.sf.net/2009/contextMenu/edit%22);%0A%09private ContextualSelection contextualSelection;%0A%0A%09public EditSection() %7B%0A%09%09super(DefaultContextualMenu.DEFAULT_CONTEXT_MENU, 32, editSection);%0A%09%7D%0A%0A%09public ContextualSelection getContextualSelection() %7B%0A%09%09return contextualSelection;%0A%09%7D%0A%0A%09@Override%0A%09public boolean isEnabled() %7B%0A%09%09return super.isEnabled()%0A%09%09%09%09&& getContextualSelection().getSelection() instanceof Dataflow;%0A%09%7D%0A%0A%09public void setContextualSelection(ContextualSelection contextualSelection) %7B%0A%09%09this.contextualSelection = contextualSelection;%0A%09%7D%0A%0A%09@Override%0A%09protected Action createAction() %7B%0A%09%09DummyAction action = new DummyAction(EDIT);%0A%09%09// Set the colour for the section%0A%09%09action.putValue(AbstractMenuSection.SECTION_COLOR, ShadedLabel.ORANGE);%0A%09%09return action;%0A%09%7D%0A%7D%0A

Edit section for paste