ActionButton () { NewPackageAction newPackageAction = new NewPackageAction(); newPackageAction.enableInModalContext(); ShortcutSet shortcutSet = ActionManager.getInstance().getAction(IdeActions.ACTION_NEW_ELEMENT).getShortcutSet(); newPackageAction.registerCustomShortcutSet(shortcutSet, myTree); return new ActionButton( newPackageAction, null, ActionPlaces.UNKNOWN, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE ); }