/**
* Create the drop-down list to changer render
* @return List of all render (implement ResultsRender)
*/
private Component createComboRender() {
ComboBoxModel nodesModel = new DefaultComboBoxModel();
// drop-down list for renderer
selectRenderPanel = new JComboBox(nodesModel);
selectRenderPanel.setActionCommand(COMBO_CHANGE_COMMAND);
selectRenderPanel.addActionListener(this);
// if no results render in jmeter.properties, load Standard (default)
List<String> classesToAdd = Collections.<String>emptyList();
try {
classesToAdd = JMeterUtils.findClassesThatExtend(ResultRenderer.class);
} catch (IOException e1) {
// ignored
}
String textRenderer = JMeterUtils.getResString("view_results_render_text"); // $NON-NLS-1$
Object textObject = null;
for (String clazz : classesToAdd) {
try {
// Instantiate render classes
final ResultRenderer renderer = (ResultRenderer) Class.forName(clazz).newInstance();
if (textRenderer.equals(renderer.toString())){
textObject=renderer;
}
renderer.setBackgroundColor(getBackground());
selectRenderPanel.addItem(renderer);
} catch (Exception e) {
log.warn("Error in load result render:" + clazz, e);
}
}
nodesModel.setSelectedItem(textObject); // preset to "Text" option
return selectRenderPanel;
}