public void showContextMenu(Component comp, int x, int y, ActionGroup toolWindowGroup, @Nullable Content selectedContent) { if (selectedContent == null && toolWindowGroup == null) { return; } DefaultActionGroup group = new DefaultActionGroup(); if (selectedContent != null) { initActionGroup(group, selectedContent); } if (toolWindowGroup != null) { group.addAll(toolWindowGroup); } final ActionPopupMenu popupMenu = ((ActionManagerImpl)ActionManager.getInstance()).createActionPopupMenu(POPUP_PLACE, group, new MenuItemPresentationFactory(true)); popupMenu.getComponent().show(comp, x, y); }
public IdeMenuBar(ActionManagerEx actionManager, DataManager dataManager) { myActionManager = actionManager; myTimerListener = new MyTimerListener(); myVisibleActions = new ArrayList<AnAction>(); myNewVisibleActions = new ArrayList<AnAction>(); myPresentationFactory = new MenuItemPresentationFactory(); myDataManager = dataManager; if (WindowManagerEx.getInstanceEx().isFloatingMenuBarSupported()) { myAnimator = new MyAnimator(); myActivationWatcher = new Timer(100, new MyActionListener()); myClockPanel = new ClockPanel(); myButton = new MyExitFullScreenButton(); add(myClockPanel); add(myButton); addPropertyChangeListener(WindowManagerEx.FULL_SCREEN, evt -> updateState()); addMouseListener(new MyMouseListener()); } else { myAnimator = null; myActivationWatcher = null; myClockPanel = null; myButton = null; } }
private void showDevicesPopup(Component component, int x, int y, DefaultActionGroup defaultActionGroup) { ActionPopupMenu popupMenu = ((ActionManagerImpl) ActionManager.getInstance()) .createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, defaultActionGroup, new MenuItemPresentationFactory(false));// don't set forceHide to true, otherwise icons will be hidden in menu item popupMenu.getComponent().show(component, x, y); }
public IdeMenuBar(ActionManagerEx actionManager, DataManager dataManager) { myActionManager = actionManager; myTimerListener = new MyTimerListener(); myVisibleActions = new ArrayList<AnAction>(); myNewVisibleActions = new ArrayList<AnAction>(); myPresentationFactory = new MenuItemPresentationFactory(); myDataManager = dataManager; if (WindowManagerImpl.isFloatingMenuBarSupported()) { myAnimator = new MyAnimator(); myActivationWatcher = new Timer(100, new MyActionListener()); myClockPanel = new ClockPanel(); myButton = new MyExitFullScreenButton(); add(myClockPanel); add(myButton); addPropertyChangeListener(WindowManagerImpl.FULL_SCREEN, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { updateState(); } }); addMouseListener(new MyMouseListener()); } else { myAnimator = null; myActivationWatcher = null; myClockPanel = null; myButton = null; } }
@Override public void update(AnActionEvent e) { super.update(e); Presentation presentation = e.getPresentation(); ActionPresentation actionPresentation = myAction.getPresentation(); if (presentation.getClientProperty(MenuItemPresentationFactory.HIDE_ICON) == null) { presentation.setIcon(actionPresentation.getIcon()); } presentation.setText(actionPresentation.getText()); }
public IdeMenuBar(ActionManagerEx actionManager, DataManager dataManager) { myActionManager = actionManager; myTimerListener = new MyTimerListener(); myVisibleActions = new ArrayList<AnAction>(); myNewVisibleActions = new ArrayList<AnAction>(); myPresentationFactory = new MenuItemPresentationFactory(); myDataManager = dataManager; if (WindowManagerImpl.isFloatingMenuBarSupported()) { myAnimator = new MyAnimator(); Toolkit.getDefaultToolkit().addAWTEventListener(new MyAWTEventListener(), AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK); myActivationWatcher = new Timer(100, new MyActionListener()); myClockPanel = new ClockPanel(); add(myClockPanel); addPropertyChangeListener(WindowManagerImpl.FULL_SCREEN, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { updateState(); } }); addMouseListener(new MyMouseListener()); } else { myAnimator = null; myActivationWatcher = null; myClockPanel = null; } }
public WebIdeRootView(Project project) { myProject = project; myRootPanel.setSizeFull(); myPresentationFactory = new MenuItemPresentationFactory(); myRootPanel.putUserData(CommonDataKeys.PROJECT, myProject); myMenuBar = MenuBar.create(); myRootPanel.setMenuBar(myMenuBar); }
private void showGearPopup(Component component, int x, int y) { ActionPopupMenu popupMenu = ((ActionManagerImpl) ActionManager.getInstance()) .createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, createGearPopupGroup(), new MenuItemPresentationFactory(true)); popupMenu.getComponent().show(component, x, y); }
private void showGearPopup(Component component, int x, int y) { ActionPopupMenu popupMenu = ((ActionManagerImpl)ActionManager.getInstance()) .createActionPopupMenu(ToolWindowContentUi.POPUP_PLACE, createGearPopupGroup(), new MenuItemPresentationFactory(true)); popupMenu.getComponent().show(component, x, y); }
private void showGearPopup(Component component, int x, int y) { ActionPopupMenu popupMenu = ((ActionManagerImpl)ActionManager.getInstance()).createActionPopupMenu(ToolWindowContentUI.POPUP_PLACE, createGearPopupGroup(), new MenuItemPresentationFactory(true)); popupMenu.getComponent().show(component, x, y); }