Search in sources :

Example 1 with StepMenuExtension

use of org.pentaho.di.ui.spoon.trans.StepMenuExtension in project pentaho-kettle by pentaho.

the class SparkTuningPopupMenuExtensionPoint method callExtensionPoint.

@Override
public void callExtensionPoint(LogChannelInterface log, Object object) throws KettleException {
    StepMenuExtension extension = (StepMenuExtension) object;
    StepMeta stepMeta = extension.getTransGraph().getCurrentStep();
    XulMenupopup menu = extension.getMenu();
    List<String> tunableProperties = SparkTunableProperties.getProperties(stepMeta.getStepID());
    menu.getElementById("trans-graph-entry-spark-tuning").setDisabled(tunableProperties.isEmpty());
}
Also used : StepMenuExtension(org.pentaho.di.ui.spoon.trans.StepMenuExtension) StepMeta(org.pentaho.di.trans.step.StepMeta) XulMenupopup(org.pentaho.ui.xul.containers.XulMenupopup)

Example 2 with StepMenuExtension

use of org.pentaho.di.ui.spoon.trans.StepMenuExtension in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceStepMenuExtension method callExtensionPoint.

@Override
public void callExtensionPoint(LogChannelInterface log, Object object) throws KettleException {
    StepMenuExtension extension = (StepMenuExtension) object;
    TransMeta transMeta = extension.getTransGraph().getTransMeta();
    StepMeta stepMeta = extension.getTransGraph().getCurrentStep();
    XulMenupopup menu = extension.getMenu();
    DataServiceMeta dataService = metaStoreUtil.getDataServiceByStepName(transMeta, stepMeta.getName());
    Boolean hasDataService = dataService != null && dataService.isUserDefined();
    menu.getElementById("dataservices-new").setDisabled(hasDataService);
    menu.getElementById("dataservices-edit").setDisabled(!hasDataService);
    menu.getElementById("dataservices-delete").setDisabled(!hasDataService);
    menu.getElementById("dataservices-test").setDisabled(!hasDataService);
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) TransMeta(org.pentaho.di.trans.TransMeta) StepMenuExtension(org.pentaho.di.ui.spoon.trans.StepMenuExtension) StepMeta(org.pentaho.di.trans.step.StepMeta) XulMenupopup(org.pentaho.ui.xul.containers.XulMenupopup)

Aggregations

StepMeta (org.pentaho.di.trans.step.StepMeta)2 StepMenuExtension (org.pentaho.di.ui.spoon.trans.StepMenuExtension)2 XulMenupopup (org.pentaho.ui.xul.containers.XulMenupopup)2 TransMeta (org.pentaho.di.trans.TransMeta)1 DataServiceMeta (org.pentaho.di.trans.dataservice.DataServiceMeta)1