@Override public void processPacket(Packet packet) { final Presence presence = ((Presence) packet); if (presence.getType() != Presence.Type.subscribe) return; LOG.info("Subscribe request from " + presence.getFrom()); if (myIgnoreList.isIgnored(presence.getFrom())) { LOG.info(presence.getFrom() + " in ignore list"); return; } if (isUserInMyContactListAndActive(presence.getFrom()) || Pico.isUnitTest()) { acceptSubscription(presence, true); return; } UIUtil.invokeLater( () -> acceptSubscription(presence, myUI.shouldAcceptSubscriptionRequest(presence))); }
private DefaultActionGroup createActionGroup() { DefaultActionGroup actionGroup = new DefaultActionGroup(); if (ApplicationManager.getApplication() == null || Pico.isUnitTest()) return actionGroup; addRefreshAction(actionGroup); myOpenFileAction = new OpenFileAction(myTree, myIdeFacade); myOpenFileAction.registerCustomShortcutSet( new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0)), myTree); AnAction diffAction = new DiffAction(myTree) { protected User getUser() { return myUser; } }; diffAction.registerCustomShortcutSet(CommonShortcuts.getDiff(), myTree); actionGroup.add(myOpenFileAction); actionGroup.add(diffAction); addToggleReadOnlyAction(actionGroup); return actionGroup; }