use of org.gephi.io.importer.spi.DatabaseImporterBuilder in project gephi by gephi.
the class ImportDB method getMenuPresenter.
@Override
public JMenuItem getMenuPresenter() {
JMenu menu = new JMenu(NbBundle.getMessage(ImportDB.class, "CTL_ImportDB"));
final ImportControllerUI importController = Lookup.getDefault().lookup(ImportControllerUI.class);
if (importController != null) {
for (final DatabaseImporterBuilder dbb : Lookup.getDefault().lookupAll(DatabaseImporterBuilder.class)) {
ImporterUI ui = importController.getImportController().getUI(dbb.buildImporter());
String menuName = dbb.getName();
if (ui != null) {
menuName = ui.getDisplayName();
}
JMenuItem menuItem = new JMenuItem(new AbstractAction(menuName) {
@Override
public void actionPerformed(ActionEvent e) {
importController.importDatabase(dbb.buildImporter());
}
});
menu.add(menuItem);
}
}
return menu;
}
Aggregations