本文整理匯總了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;
}
示例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);
}
}
}
示例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);
}
}
示例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());
}
示例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);
}
}