19 package org.sleuthkit.autopsy.communications;
 
   21 import java.awt.Component;
 
   22 import java.beans.PropertyChangeEvent;
 
   23 import java.beans.PropertyChangeListener;
 
   24 import javax.swing.ImageIcon;
 
   25 import javax.swing.JButton;
 
   26 import org.openide.awt.ActionID;
 
   27 import org.openide.awt.ActionReference;
 
   28 import org.openide.awt.ActionReferences;
 
   29 import org.openide.awt.ActionRegistration;
 
   30 import org.openide.util.HelpCtx;
 
   31 import org.openide.util.NbBundle;
 
   32 import org.openide.util.NbBundle.Messages;
 
   33 import org.openide.util.actions.CallableSystemAction;
 
   34 import org.openide.windows.TopComponent;
 
   35 import org.openide.windows.WindowManager;
 
   43 @ActionID(category = 
"Tools",
 
   44         id = 
"org.sleuthkit.autopsy.communicationsVisualization.OpenCVTAction")
 
   45 @ActionRegistration(displayName = 
"#CTL_OpenCVTAction", lazy = 
false)
 
   46 @ActionReferences(value = {
 
   47     @ActionReference(path = 
"Menu/Tools", position = 102)
 
   49  @ActionReference(path = 
"Toolbars/Case", position = 102)})
 
   50 @Messages(
"CTL_OpenCVTAction=Communications")
 
   53     private static final long serialVersionUID = 1L;
 
   54     private final PropertyChangeListener 
pcl;
 
   55     private final JButton toolbarButton = 
new JButton(getName(),
 
   56             new ImageIcon(getClass().getResource(
"images/emblem-web24.png"))); 
 
   59         toolbarButton.addActionListener(actionEvent -> performAction());
 
   61         pcl = (PropertyChangeEvent evt) -> {
 
   72         final TopComponent tc = WindowManager.getDefault().findTopComponent(
"CVTTopComponent");
 
   74             if (tc.isOpened() == 
false) {
 
   89         super.setEnabled(value);
 
   90         toolbarButton.setEnabled(value);
 
   94     @NbBundle.Messages(
"OpenCVTAction.displayName=Communications")
 
   96         return Bundle.OpenCVTAction_displayName();
 
  106         return toolbarButton;
 
  111         return HelpCtx.DEFAULT_HELP;
 
static boolean runningWithGUI
static void addPropertyChangeListener(PropertyChangeListener listener)