Search in sources :

Example 1 with CheckResultSourceInterface

use of org.pentaho.di.core.CheckResultSourceInterface in project pentaho-kettle by pentaho.

the class CheckResultDialog method getData.

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
    wFields.table.removeAll();
    for (int i = 0; i < remarks.size(); i++) {
        CheckResultInterface cr = remarks.get(i);
        if (show_successful_results || cr.getType() != CheckResultInterface.TYPE_RESULT_OK) {
            TableItem ti = new TableItem(wFields.table, SWT.NONE);
            // MB - Support both JobEntry and Step Checking
            // 6/25/07
            CheckResultSourceInterface sourceMeta = cr.getSourceInfo();
            if (sourceMeta != null) {
                ti.setText(1, sourceMeta.getName());
            } else {
                ti.setText(1, "<global>");
            }
            ti.setText(2, cr.getType() + " - " + cr.getTypeDesc());
            ti.setText(3, cr.getText());
            Color col = ti.getBackground();
            switch(cr.getType()) {
                case CheckResultInterface.TYPE_RESULT_OK:
                    col = green;
                    break;
                case CheckResultInterface.TYPE_RESULT_ERROR:
                    col = red;
                    break;
                case CheckResultInterface.TYPE_RESULT_WARNING:
                    col = yellow;
                    break;
                case CheckResultInterface.TYPE_RESULT_COMMENT:
                default:
                    break;
            }
            ti.setBackground(col);
        }
    }
    if (wFields.table.getItemCount() == 0) {
        wFields.clearAll(false);
    }
    wFields.setRowNums();
    wFields.optWidth(true);
    if (show_successful_results) {
        wlFields.setText(STRING_HIDE_REMARKS);
        wNoOK.setText(STRING_HIDE_SUCESSFUL);
    } else {
        wlFields.setText(STRING_SHOW_REMARKS);
        wNoOK.setText(STRING_SHOW_SUCESSFUL);
    }
    shell.layout();
}
Also used : CheckResultSourceInterface(org.pentaho.di.core.CheckResultSourceInterface) TableItem(org.eclipse.swt.widgets.TableItem) Color(org.eclipse.swt.graphics.Color) CheckResultInterface(org.pentaho.di.core.CheckResultInterface)

Aggregations

Color (org.eclipse.swt.graphics.Color)1 TableItem (org.eclipse.swt.widgets.TableItem)1 CheckResultInterface (org.pentaho.di.core.CheckResultInterface)1 CheckResultSourceInterface (org.pentaho.di.core.CheckResultSourceInterface)1