org.bidib.wizard.dcca.client.view.DecoderTableMenu Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-dcca-client Show documentation
Show all versions of bidibwizard-dcca-client Show documentation
jBiDiB BiDiB Wizard DCC-A client POM
package org.bidib.wizard.dcca.client.view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import org.bidib.wizard.api.locale.Resources;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DecoderTableMenu extends JPopupMenu {
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = LoggerFactory.getLogger(DecoderTableMenu.class);
private JMenuItem clearContentItem;
private final DccAdvView activeDecoderSource;
public DecoderTableMenu(final DccAdvView activeDecoderSource) {
this.activeDecoderSource = activeDecoderSource;
clearContentItem = new JMenuItem(Resources.getString(getClass(), "clear"));
clearContentItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
fireClearContent(e);
}
});
add(clearContentItem);
}
private void fireClearContent(ActionEvent e) {
LOGGER.info("Clear the active decoders list.");
activeDecoderSource.clearActiveDecodersList();
}
}