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 = 102),
48 @ActionReference(path =
"Toolbars/Case", position = 103)})
51 private static final long serialVersionUID = 1L;
52 private final JButton toolbarButton =
new JButton(getName(),
53 new ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/images/blueGeo24.png")));
56 "OpenGeolocationAction_name=Geolocation",
57 "OpenGeolocationAction_displayName=Geolocation"
64 toolbarButton.addActionListener(actionEvent -> performAction());
67 PropertyChangeListener caseChangeListener = (PropertyChangeEvent evt) -> {
78 final TopComponent topComponent = WindowManager.getDefault().findTopComponent(
"GeolocationTopComponent");
79 if (topComponent != null) {
80 if (topComponent.isOpened() ==
false) {
83 topComponent.toFront();
84 topComponent.requestActive();
95 super.setEnabled(value);
96 toolbarButton.setEnabled(value);
101 return Bundle.OpenGeolocationAction_displayName();
111 return toolbarButton;
116 return HelpCtx.DEFAULT_HELP;
static boolean runningWithGUI
Component getToolbarPresenter()
static void addPropertyChangeListener(PropertyChangeListener listener)
void setEnabled(boolean value)