use of org.pentaho.di.trans.step.RowDistributionInterface in project pentaho-kettle by pentaho.
the class TransGraph method askUserForCustomDistributionMethod.
public RowDistributionInterface askUserForCustomDistributionMethod() {
List<PluginInterface> plugins = PluginRegistry.getInstance().getPlugins(RowDistributionPluginType.class);
if (Utils.isEmpty(plugins)) {
return null;
}
List<String> choices = new ArrayList<>();
for (PluginInterface plugin : plugins) {
choices.add(plugin.getName() + " : " + plugin.getDescription());
}
EnterSelectionDialog dialog = new EnterSelectionDialog(shell, choices.toArray(new String[choices.size()]), "Select distribution method", "Please select the row distribution method:");
if (dialog.open() != null) {
PluginInterface plugin = plugins.get(dialog.getSelectionNr());
try {
return (RowDistributionInterface) PluginRegistry.getInstance().loadClass(plugin);
} catch (Exception e) {
new ErrorDialog(shell, "Error", "Error loading row distribution plugin class", e);
return null;
}
} else {
return null;
}
}
Aggregations