19 package org.sleuthkit.autopsy.communications;
21 import java.util.Collection;
22 import java.util.stream.Collectors;
23 import javax.swing.AbstractAction;
24 import javax.swing.ImageIcon;
25 import javax.swing.JMenuItem;
26 import org.openide.util.Utilities;
27 import org.openide.util.actions.Presenter;
35 abstract class AbstractCVTAction
extends AbstractAction implements Presenter.Popup {
42 Collection<? extends AccountDeviceInstance> getSelectedAccounts() {
43 return Utilities.actionsGlobalContext().lookupAll(AccountDeviceInstanceKey.class)
45 .map((adiKey -> adiKey.getAccountDeviceInstance()))
46 .collect(Collectors.toSet());
50 public JMenuItem getPopupPresenter() {
51 JMenuItem presenter =
new JMenuItem(
this);
52 presenter.setText(getActionDisplayName());
53 presenter.setIcon(getIcon());
62 abstract String getActionDisplayName();
69 abstract ImageIcon getIcon();