installKeyBindings();
addFocusListener(focusHandler);
}
private void installKeyBindings() {
KeyBindingInstaller installer = new KeyBindingInstaller(this);
installer.addBinding(KeyUtils.ENTER, "enter", new AbstractAction() { //$NON-NLS-1$
@Override
public void actionPerformed(ActionEvent e) {
focusHandler.focusLost(null);
}
});
installer.addBinding(KeyUtils.ESCAPE, "escape", new AbstractAction() { //$NON-NLS-1$
@Override
public void actionPerformed(ActionEvent e) {
listener.itemRenameCancelled();
removeFocusListener(focusHandler);
}
});
installer.install();
}