All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.dcca.client.view.DecoderTableMenu Maven / Gradle / Ivy

The newest version!
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();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy