Hi
Is it possible to capture an event when the user presses F5 or uses the refresh menu item in the DITA menu?
I have following code, but this only gets triggered when the user presses the F5 key. Not when the menu item is clicked.
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.addKeyEventDispatcher(new KeyEventDispatcher() {
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_F5) {
try {
WorkItem workItem = AuthoringBridge.getWorkArea().getWorkItemByPath(getEditorLocation());
// Enable/disable the editor area
EditorHelper.setEditable(getEditorLocation(), workItem.getIsEditable());
} catch (MalformedURLException ex) {
Logging.writeError(this.getClass().getName() + ".addListeners", ex.toString());
}
}
return false;
}
});
Thanks in advance
Jan Bevers | Developer | SDL | Content Management Technologies Division | +32 (0)15 400 970 | jbevers@sdl.com