Search in sources :

Example 1 with ExporterClassUI

use of org.gephi.desktop.io.export.spi.ExporterClassUI in project gephi by gephi.

the class Export method getMenuPresenter.

@Override
public JMenuItem getMenuPresenter() {
    for (final ExporterClassUI ui : Lookup.getDefault().lookupAll(ExporterClassUI.class)) {
        String menuName = ui.getName();
        JMenuItem menuItem = new JMenuItem(new AbstractAction(menuName) {

            @Override
            public void actionPerformed(ActionEvent e) {
                ui.action();
            }
        });
        menu.add(menuItem);
        menuItem.setEnabled(ui.isEnable());
    }
    return menu;
}
Also used : ActionEvent(java.awt.event.ActionEvent) ExporterClassUI(org.gephi.desktop.io.export.spi.ExporterClassUI) JMenuItem(javax.swing.JMenuItem) AbstractAction(javax.swing.AbstractAction)

Aggregations

ActionEvent (java.awt.event.ActionEvent)1 AbstractAction (javax.swing.AbstractAction)1 JMenuItem (javax.swing.JMenuItem)1 ExporterClassUI (org.gephi.desktop.io.export.spi.ExporterClassUI)1