From: <bd...@us...> - 2007-07-31 14:45:56
|
Revision: 1396 http://unicore.svn.sourceforge.net/unicore/?rev=1396&view=rev Author: bdemuth Date: 2007-07-31 07:45:53 -0700 (Tue, 31 Jul 2007) Log Message: ----------- Added extensions for the Unicore6WorkFlowEditor plugin Modified Paths: -------------- gpe4eclipse/trunk/.classpath gpe4eclipse/trunk/META-INF/MANIFEST.MF gpe4eclipse/trunk/plugin.xml gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTClient.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanInputPanel.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanOutputPanel.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/CreateJobAction.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/perspectives/GPEPerspectiveFactory.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/utils/WSRFClientFactory.java Added Paths: ----------- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/commands/ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/commands/ShowGridBeanViewCommand.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivity.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivityPart.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewAction.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewPolicy.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowEditorActionsExtension.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPaletteEntryExtension.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPartFactoryExtension.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/IStageOutListViewer.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOut.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutContentProvider.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutLabelProvider.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutList.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutTableCellModifier.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutTableViewer.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/views/GridBeanView.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/views/JobOutcomeView.java Removed Paths: ------------- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/views/GridBeanInputView.java gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/views/GridBeanOutputView.java Modified: gpe4eclipse/trunk/.classpath =================================================================== --- gpe4eclipse/trunk/.classpath 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/.classpath 2007-07-31 14:45:53 UTC (rev 1396) @@ -54,7 +54,7 @@ <classpathentry exported="true" kind="lib" path="lib/securityLibrary-1.0-SNAPSHOT.jar"/> <classpathentry exported="true" kind="lib" path="lib/gpe-commons-1.5-SNAPSHOT.jar"/> <classpathentry exported="true" kind="lib" path="lib/gpe-common-1.4.0.jar"/> - <classpathentry exported="true" kind="lib" path="lib/gpe-shared-clients-1.4.2-SNAPSHOT.jar" sourcepath="/gpe-1.4-shared-clients/src"/> + <classpathentry exported="true" kind="lib" path="lib/gpe-shared-clients-1.4.2-SNAPSHOT.jar" sourcepath="/gpe-rcp-shared-clients/src"/> <classpathentry exported="true" kind="lib" path="lib/gpe-wsclient-1.5-SNAPSHOT.jar" sourcepath="/gpe-wsclient/src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/> Modified: gpe4eclipse/trunk/META-INF/MANIFEST.MF =================================================================== --- gpe4eclipse/trunk/META-INF/MANIFEST.MF 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/META-INF/MANIFEST.MF 2007-07-31 14:45:53 UTC (rev 1396) @@ -10,7 +10,11 @@ de.fzj.unicore.logmonitor, de.fzj.unicore.common, de.fzj.unicore.identity, - de.fzj.unicore.servicebrowser;resolution:=optional + de.fzj.unicore.servicebrowser;resolution:=optional, + de.fzj.unicore.wfeditor;resolution:=optional, + org.eclipse.gef, + org.eclipse.ui.views +Eclipse-RegisterBuddy: de.fzj.unicore.wfeditor Eclipse-LazyStart: true Bundle-ClassPath: lib/jaxb-impl-2.0.3.jar, ., Modified: gpe4eclipse/trunk/plugin.xml =================================================================== --- gpe4eclipse/trunk/plugin.xml 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/plugin.xml 2007-07-31 14:45:53 UTC (rev 1396) @@ -12,17 +12,17 @@ <view allowMultiple="true" category="de.fzj.unicore" - class="de.fzj.unicore.gpe4eclipse.views.GridBeanInputView" + class="de.fzj.unicore.gpe4eclipse.views.GridBeanView" icon="icons/unicore_o_16x16.png" - id="de.fzj.unicore.gpe4eclipse.views.GridBeanInputView" - name="Grid Bean Input"/> + id="de.fzj.unicore.gpe4eclipse.views.GridBeanView" + name="Grid Bean View"/> <view allowMultiple="true" category="de.fzj.unicore" - class="de.fzj.unicore.gpe4eclipse.views.GridBeanOutputView" + class="de.fzj.unicore.gpe4eclipse.views.JobOutcomeView" icon="icons/unicore_o_16x16.png" - id="de.fzj.unicore.gpe4eclipse.views.GridBeanOutputView" - name="Grid Bean Output"/> + id="de.fzj.unicore.gpe4eclipse.views.JobOutcomeView" + name="Job Outcome VIew"/> </extension> <extension point="org.eclipse.ui.perspectives"> @@ -37,5 +37,23 @@ point="de.fzj.unicore.servicebrowser.NodeActionExtensionPoint"> <class name="de.fzj.unicore.gpe4eclipse.extensions.CreateJobActionExtension"/> </extension> + <extension + id="GridBeanActivityExtension" + name="GridBeanActivityExtension" + point="de.fzj.unicore.wfeditor.PaletteEntryExtensionPoint"> + <class name="de.fzj.unicore.gpe4eclipse.extensions.wfeditor.WorkflowPaletteEntryExtension"/> + </extension> + <extension + id="GridBeanActivityPartExtension" + name="GridBeanActivityPartExtension" + point="de.fzj.unicore.wfeditor.PartFactoryExtensionPoint"> + <class name="de.fzj.unicore.gpe4eclipse.extensions.wfeditor.WorkflowPartFactoryExtension"/> + </extension> + <extension + id="WorkflowEditorActionsExtension" + name="WorkflowEditorActionsExtension" + point="de.fzj.unicore.wfeditor.EditorActionsExtensionPoint"> + <class name="de.fzj.unicore.gpe4eclipse.extensions.wfeditor.WorkflowEditorActionsExtension"/> + </extension> </plugin> Modified: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTClient.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTClient.java 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTClient.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -59,7 +59,7 @@ import de.fzj.unicore.gpe4eclipse.selection.SWTSelectionClient; import de.fzj.unicore.gpe4eclipse.utils.IWSRFClientFactory; import de.fzj.unicore.gpe4eclipse.utils.WSRFClientFactory; -import de.fzj.unicore.gpe4eclipse.views.GridBeanInputView; +import de.fzj.unicore.gpe4eclipse.views.GridBeanView; /** * @author demuth @@ -153,7 +153,7 @@ */ public GridBeanClient<IViewPart> createGridBeanClient() { - ClassLoader classLoader = GridBeanInputView.class.getClassLoader(); + ClassLoader classLoader = GridBeanView.class.getClassLoader(); try { return new SWTGridBeanClientImpl(securityManager,classLoader,outcomeProvider,this,fileProvider,userPrefs,null); } catch (Exception e) { Modified: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanInputPanel.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanInputPanel.java 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanInputPanel.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -49,7 +49,7 @@ import com.intel.gpe.gridbeans.plugins.IGridBeanPlugin; import com.intel.gpe.gridbeans.plugins.TranslationException; -import de.fzj.unicore.gpe4eclipse.views.GridBeanInputView; +import de.fzj.unicore.gpe4eclipse.views.GridBeanView; /** * @@ -61,7 +61,7 @@ public class SWTGridBeanInputPanel extends BaseGridBeanInputPanel<IViewPart>{ - protected GridBeanInputView view; + protected GridBeanView view; protected GridBeanClient<IViewPart> gbClient; protected IGridBeanPlugin plugin; protected GridBeanJob job; @@ -82,7 +82,7 @@ // Show Input panels as tab folder within a View IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); try { - view = (GridBeanInputView) page.showView("de.fzj.unicore.gpe4eclipse.views.GridBeanInputView",""+UUID.randomUUID(), WorkbenchPage.VIEW_ACTIVATE); + view = (GridBeanView) page.showView("de.fzj.unicore.gpe4eclipse.views.GridBeanView",""+UUID.randomUUID(), WorkbenchPage.VIEW_ACTIVATE); view.setGridBeanClient(gbClient); } catch (PartInitException e1) { // TODO Auto-generated catch block @@ -98,13 +98,7 @@ IGenericGridBeanPanel[] components = plugin.getInputPanels(); if (components != null) { - for (int i=0; i<components.length; i++) { - try { - view.addPanel(components[i]); - } catch (Exception e) { - e.printStackTrace(); - } - } + view.setPanels(components); } try { Modified: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanOutputPanel.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanOutputPanel.java 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/SWTGridBeanOutputPanel.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -55,7 +55,7 @@ import com.intel.gpe.gridbeans.plugins.IGenericGridBeanPanel; import com.intel.gpe.gridbeans.plugins.IGridBeanPlugin; -import de.fzj.unicore.gpe4eclipse.views.GridBeanOutputView; +import de.fzj.unicore.gpe4eclipse.views.JobOutcomeView; /** * @@ -66,7 +66,7 @@ */ public class SWTGridBeanOutputPanel extends BaseGridBeanOutputPanel<IViewPart>{ - protected GridBeanOutputView view; + protected JobOutcomeView view; protected GridBeanClient<IViewPart> gbClient; protected IGridBeanPlugin plugin; private TextPanel stdoutArea, stderrArea, logArea; @@ -97,7 +97,7 @@ // Show Output panels in a tab folder within a View IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); try { - view = (GridBeanOutputView) page.showView("de.fzj.unicore.gpe4eclipse.views.GridBeanOutputView",""+UUID.randomUUID(), WorkbenchPage.VIEW_ACTIVATE); + view = (JobOutcomeView) page.showView("de.fzj.unicore.gpe4eclipse.views.JobOutcomeView",""+UUID.randomUUID(), WorkbenchPage.VIEW_ACTIVATE); } catch (PartInitException e1) { // TODO Auto-generated catch block e1.printStackTrace(); Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/commands/ShowGridBeanViewCommand.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/commands/ShowGridBeanViewCommand.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/commands/ShowGridBeanViewCommand.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package de.fzj.unicore.gpe4eclipse.commands; + +import java.io.File; + +import org.eclipse.core.runtime.Preferences; +import org.eclipse.gef.commands.Command; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.ui.IViewPart; + +import com.intel.gpe.client2.GridBeanClient; +import com.intel.gpe.util.observer.IObserver; + +import de.fzj.unicore.gpe4eclipse.GPEActivator; +import de.fzj.unicore.gpe4eclipse.ISWTClient; + +/** + * @author demuth + */ +public class ShowGridBeanViewCommand extends Command { + + public static final String GRIDBEAN_PATH = ShowGridBeanViewCommand.class.getName() + "gridbean_path"; + + private GridBeanClient<IViewPart> gbClient; + + /** + * @see org.eclipse.gef.commands.Command#execute() + */ + public void execute() { + + redo(); + } + + + public void redo() { + ISWTClient client = GPEActivator.getDefault().getClient(); + + if(gbClient == null) gbClient = client.createGridBeanClient(); + + String path = askGridBean(); + gbClient.loadGridBean(path, new IObserver() { + + public void observableUpdate(Object arg0, Object arg1) { + gbClient.getGridBeanInputPanel(); + + }}); + } + + + public boolean canUndo() { + return false; + } + + /** + * @see org.eclipse.gef.commands.Command#undo() + */ + public void undo() { + + } + + public GridBeanClient<IViewPart> getGbClient() { + return gbClient; + } + + public void setGbClient(GridBeanClient<IViewPart> gbClient) { + this.gbClient = gbClient; + } + + + private String askGridBean() { + Preferences p = GPEActivator.getDefault().getPluginPreferences(); + + FileDialog dialog = new FileDialog(GPEActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN); + String path = p.getString(GRIDBEAN_PATH); + dialog.setFilterPath(path); + //new FileDialog(viewer.getControl().getShell(), SWT.OPEN); + String[] extensions = {"*.jar"}; + dialog.setFilterExtensions(extensions); + dialog.setText("Please select a GridBean for creating a job."); + String filename = dialog.open(); + int i = filename.lastIndexOf(File.separator); + p.setValue(GRIDBEAN_PATH, filename.substring(0, i)); + return filename; + } + +} Modified: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/CreateJobAction.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/CreateJobAction.java 2007-07-31 13:36:16 UTC (rev 1395) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/CreateJobAction.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -1,26 +1,13 @@ package de.fzj.unicore.gpe4eclipse.extensions; -import java.io.File; - -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; - -import com.intel.gpe.client2.GridBeanClient; -import com.intel.gpe.util.observer.IObserver; - import de.fzj.unicore.gpe4eclipse.GPEActivator; -import de.fzj.unicore.gpe4eclipse.ISWTClient; -import de.fzj.unicore.gpe4eclipse.SWTClient; +import de.fzj.unicore.gpe4eclipse.commands.ShowGridBeanViewCommand; import de.fzj.unicore.servicebrowser.actions.NodeAction; import de.fzj.unicore.servicebrowser.nodes.Node; public class CreateJobAction extends NodeAction { - public static final String GRIDBEAN_PATH = CreateJobAction.class.getName() + "gridbean_path"; + public CreateJobAction(Node node) { super(node); setText("create job"); @@ -33,35 +20,10 @@ */ @Override public void run() { - - ISWTClient client = GPEActivator.getDefault().getClient(); - - final GridBeanClient<IViewPart> gbClient = client.createGridBeanClient(); - - String path = askGridBean(); - gbClient.loadGridBean(path, new IObserver() { - - public void observableUpdate(Object arg0, Object arg1) { - gbClient.getGridBeanInputPanel(); - - }}); - + ShowGridBeanViewCommand cmd = new ShowGridBeanViewCommand(); + cmd.execute(); } - private String askGridBean() { - Preferences p = GPEActivator.getDefault().getPluginPreferences(); - - FileDialog dialog = new FileDialog(GPEActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN); - String path = p.getString(GRIDBEAN_PATH); - dialog.setFilterPath(path); - //new FileDialog(viewer.getControl().getShell(), SWT.OPEN); - String[] extensions = {"*.jar"}; - dialog.setFilterExtensions(extensions); - dialog.setText("Please select a GridBean for creating a job."); - String filename = dialog.open(); - int i = filename.lastIndexOf(File.separator); - p.setValue(GRIDBEAN_PATH, filename.substring(0, i)); - return filename; - } + } \ No newline at end of file Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivity.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivity.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivity.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,56 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import org.eclipse.ui.IViewPart; + +import com.intel.gpe.client2.GridBeanClient; + +import de.fzj.unicore.wfeditor.model.Activity; + +/** + * @author demuth + * + */ +public class GridBeanActivity extends Activity { + private GridBeanClient<IViewPart> gridBeanClient; + public GridBeanActivity() + { + } + public GridBeanClient<IViewPart> getGridBeanClient() { + return gridBeanClient; + } + public void setGridBeanClient(GridBeanClient<IViewPart> gridBeanClient) { + this.gridBeanClient = gridBeanClient; + } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivityPart.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivityPart.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/GridBeanActivityPart.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2003, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import java.util.Map; + +import org.eclipse.draw2d.Figure; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.ImageFigure; +import org.eclipse.draw2d.geometry.Dimension; +import org.eclipse.draw2d.geometry.Insets; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.draw2d.graph.CompoundDirectedGraph; +import org.eclipse.draw2d.graph.Node; +import org.eclipse.draw2d.graph.Subgraph; +import org.eclipse.gef.EditPolicy; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.graphics.Image; + +import de.fzj.unicore.gpe4eclipse.GPEActivator; +import de.fzj.unicore.wfeditor.parts.ActivityPart; + +/** + * @author hudsonr + * Created on Jul 17, 2003 + */ +public class GridBeanActivityPart extends ActivityPart { + + public static final String REQ_SHOW_GRID_BEAN_VIEW = "show GridBean request"; + + public static final String CMD_SHOW_GRID_BEAN_VIEW = "show GridBean"; + + public GridBeanActivityPart(GridBeanActivity activity) + { + this.setModel(activity); + } + + /** + * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies() + */ + protected void createEditPolicies() { + super.createEditPolicies(); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ShowGridBeanViewPolicy()); + } + + public void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s, Map map) { + Node n = new Node(this, s); + n.outgoingOffset = getAnchorOffset(); + n.incomingOffset = getAnchorOffset(); + n.width = getFigure().getPreferredSize().width; + n.height = getFigure().getPreferredSize().height; + n.setPadding(new Insets(10,8,10,12)); + map.put(this, n); + graph.nodes.add(n); + } + + /** + * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure() + */ + protected IFigure createFigure() { + Point loc = getActivity().getLocation(); + Dimension size= getActivity().getSize(); + Rectangle r = new Rectangle(loc ,size); + + ImageDescriptor imageDescr = GPEActivator.getImageDescriptor("gridbean.gif"); + Image img = new Image(null, imageDescr.getImageData().scaledTo(r.width, r.height)); + + + Figure fig = new ImageFigure(img); + fig.setBounds(r); + return fig; + } + + protected int getAnchorOffset() { + return 9; + } + +// protected void performDirectEdit() { +// if (manager == null) { +// Label l = (Label)getFigure(); +// manager = +// new ActivityDirectEditManager( +// this, +// TextCellEditor.class, +// new ActivityCellEditorLocator(l), l); +// } +// manager.show(); +// } + + /** + * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals() + */ +// protected void refreshVisuals() { +// ((Label)getFigure()).setText(getActivity().getName()); +// } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewAction.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewAction.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewAction.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import java.util.List; + +import org.eclipse.gef.EditPart; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.CompoundCommand; +import org.eclipse.gef.requests.GroupRequest; +import org.eclipse.gef.ui.actions.SelectionAction; +import org.eclipse.ui.IWorkbenchPart; + +import de.fzj.unicore.gpe4eclipse.GPEActivator; + +/** + * An action to delete selected objects. + */ +public class ShowGridBeanViewAction +extends SelectionAction +{ + /** + * Constructs a <code>ShowGridBeanViewAction</code> using the specified part. + * @param part The part for this action + */ + public ShowGridBeanViewAction(IWorkbenchPart part) { + super(part); + setLazyEnablementCalculation(true); + } + + /** + * Returns <code>true</code> if the selected object is of type + * GridBeanActivityPart. + * @return <code>true</code> if the command should be enabled + */ + protected boolean calculateEnabled() { + Command cmd = createCommand(getSelectedObjects()); + if (cmd == null) + return false; + return cmd.canExecute(); + } + + public Command createCommand(List objects) { + if (objects.isEmpty() || objects.size() > 1) + return null; + if (!(objects.get(0) instanceof GridBeanActivityPart)) + return null; + GridBeanActivityPart part = (GridBeanActivityPart) objects.get(0); + GroupRequest req = new GroupRequest(GridBeanActivityPart.REQ_SHOW_GRID_BEAN_VIEW); + req.setEditParts(objects); + + CompoundCommand compoundCmd = new CompoundCommand(GridBeanActivityPart.CMD_SHOW_GRID_BEAN_VIEW); + for (int i = 0; i < objects.size(); i++) { + EditPart object = (EditPart) objects.get(i); + Command cmd = object.getCommand(req); + if (cmd != null) compoundCmd.add(cmd); + } + + if(compoundCmd.size() > 0) return compoundCmd; + else return null; + } + + /** + * Initializes this action's text and images. + */ + protected void init() { + super.init(); + setText("open GridBean"); + setToolTipText("Opens a new view with the GridBean's input panels."); + setId(getClass().getName()); + setImageDescriptor(GPEActivator.getImageDescriptor("gridbean.gif")); + setDisabledImageDescriptor(GPEActivator.getImageDescriptor("gridbean.gif")); + setEnabled(false); + } + + public void run() { + execute(createCommand(getSelectedObjects())); + } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewPolicy.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewPolicy.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/ShowGridBeanViewPolicy.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.editpolicies.AbstractEditPolicy; + +import de.fzj.unicore.gpe4eclipse.commands.ShowGridBeanViewCommand; + + +public class ShowGridBeanViewPolicy + extends AbstractEditPolicy +{ + + +public Command getCommand(Request request) { + if (GridBeanActivityPart.REQ_SHOW_GRID_BEAN_VIEW.equals(request.getType())) + { + return new ShowGridBeanViewCommand(); + } + return null; +} + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowEditorActionsExtension.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowEditorActionsExtension.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowEditorActionsExtension.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,69 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.jface.action.IAction; +import org.eclipse.ui.IWorkbenchPart; + +import de.fzj.unicore.wfeditor.extensionpoints.IEditorActionsExtensionPoint; + +/** + * @author demuth + * + */ +public class WorkflowEditorActionsExtension implements IEditorActionsExtensionPoint { + + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) + */ + public void setInitializationData(IConfigurationElement config, + String propertyName, Object data) throws CoreException { + // TODO Auto-generated method stub + + } + + + public List<IAction> getAdditionalEditorActions(QName contentDomain, IWorkbenchPart part) { + List<IAction> actions = new ArrayList<IAction>(); + actions.add(new ShowGridBeanViewAction(part)); + return actions; + } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPaletteEntryExtension.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPaletteEntryExtension.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPaletteEntryExtension.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,101 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.gef.palette.CombinedTemplateCreationEntry; +import org.eclipse.gef.palette.PaletteEntry; +import org.eclipse.gef.requests.SimpleFactory; + +import de.fzj.unicore.gpe4eclipse.GPEActivator; +import de.fzj.unicore.wfeditor.DefaultCreationTool; +import de.fzj.unicore.wfeditor.extensionpoints.IPaletteEntryExtensionPoint; + +/** + * @author demuth + * + */ +public class WorkflowPaletteEntryExtension implements +IPaletteEntryExtensionPoint { + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) + */ + public void setInitializationData(IConfigurationElement config, + String propertyName, Object data) throws CoreException { + // TODO Auto-generated method stub + + } + + /** + * contribute activity types to the UNICORE workflow editor + */ + public List<PaletteEntry> getAdditionalActivities(QName contentDomain) + { + List<PaletteEntry> entries = new ArrayList<PaletteEntry>(); + CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry( + "GridBean", + "Create a new GridBean Node", + GridBeanActivity.class, + new SimpleFactory(GridBeanActivity.class), + GPEActivator.getImageDescriptor("gridbean.gif"), + GPEActivator.getImageDescriptor("gridbean.gif") + ); + combined.setToolClass(DefaultCreationTool.class); + entries.add(combined); + return entries; + } + + /** + * contribute transition types to the UNICORE workflow editor + */ + public List<PaletteEntry> getAdditionalTransitions(QName contentDomain) + { + return null; + } + + + /** + * contribute tool types to the UNICORE workflow editor + */ + public List<PaletteEntry> getAdditionalTools(QName contentDomain) + { + return null; + } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPartFactoryExtension.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPartFactoryExtension.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/extensions/wfeditor/WorkflowPartFactoryExtension.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,67 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.extensions.wfeditor; + +import javax.xml.namespace.QName; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.gef.EditPart; + +import de.fzj.unicore.wfeditor.extensionpoints.IPartFactoryExtensionPoint; + +/** + * @author demuth + * + */ +public class WorkflowPartFactoryExtension implements IPartFactoryExtensionPoint { + + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) + */ + public void setInitializationData(IConfigurationElement config, + String propertyName, Object data) throws CoreException { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see de.fzj.unicore.wfeditor.extensionpoints.IPartFactoryExtensionPoint#createEditPart(javax.xml.namespace.QName, org.eclipse.gef.EditPart, java.lang.Object) + */ + public EditPart createEditPart(QName contentDomain, EditPart context, + Object model) { + if(model instanceof GridBeanActivity) return new GridBeanActivityPart((GridBeanActivity) model); + return null; + } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/IStageOutListViewer.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/IStageOutListViewer.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/IStageOutListViewer.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,27 @@ +package de.fzj.unicore.gpe4eclipse.gridbeans.stageing; + + +public interface IStageOutListViewer { + + /** + * Update the view to reflect the fact that an entry was added + * + * @param out + */ + public void addStageout(StageOut stage); + + /** + * Update the view to reflect the fact that an entry was removed + * + * @param out + */ + public void removeStageOut(StageOut stage); + + /** + * Update the view to reflect the fact that one of the entries + * was modified + * + * @param out + */ + public void updateStageOut(StageOut stage); +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOut.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOut.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOut.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,74 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.gridbeans.stageing; + + +/** + * @author demuth + * + */ +public class StageOut { + /** + * physical filename relative to the job uspace + */ + private String sourceFile; + + /** + * logical id used to identify the file in the GUI + */ + private String targetId; + + + public StageOut(String sourceFile, String targetId) + { + this.sourceFile = sourceFile; + this.targetId = targetId; + } + + public String getTargetId() { + return targetId; + } + + public void setTargetId(String globalTargetId) { + this.targetId = globalTargetId; + } + + public String getSourceFile() { + return sourceFile; + } + + public void setSourceFile(String physicalSourceFile) { + this.sourceFile = physicalSourceFile; + } + + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutContentProvider.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutContentProvider.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutContentProvider.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,100 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.gridbeans.stageing; + +import java.net.URI; +import java.net.URISyntaxException; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.Viewer; + + +/** + * The content provider class is responsible for + * providing objects to the view. It can wrap + * existing objects in adapters or simply return + * objects as-is. These objects may be sensitive + * to the current input of the view, or ignore + * it and always show the same content + * (like Task List, for example). + */ +class StageOutContentProvider implements IStructuredContentProvider, IStageOutListViewer{ + + Viewer viewer; + StageOutList stageList; + + public void inputChanged(Viewer v, Object oldInput, Object newInput) { + viewer = v; + if (newInput != null) + { + stageList = (StageOutList) newInput; + stageList.addChangeListener(this); + } + if (oldInput != null) + ((StageOutList) oldInput).removeChangeListener(this); + } + + + public void dispose() { + stageList.removeChangeListener(this); + } + + + public Object[] getElements(Object parent) { + if(parent instanceof StageOutList) + { + StageOutList siteList = (StageOutList) parent; + return siteList.getStages(); + } + return null; + } + /* (non-Javadoc) + * @see de.fzj.unicore.identity.sitelist.ISiteListViewer#addSite(de.fzj.unicore.identity.sitelist.Site) + */ + public void addStageout(StageOut out) { + viewer.refresh(); + } + /* (non-Javadoc) + * @see de.fzj.unicore.identity.sitelist.ISiteListViewer#removeSite(de.fzj.unicore.identity.sitelist.Site) + */ + public void removeStageOut(StageOut out) { + viewer.refresh(); + + } + /* (non-Javadoc) + * @see de.fzj.unicore.identity.sitelist.ISiteListViewer#updateSite(de.fzj.unicore.identity.sitelist.Site) + */ + public void updateStageOut(StageOut out) { + viewer.refresh(); + + } +} \ No newline at end of file Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutLabelProvider.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutLabelProvider.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutLabelProvider.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,57 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.gridbeans.stageing; + +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.swt.graphics.Image; + +class StageOutLabelProvider extends LabelProvider implements ITableLabelProvider { + /** + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) + */ + public String getColumnText(Object element, int columnIndex) { + String result = ""; + StageOut stage = (StageOut) element; + + if(columnIndex == StageOutTableViewer.getColumnFor(StageOutTableViewer.SOURCE_FILE)) result = stage.getSourceFile(); + else if (columnIndex == StageOutTableViewer.getColumnFor(StageOutTableViewer.TARGET_ID)) result = stage.getTargetId(); + + return result; + } + public Image getColumnImage(Object obj, int index) { + return getImage(obj); + } + public Image getImage(Object obj) { + return null; + } +} \ No newline at end of file Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutList.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutList.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutList.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,123 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.gridbeans.stageing; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author demuth + * + */ +public class StageOutList { + + Map<String, StageOut> stages = new ConcurrentHashMap<String, StageOut>(); + + /** views that are interested in model changes + */ + private Set changeListeners = new HashSet(); + + public StageOutList() + { + + } + + /** + * Add a stageing element to the list + * + * @param stage + */ + public void addStageOut(StageOut stage) + { + synchronized (stages) + { + String id = stage.getTargetId(); + stages.put(id, stage); + } + Iterator iterator = changeListeners.iterator(); + while (iterator.hasNext()) + ((IStageOutListViewer) iterator.next()).addStageout(stage); + } + + /** + * Remove a site from the site list + * + * @param stage + */ + public void removeStageOut(StageOut stage) + { + synchronized (stages) + { + String id = stage.getTargetId(); + stages.remove(id); + + } + Iterator iterator = changeListeners.iterator(); + while (iterator.hasNext()) + ((IStageOutListViewer) iterator.next()).removeStageOut(stage); + } + /** + * Update a site + * @param stage + */ + public void updateStageOut(StageOut stage) + { + Iterator iterator = changeListeners.iterator(); + while (iterator.hasNext()) + ((IStageOutListViewer) iterator.next()).updateStageOut(stage); + } + + public StageOut[] getStages() + { + synchronized (stages) + { + StageOut[] siteArr = stages.values().toArray(new StageOut[0]); + return siteArr; + } + } + + + + public void removeChangeListener(IStageOutListViewer viewer) { + changeListeners.remove(viewer); + } + + public void addChangeListener(IStageOutListViewer viewer) { + changeListeners.add(viewer); + } + +} Added: gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutTableCellModifier.java =================================================================== --- gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutTableCellModifier.java (rev 0) +++ gpe4eclipse/trunk/src/main/java/de/fzj/unicore/gpe4eclipse/gridbeans/stageing/StageOutTableCellModifier.java 2007-07-31 14:45:53 UTC (rev 1396) @@ -0,0 +1,115 @@ +/********************************************************************************* + * Copyright (c) 2006 Forschungszentrum Juelich GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * (1) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer at the end. Redistributions in + * binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * (2) Neither the name of Forschungszentrum Juelich GmbH nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * DISCLAIMER + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ********************************************************************************/ +package de.fzj.unicore.gpe4eclipse.gridbeans.stageing; + +import org.eclipse.jface.viewers.ICellModifier; +import org.eclipse.swt.widgets.TableItem; + +import de.fzj.unicore.identity.IdentityActivator; + +/** + * @author demuth + * + */ +public class StageOutTableCellModifier implements ICellModifier { + + private StageOutTableViewer stageOutTable; + + public StageOutTableCellModifier(StageOutTableViewer stageOutTable) + { + this.stageOutTable = stageOutTable; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String) + */ + public boolean canModify(Object element, String property) { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String) + */ + public Object getValue(Object element, String property) { + + StageOut stage = (StageOut) element; + Object result = null; + if(StageOutTableViewer.TARGET_ID.equals(property)) + { + result = stage.getTargetId(); + } + else if(StageOutTableViewer.SOURCE_FILE.equals(property)){ + result = stage.getSourceFile(); + } + + return result; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object) + */ + public void modify(Object element, String property, Object value) { + if(element instanceof TableItem) + { + TableItem item = (TableItem) element; + StageOut stage = (StageOut) item.getData(); + if(StageOutTableViewer.TARGET_ID.equals(property)){ + try { + String s = (String) value; + StageOutList stageList = stageOutTable.getStageOutList(); + // stages are identified by their targetIds + // => when the targetId changes, remove old stage a... [truncated message content] |