Search in sources :

Example 1 with LogBrowser

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();
}
Also used : HasLogChannelInterface(org.pentaho.di.core.logging.HasLogChannelInterface) HasLogChannelInterface(org.pentaho.di.core.logging.HasLogChannelInterface) LogChannelInterface(org.pentaho.di.core.logging.LogChannelInterface) LogBrowser(org.pentaho.di.ui.spoon.trans.LogBrowser) LogParentProvidedInterface(org.pentaho.di.core.logging.LogParentProvidedInterface)

Example 2 with LogBrowser

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);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) DisposeListener(org.eclipse.swt.events.DisposeListener) Control(org.eclipse.swt.widgets.Control) StyledText(org.eclipse.swt.custom.StyledText) Composite(org.eclipse.swt.widgets.Composite) DisposeEvent(org.eclipse.swt.events.DisposeEvent) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment) LogBrowser(org.pentaho.di.ui.spoon.trans.LogBrowser)

Aggregations

LogBrowser (org.pentaho.di.ui.spoon.trans.LogBrowser)2 CTabItem (org.eclipse.swt.custom.CTabItem)1 StyledText (org.eclipse.swt.custom.StyledText)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 HasLogChannelInterface (org.pentaho.di.core.logging.HasLogChannelInterface)1 LogChannelInterface (org.pentaho.di.core.logging.LogChannelInterface)1 LogParentProvidedInterface (org.pentaho.di.core.logging.LogParentProvidedInterface)1