use of org.pentaho.di.ui.spoon.trans.LogBrowser in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceTestLogBrowser method attachToLogBrowser.
public void attachToLogBrowser(final LogChannelInterface logChannel) {
initStyledText(parentComposite);
LogBrowser logBrowser = new LogBrowser(logText, new LogParentProvidedInterface() {
@Override
public HasLogChannelInterface getLogChannelProvider() {
return new HasLogChannelInterface() {
@Override
public LogChannelInterface getLogChannel() {
return logChannel;
}
};
}
});
logBrowser.installLogSniffer();
}
use of org.pentaho.di.ui.spoon.trans.LogBrowser in project pentaho-kettle by pentaho.
the class JobLogDelegate method addJobLog.
public void addJobLog() {
//
if (jobGraph.extraViewComposite == null || jobGraph.extraViewComposite.isDisposed()) {
jobGraph.addExtraView();
} else {
if (jobLogTab != null && !jobLogTab.isDisposed()) {
// just set this one active and get out...
//
jobGraph.extraViewTabFolder.setSelection(jobLogTab);
return;
}
}
// Add a transLogTab : display the logging...
//
jobLogTab = new CTabItem(jobGraph.extraViewTabFolder, SWT.NONE);
jobLogTab.setImage(GUIResource.getInstance().getImageShowLog());
jobLogTab.setText(BaseMessages.getString(PKG, "JobGraph.LogTab.Name"));
jobLogComposite = new Composite(jobGraph.extraViewTabFolder, SWT.NONE);
jobLogComposite.setLayout(new FormLayout());
addToolBar();
Control toolbarControl = (Control) toolbar.getManagedObject();
// spoon.props.setLook( toolbarControl );
toolbarControl.setLayoutData(new FormData());
FormData fd = new FormData();
// First one in the left top corner
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
toolbarControl.setLayoutData(fd);
toolbarControl.setParent(jobLogComposite);
jobLogText = new StyledText(jobLogComposite, SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
spoon.props.setLook(jobLogText);
FormData fdText = new FormData();
fdText.left = new FormAttachment(0, 0);
fdText.right = new FormAttachment(100, 0);
fdText.top = new FormAttachment((Control) toolbar.getManagedObject(), 0);
fdText.bottom = new FormAttachment(100, 0);
jobLogText.setLayoutData(fdText);
logBrowser = new LogBrowser(jobLogText, jobGraph);
logBrowser.installLogSniffer();
// If the job is closed, we should dispose of all the logging information in the buffer and registry for it
//
jobGraph.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
if (jobGraph.job != null) {
KettleLogStore.discardLines(jobGraph.job.getLogChannelId(), true);
}
}
});
jobLogTab.setControl(jobLogComposite);
jobGraph.extraViewTabFolder.setSelection(jobLogTab);
}
Aggregations