void () { super.createDefaultActions(); myOKAction = new OkAction(){ @Override public void actionPerformed(ActionEvent e) { super.actionPerformed(e); if (mySession != null && (e.getModifiers() & ADD_WATCH_MODIFIERS) == ADD_WATCH_MODIFIERS) { addToWatches(); } } }; }