Search in sources :

Example 1 with TransPainterExtension

use of org.pentaho.di.trans.TransPainterExtension in project pdi-dataservice-server-plugin by pentaho.

the class TransPainterStepExtensionPointPlugin method callExtensionPoint.

@Override
public void callExtensionPoint(LogChannelInterface log, Object object) throws KettleException {
    if (!(object instanceof TransPainterExtension)) {
        return;
    }
    TransPainterExtension extension = (TransPainterExtension) object;
    TransMeta transMeta = extension.transMeta;
    StepMeta stepMeta = extension.stepMeta;
    DataServiceMeta dataService = metaStoreUtil.getDataServiceByStepName(transMeta, stepMeta.getName());
    if (dataService != null && dataService.isUserDefined()) {
        // Is this step a data service provider?
        // 
        String image = dataService.isStreaming() ? "images/data-services-streaming.svg" : "images/data-services.svg";
        extension.gc.drawImage(image, getClass().getClassLoader(), extension.x1 - 13, extension.y1 - 8 + extension.iconsize);
        extension.areaOwners.add(new AreaOwner(AreaType.CUSTOM, extension.x1 - 13, extension.y1 - 8 + extension.iconsize, 16, 16, extension.offset, transMeta, stepMeta));
    }
}
Also used : AreaOwner(org.pentaho.di.core.gui.AreaOwner) TransPainterExtension(org.pentaho.di.trans.TransPainterExtension) TransMeta(org.pentaho.di.trans.TransMeta) StepMeta(org.pentaho.di.trans.step.StepMeta)

Aggregations

AreaOwner (org.pentaho.di.core.gui.AreaOwner)1 TransMeta (org.pentaho.di.trans.TransMeta)1 TransPainterExtension (org.pentaho.di.trans.TransPainterExtension)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1