use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class Spoon method addJobLog.
public void addJobLog() {
JobGraph activeJobGraph = getActiveJobGraph();
if (activeJobGraph != null) {
activeJobGraph.jobLogDelegate.addJobLog();
activeJobGraph.jobGridDelegate.addJobGrid();
}
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class Spoon method refreshGraph.
public void refreshGraph() {
if (shell.isDisposed()) {
return;
}
TabItem tabItem = tabfolder.getSelected();
if (tabItem == null) {
return;
}
TabMapEntry tabMapEntry = delegates.tabs.getTab(tabItem);
if (tabMapEntry != null) {
if (tabMapEntry.getObject() instanceof TransGraph) {
TransGraph transGraph = (TransGraph) tabMapEntry.getObject();
transGraph.redraw();
}
if (tabMapEntry.getObject() instanceof JobGraph) {
JobGraph jobGraph = (JobGraph) tabMapEntry.getObject();
jobGraph.redraw();
}
}
setShellText();
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class Spoon method paste.
public void paste() {
String clipContent = fromClipboard();
if (clipContent != null) {
//
try {
Document document = XMLHandler.loadXMLString(clipContent);
boolean transformation = XMLHandler.getSubNode(document, TransMeta.XML_TAG) != null;
boolean job = XMLHandler.getSubNode(document, JobMeta.XML_TAG) != null;
boolean steps = XMLHandler.getSubNode(document, Spoon.XML_TAG_TRANSFORMATION_STEPS) != null;
boolean jobEntries = XMLHandler.getSubNode(document, Spoon.XML_TAG_JOB_JOB_ENTRIES) != null;
if (transformation) {
pasteTransformation();
} else if (job) {
pasteJob();
} else if (steps) {
TransGraph transGraph = getActiveTransGraph();
if (transGraph != null && transGraph.getLastMove() != null) {
pasteXML(transGraph.getManagedObject(), clipContent, transGraph.getLastMove());
}
} else if (jobEntries) {
JobGraph jobGraph = getActiveJobGraph();
if (jobGraph != null && jobGraph.getLastMove() != null) {
pasteXML(jobGraph.getManagedObject(), clipContent, jobGraph.getLastMove());
}
}
} catch (KettleXMLException e) {
log.logError("Unable to paste", e);
}
}
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class Spoon method printJobFile.
private void printJobFile(JobMeta jobMeta) {
JobGraph jobGraph = getActiveJobGraph();
if (jobGraph == null) {
return;
}
PrintSpool ps = new PrintSpool();
Printer printer = ps.getPrinter(shell);
// Create an image of the screen
Point max = jobMeta.getMaximum();
Image img = jobGraph.getJobImage(printer, max.x, max.y, 1.0f);
ps.printImage(shell, img);
img.dispose();
ps.dispose();
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class GraphTest method testDelSelectionsJob.
@Test
public void testDelSelectionsJob() {
JobMeta jobMeta = mock(JobMeta.class);
Spoon spoon = mock(Spoon.class);
JobEntryCopy selected1 = mock(JobEntryCopy.class);
JobEntryCopy selected2 = mock(JobEntryCopy.class);
when(jobMeta.getSelectedEntries()).thenReturn(Arrays.asList(selected1, selected2));
JobGraph jobGraph = mock(JobGraph.class);
doCallRealMethod().when(jobGraph).setJobMeta(any(JobMeta.class));
doCallRealMethod().when(jobGraph).setSpoon(any(Spoon.class));
doCallRealMethod().when(jobGraph).delSelected(any(JobEntryCopy.class));
jobGraph.setJobMeta(jobMeta);
jobGraph.setSpoon(spoon);
jobGraph.delSelected(null);
verify(spoon).deleteJobEntryCopies(eq(jobMeta), AdditionalMatchers.aryEq(new JobEntryCopy[] { selected1, selected2 }));
}
Aggregations