Code: Select all
@ActionID(
category = "Window",
id = "ste.netbeans.nblogmanager.logviewer.LogViewerShortcutAction"
)
@ActionRegistration(
displayName = "#CTL_LogViewerShortcutAction",
key = "DS-L" // Ctrl+Shift+L
)
@ActionReference(path = "Menu/Window", position = 5000)
@Messages({
"CTL_LogViewerShortcutAction=Show Log Viewer"
})
public final class LogViewerShortcutAction extends AbstractAction {
public LogViewerShortcutAction() {
putValue(NAME, Bundle.CTL_LogViewerShortcutAction());
}
@Override
public void actionPerformed(ActionEvent e) {
TopComponent tc = WindowManager.getDefault().findTopComponent("LogViewerTopComponent");
if (tc == null) {
tc = new LogViewerTopComponent();
}
tc.open();
tc.requestActive();
}
}