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


Java DefaultActionGroup.getChildrenCount方法代碼示例

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


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

示例1: createActionGroupPopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
@Nullable
protected JBPopup createActionGroupPopup(PsiFile file, Project project, Editor editor) {
  final DefaultActionGroup group = new DefaultActionGroup();
  for (final IntentionAction action : IntentionManager.getInstance().getAvailableIntentionActions()) {
    if (shouldShowInGutterPopup(action) && action.isAvailable(project, editor, file)) {
      group.add(new ApplyIntentionAction(action, action.getText(), editor, file));
    }
  }

  if (group.getChildrenCount() > 0) {
    final DataContext context = SimpleDataContext.getProjectContext(null);
    return JBPopupFactory.getInstance()
      .createActionGroupPopup(null, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true);
  }

  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ExternalAnnotationsLineMarkerProvider.java

示例2: selectionChanged

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
protected void selectionChanged(RadComponent component, boolean selected) {
  ListenerNavigateButton btn = myNavigateButtons.get(component);
  if (selected) {
    DefaultActionGroup group = component.getBinding() != null ? ListenerNavigateButton.prepareActionGroup(component) : null;
    if (group != null && group.getChildrenCount() > 0) {
      if (btn == null) {
        btn = new ListenerNavigateButton(component);
        myNavigateButtons.put(component, btn);
      }
      add(btn);
      btn.setVisible(true);
    }
    else {
      if (btn != null) {
        btn.setVisible(false);
      }
    }
  }
  else {
    if (btn != null) {
      btn.setVisible(false);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:ActiveDecorationLayer.java

示例3: addActionBlock

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public static void addActionBlock(@NotNull DefaultActionGroup group, AnAction... actions) {
  if (actions.length == 0) return;
  if (group.getChildrenCount() != 0) group.addSeparator();

  for (AnAction action : actions) {
    if (action != null) group.add(action);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:DiffUtil.java

示例4: handlePopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
private void handlePopup(final MouseEvent e) {
  if (e.getClickCount() != 1 || !e.isPopupTrigger()) return;

  if (e.getX() < 0 || e.getX() >= e.getComponent().getWidth() || e.getY() < 0 || e.getY() >= e.getComponent().getHeight()) return;

  String place = myTabs.getPopupPlace();
  place = place != null ? place : ActionPlaces.UNKNOWN;
  myTabs.myPopupInfo = myInfo;

  final DefaultActionGroup toShow = new DefaultActionGroup();
  if (myTabs.getPopupGroup() != null) {
    toShow.addAll(myTabs.getPopupGroup());
    toShow.addSeparator();
  }

  JBTabsImpl tabs =
    JBTabsImpl.NAVIGATION_ACTIONS_KEY.getData(DataManager.getInstance().getDataContext(e.getComponent(), e.getX(), e.getY()));
  if (tabs == myTabs && myTabs.myAddNavigationGroup) {
    toShow.addAll(myTabs.myNavigationActions);
  }

  if (toShow.getChildrenCount() == 0) return;

  myTabs.myActivePopup = myTabs.myActionManager.createActionPopupMenu(place, toShow).getComponent();
  myTabs.myActivePopup.addPopupMenuListener(myTabs.myPopupListener);

  myTabs.myActivePopup.addPopupMenuListener(myTabs);
  myTabs.myActivePopup.show(e.getComponent(), e.getX(), e.getY());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:TabLabel.java

示例5: showNavigatePopup

import com.intellij.openapi.actionSystem.DefaultActionGroup; //導入方法依賴的package包/類
public static void showNavigatePopup(final RadComponent component, final boolean showIfEmpty) {
  final DefaultActionGroup actionGroup = prepareActionGroup(component);
  if (actionGroup != null && actionGroup.getChildrenCount() == 0 && showIfEmpty) {
    actionGroup.add(new MyNavigateAction(UIDesignerBundle.message("navigate.to.listener.empty"), null));
  }
  if (actionGroup != null && actionGroup.getChildrenCount() > 0) {
    final DataContext context = DataManager.getInstance().getDataContext(component.getDelegee());
    final JBPopupFactory factory = JBPopupFactory.getInstance();
    final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("navigate.to.listener.title"), actionGroup, context,
                                                           JBPopupFactory.ActionSelectionAid.NUMBERING, true);
    FormEditingUtil.showPopupUnderComponent(popup, component);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ListenerNavigateButton.java


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