@Override
public void actionPerformed(ActionEvent e) {
final Collection<AnalyzerBeanDescriptor<?>> descriptors = _configuration.getDescriptorProvider()
.getAnalyzerBeanDescriptors();
final JPopupMenu popup = new DescriptorPopupMenu<AnalyzerBeanDescriptor<?>>(descriptors) {
private static final long serialVersionUID = 1L;
@Override
protected JMenuItem createMenuItem(final AnalyzerBeanDescriptor<?> descriptor) {
if (descriptor.getAnnotation(OutputWriterAnalyzer.class) != null) {
return null;
}
if (descriptor.isExploringAnalyzer()) {
return null;
}
JMenuItem menuItem = new DescriptorMenuItem(descriptor);
menuItem.addActionListener(new ActionListener() {
@SuppressWarnings("unchecked")
@Override
public void actionPerformed(ActionEvent e) {
Class<?> analyzerClass = descriptor.getComponentClass();
if (descriptor.isExploringAnalyzer()) {
_analysisJobBuilder.addExploringAnalyzer((Class<? extends ExploringAnalyzer<?>>) analyzerClass);
} else {
_analysisJobBuilder
.addRowProcessingAnalyzer((Class<? extends RowProcessingAnalyzer<?>>) analyzerClass);
}
UsageLogger.getInstance().log("Add analyzer: " + descriptor.getDisplayName());
}
});
return menuItem;
}
};
Component source = (Component) e.getSource();
popup.show(source, 0, source.getHeight());
}