19 package org.sleuthkit.autopsy.geolocation;
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.Messages;
32 import org.openide.util.actions.CallableSystemAction;
33 import org.openide.windows.TopComponent;
34 import org.openide.windows.WindowManager;
43 @ActionID(category =
"Tools",
44 id =
"org.sleuthkit.autopsy.geolocation.OpenGeolocationAction")
45 @ActionRegistration(displayName =
"#CTL_OpenGeolocation", lazy =
false)
46 @ActionReferences(value = {
47 @ActionReference(path =
"Menu/Tools", position = 103),
48 @ActionReference(path =
"Toolbars/Case", position = 103)})
49 @Messages({
"CTL_OpenGeolocation=Geolocation"})
52 private static final long serialVersionUID = 1L;
53 private final JButton toolbarButton =
new JButton(getName(),
54 new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/blueGeo24.png")));
60 toolbarButton.addActionListener(actionEvent -> performAction());
63 PropertyChangeListener caseChangeListener = (PropertyChangeEvent evt) -> {
74 final TopComponent topComponent = WindowManager.getDefault().findTopComponent(
"GeolocationTopComponent");
75 if (topComponent != null) {
76 if (topComponent.isOpened() ==
false) {
79 topComponent.toFront();
80 topComponent.requestActive();
91 super.setEnabled(value);
92 toolbarButton.setEnabled(value);
97 return Bundle.CTL_OpenGeolocation();
107 return toolbarButton;
112 return HelpCtx.DEFAULT_HELP;
static boolean runningWithGUI
Component getToolbarPresenter()
static void addPropertyChangeListener(PropertyChangeListener listener)
void setEnabled(boolean value)