当前位置: 首页>>代码示例>>Java>>正文


Java PopupFactoryImpl.ActionItem方法代码示例

本文整理汇总了Java中com.intellij.ui.popup.PopupFactoryImpl.ActionItem方法的典型用法代码示例。如果您正苦于以下问题:Java PopupFactoryImpl.ActionItem方法的具体用法?Java PopupFactoryImpl.ActionItem怎么用?Java PopupFactoryImpl.ActionItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.popup.PopupFactoryImpl的用法示例。


在下文中一共展示了PopupFactoryImpl.ActionItem方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preselectedIndex

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
private int preselectedIndex(Iterator items) {
    for( int index = 0; items.hasNext(); index++ ) {
        Object item = items.next();
        GuardPopupAction<?> action = null;
        if ( item instanceof GuardPopupAction ) {
            action = (GuardPopupAction)item;
        }
        else if ( item instanceof PopupFactoryImpl.ActionItem && ((PopupFactoryImpl.ActionItem)item).getAction() instanceof GuardPopupAction ) {
            action= (GuardPopupAction)((PopupFactoryImpl.ActionItem)item).getAction();
        }
        if ( action == null ) {
            continue;
        }
        if ( action.getSelectionKey() != null && action.getSelectionKey().isSelectableBy(selection) ) {
            return index;
        }
    }
    return -1;
}
 
开发者ID:Abnaxos,项目名称:guards,代码行数:20,代码来源:GuardPopupController.java

示例2: actionPerformed

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
@SuppressWarnings("SuspiciousMethodCalls")
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
    AnAction perform = whenSelected.get(list.getSelectedValue());
    if ( perform != null) {
        PopupFactoryImpl.ActionItem selected = (PopupFactoryImpl.ActionItem)list.getSelectedValue();
        if ( selected.isEnabled() && selected.equals(list.getSelectedValue()) ) {
            Presentation presentation = perform.getTemplatePresentation().clone();
            perform.update(event);
            perform.beforeActionPerformedUpdate(event);
            event = new AnActionEvent(
                    event.getInputEvent(), event.getDataContext(), event.getPlace(),
                    presentation, ActionManager.getInstance(), event.getModifiers());
            if ( presentation.isEnabled() ) {
                perform.actionPerformed(event);
            }
        }
    }
    else if ( selectItem != null ) {
        if ( selectItem.isEnabled() ) {
            list.setSelectedValue(selectItem, true);
            popup.handleSelect(selectHandleFinalChoices);
        }
    }
}
 
开发者ID:Abnaxos,项目名称:guards,代码行数:26,代码来源:ExtendedKeyboardActionDispatcher.java

示例3: getRootAction

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
@Nullable
private static RootAction getRootAction(Object value) {
  if (value instanceof PopupFactoryImpl.ActionItem) {
    AnAction action = ((PopupFactoryImpl.ActionItem)value).getAction();
    if (action instanceof RootAction) {
      return (RootAction)action;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:BranchActionGroupPopup.java

示例4: install

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
void install(JComponent component) {
    for( Object item : popup.getListStep().getValues() ) {
        if ( item instanceof PopupFactoryImpl.ActionItem ) {
            if ( ((PopupFactoryImpl.ActionItem)item).getAction() instanceof GuardPopupAction ) {
                ((GuardPopupAction)((PopupFactoryImpl.ActionItem)item).getAction())
                        .extendKeyboardActions(new Extender((PopupFactoryImpl.ActionItem)item));
            }
        }
    }
    for( Map.Entry<KeyStroke, Mapping> mapping : mappings.entrySet() ) {
        mapping.getValue().registerCustomShortcutSet(new CustomShortcutSet(mapping.getKey()), component);
    }
}
 
开发者ID:Abnaxos,项目名称:guards,代码行数:14,代码来源:ExtendedKeyboardActionDispatcher.java

示例5: getSpecificAction

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
private static <T> T getSpecificAction(Object value, @Nonnull Class<T> clazz) {
  if (value instanceof PopupFactoryImpl.ActionItem) {
    AnAction action = ((PopupFactoryImpl.ActionItem)value).getAction();
    if (clazz.isInstance(action)) {
      return clazz.cast(action);
    }
    else if (action instanceof EmptyAction.MyDelegatingActionGroup) {
      ActionGroup group = ((EmptyAction.MyDelegatingActionGroup)action).getDelegate();
      return clazz.isInstance(group) ? clazz.cast(group) : null;
    }
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:BranchActionGroupPopup.java

示例6: Extender

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
private Extender(PopupFactoryImpl.ActionItem actionItem) {
    this.actionItem = actionItem;
}
 
开发者ID:Abnaxos,项目名称:guards,代码行数:4,代码来源:ExtendedKeyboardActionDispatcher.java

示例7: shouldBeShowing

import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
@Override
public final boolean shouldBeShowing(Object value) {
  if (!super.shouldBeShowing(value)) return false;
  if (!(value instanceof PopupFactoryImpl.ActionItem)) return true;
  return shouldBeShowing(((PopupFactoryImpl.ActionItem)value).getAction());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:FlatSpeedSearchPopup.java


注:本文中的com.intellij.ui.popup.PopupFactoryImpl.ActionItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。