use of org.apache.hop.ui.hopgui.file.workflow.delegates.HopGuiWorkflowClipboardDelegate in project hop by apache.
the class HopGuiWorkflowHplFilenamePastedExtensionPoint method callExtensionPoint.
@Override
public void callExtensionPoint(ILogChannel log, IVariables variables, HopGuiWorkflowClipboardExtension wce) throws HopException {
HopGuiWorkflowClipboardDelegate clipboardDelegate = wce.workflowGraph.workflowClipboardDelegate;
WorkflowMeta workflowMeta = wce.workflowMeta;
HopGui hopGui = wce.workflowGraph.getHopGui();
// Pipeline?
//
HopPipelineFileType pipelineFileType = new HopPipelineFileType();
if (wce.filename.endsWith(pipelineFileType.getDefaultFileExtension())) {
// Add a new Pipeline action...
//
String name = clipboardDelegate.getUniqueName(workflowMeta, wce.file.getName());
ActionPipeline actionPipeline = new ActionPipeline(name);
actionPipeline.setFileName(wce.filename);
// Pick the first run configuration available...
//
List<String> names = hopGui.getMetadataProvider().getSerializer(PipelineRunConfiguration.class).listObjectNames();
if (!names.isEmpty()) {
actionPipeline.setRunConfiguration(names.get(0));
}
ActionMeta actionMeta = new ActionMeta(actionPipeline);
actionMeta.setLocation(new Point(wce.location));
workflowMeta.addAction(actionMeta);
hopGui.undoDelegate.addUndoNew(workflowMeta, new ActionMeta[] { actionMeta }, new int[] { workflowMeta.indexOfAction(actionMeta) });
// Shift the location for the next action
//
clipboardDelegate.shiftLocation(wce.location);
}
}
use of org.apache.hop.ui.hopgui.file.workflow.delegates.HopGuiWorkflowClipboardDelegate in project hop by apache.
the class HopGuiWorkflowHwfFilenamePastedExtensionPoint method callExtensionPoint.
@Override
public void callExtensionPoint(ILogChannel log, IVariables variables, HopGuiWorkflowClipboardExtension wce) throws HopException {
HopGuiWorkflowClipboardDelegate clipboardDelegate = wce.workflowGraph.workflowClipboardDelegate;
WorkflowMeta workflowMeta = wce.workflowMeta;
HopGui hopGui = wce.workflowGraph.getHopGui();
// Workflow?
//
HopWorkflowFileType workflowFileType = new HopWorkflowFileType<>();
if (wce.filename.endsWith(workflowFileType.getDefaultFileExtension())) {
// Add a new Workflow action...
//
String name = clipboardDelegate.getUniqueName(workflowMeta, wce.file.getName());
ActionWorkflow actionWorkflow = new ActionWorkflow(name);
actionWorkflow.setFileName(wce.filename);
// Pick the first run configuration available...
//
List<String> names = hopGui.getMetadataProvider().getSerializer(WorkflowRunConfiguration.class).listObjectNames();
if (!names.isEmpty()) {
actionWorkflow.setRunConfiguration(names.get(0));
}
ActionMeta actionMeta = new ActionMeta(actionWorkflow);
actionMeta.setLocation(new Point(wce.location));
workflowMeta.addAction(actionMeta);
hopGui.undoDelegate.addUndoNew(workflowMeta, new ActionMeta[] { actionMeta }, new int[] { workflowMeta.indexOfAction(actionMeta) });
// Shift the location for the next action
//
clipboardDelegate.shiftLocation(wce.location);
}
}
Aggregations