當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionManager.createActionPopupMenu方法代碼示例

本文整理匯總了Java中com.intellij.openapi.actionSystem.ActionManager.createActionPopupMenu方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionManager.createActionPopupMenu方法的具體用法?Java ActionManager.createActionPopupMenu怎麽用?Java ActionManager.createActionPopupMenu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.actionSystem.ActionManager的用法示例。


在下文中一共展示了ActionManager.createActionPopupMenu方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: installPopupHandler

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
public static MouseListener installPopupHandler(JComponent component, @NotNull final ActionGroup group, final String place, final ActionManager actionManager) {
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler popupHandler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      final ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
      popupMenu.getComponent().show(comp, x, y);
    }
  };
  component.addMouseListener(popupHandler);
  return popupHandler;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:PopupHandler.java

示例2: installFollowingSelectionTreePopup

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
public static MouseListener installFollowingSelectionTreePopup(final JTree tree, @NotNull final ActionGroup group, final String place, final ActionManager actionManager){
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler handler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      if (tree.getPathForLocation(x, y) != null && Arrays.binarySearch(tree.getSelectionRows(), tree.getRowForLocation(x, y)) > -1) { //do not show popup menu on rows other than selection
        final ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
        popupMenu.getComponent().show(comp, x, y);
      }
    }
  };
  tree.addMouseListener(handler);
  return handler;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:PopupHandler.java

示例3: handlePopup

import com.intellij.openapi.actionSystem.ActionManager; //導入方法依賴的package包/類
@Override
protected void handlePopup() {
  ActionManager actionManager = ActionManager.getInstance();
  ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(myArea.getPopupPlace(), myArea.getPopupActions());
  MouseEvent event = (MouseEvent)myInputEvent;
  popupMenu.getComponent().show(myArea.getNativeComponent(), event.getX(), event.getY());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:SelectionTool.java


注:本文中的com.intellij.openapi.actionSystem.ActionManager.createActionPopupMenu方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。