本文整理汇总了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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例6: Extender
import com.intellij.ui.popup.PopupFactoryImpl; //导入方法依赖的package包/类
private Extender(PopupFactoryImpl.ActionItem actionItem) {
this.actionItem = actionItem;
}
示例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());
}