*/
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 (NoClassDefFoundError e) {
log.warn("Missing jar? Could not create " + name + ". " + e);
continue;
} catch (Exception e) {
log.warn("Could not instantiate " + name, e);
continue;
}
if (elementsToSkip.contains(name) || elementsToSkip.contains(item.getStaticLabel())) {
log.info("Skipping " + name);
continue;
} else {
elementsToSkip.add(name);
}
Collection<String> categories = item.getMenuCategories();
if (categories == null) {
log.debug(name + " participates in no menus.");
continue;
}
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(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(TABLES)) {
tables.add(new MenuInfo(item.getStaticLabel(), name));
}
if (categories.contains(REPORT_PAGE)) {
reportPage.add(new MenuInfo(item.getStaticLabel(), name));
}
}
} catch (IOException e) {
log.error("", e);
}