use of org.pentaho.di.ui.spoon.delegates.SpoonTreeDelegateExtension in project pentaho-kettle by pentaho.
the class RunConfigurationTreeDelegateExtension method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface log, Object extension) throws KettleException {
SpoonTreeDelegateExtension treeDelExt = (SpoonTreeDelegateExtension) extension;
int caseNumber = treeDelExt.getCaseNumber();
AbstractMeta meta = treeDelExt.getTransMeta();
String[] path = treeDelExt.getPath();
List<TreeSelection> objects = treeDelExt.getObjects();
TreeSelection object = null;
if (path[2].equals(RunConfigurationViewTreeExtension.TREE_LABEL)) {
switch(caseNumber) {
case 3:
object = new TreeSelection(path[2], RunConfiguration.class, meta);
break;
case 4:
try {
RunConfiguration runConfiguration = runConfigurationManager.load(path[3]);
if (!runConfiguration.isReadOnly()) {
object = new TreeSelection(path[3], runConfiguration, meta);
}
} catch (Exception e) {
// Do Nothing
}
break;
}
}
if (object != null) {
objects.add(object);
}
}
use of org.pentaho.di.ui.spoon.delegates.SpoonTreeDelegateExtension in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceTreeDelegateExtension method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface log, Object extension) throws KettleException {
SpoonTreeDelegateExtension treeDelExt = (SpoonTreeDelegateExtension) extension;
int caseNumber = treeDelExt.getCaseNumber();
if (!(treeDelExt.getTransMeta() instanceof TransMeta)) {
return;
}
TransMeta transMeta = (TransMeta) treeDelExt.getTransMeta();
String[] path = treeDelExt.getPath();
List<TreeSelection> objects = treeDelExt.getObjects();
TreeSelection object = null;
if (path[2].equals(STRING_DATA_SERVICES)) {
switch(caseNumber) {
case 3:
object = new TreeSelection(path[2], DataServiceMeta.class, transMeta);
break;
case 4:
try {
DataServiceMeta dataService = metaStoreUtil.getDataService(path[3], transMeta);
object = new TreeSelection(path[3], dataService, transMeta);
} catch (Exception e) {
// Do Nothing
}
break;
}
}
if (object != null) {
objects.add(object);
}
}
Aggregations