Java 类com.intellij.openapi.actionSystem.impl.MenuItemPresentationFactory 实例源码

项目:intellij-ce-playground    文件:ToolWindowContentUi.java   
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);
}
项目:tools-idea    文件:ToolWindowContentUi.java   
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);
}
项目:consulo    文件:UnifiedToolWindowContentUI.java   
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);
}
项目:consulo    文件:IdeMenuBar.java   
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;
  }
}
项目:consulo    文件:DesktopToolWindowContentUi.java   
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);
}
项目:react-native-console    文件:RunIOSDevicesAction.java   
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);
}
项目:intellij-ce-playground    文件:IdeMenuBar.java   
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;
  }
}
项目:intellij-ce-playground    文件:TreeActionWrapper.java   
@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());
}
项目:tools-idea    文件:IdeMenuBar.java   
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;
  }
}
项目:tools-idea    文件:TreeActionWrapper.java   
@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());
}
项目:consulo    文件:WebIdeRootView.java   
public WebIdeRootView(Project project) {
  myProject = project;
  myRootPanel.setSizeFull();
  myPresentationFactory = new MenuItemPresentationFactory();

  myRootPanel.putUserData(CommonDataKeys.PROJECT, myProject);
  myMenuBar = MenuBar.create();
  myRootPanel.setMenuBar(myMenuBar);
}
项目:consulo    文件:TreeActionWrapper.java   
@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());
}
项目:react-native-console    文件:ShowRNConsoleAction.java   
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);
}
项目:intellij-ce-playground    文件:LightToolWindow.java   
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);
}
项目:tools-idea    文件:LightToolWindow.java   
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);
}
项目:cordovastudio    文件:LightToolWindow.java   
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);
}
项目:consulo    文件:LightToolWindow.java   
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);
}