if (name.endsWith("JMeterTreeNode") || name.endsWith("TestBeanGUI"))
{
continue;// Don't try to instantiate these
}
JMeterGUIComponent item;
try
{
Class c = Class.forName(name);
if (TestBean.class.isAssignableFrom(c))
{
item = new TestBeanGUI(c);
}
else
{
item = (JMeterGUIComponent) c.newInstance();
}
}
catch (Throwable e)
{
log.info("Could not instantiate "+name, e);
continue;
}
if (elementsToSkip.contains(name)
|| elementsToSkip.contains(item.getStaticLabel()))
{
log.info("Skipping "+name);
continue;
}
else
{
elementsToSkip.add(name);
}
Collection categories = item.getMenuCategories();
if (categories == null)
{
log.debug(name+" participates in no menus.");
continue;
}
if (categories.contains(TIMERS))
{
timers.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(POST_PROCESSORS))
{
postProcessors.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(PRE_PROCESSORS))
{
preProcessors.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(CONTROLLERS))
{
controllers.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(SAMPLERS))
{
samplers.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(NON_TEST_ELEMENTS))
{
nonTestElements.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(LISTENERS))
{
listeners.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(CONFIG_ELEMENTS))
{
configElements.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
if (categories.contains(ASSERTIONS))
{
assertions.add(
new MenuInfo(
item.getStaticLabel(),
name));
}
}
}