本文整理汇总了Java中com.intellij.openapi.actionSystem.impl.PresentationFactory.getPresentation方法的典型用法代码示例。如果您正苦于以下问题:Java PresentationFactory.getPresentation方法的具体用法?Java PresentationFactory.getPresentation怎么用?Java PresentationFactory.getPresentation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.actionSystem.impl.PresentationFactory
的用法示例。
在下文中一共展示了PresentationFactory.getPresentation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendActionsFromGroup
import com.intellij.openapi.actionSystem.impl.PresentationFactory; //导入方法依赖的package包/类
private void appendActionsFromGroup(final ActionGroup group) {
final AnAction[] actions = group.getChildren(null);
PresentationFactory factory = new PresentationFactory();
for (final AnAction action : actions) {
if (action instanceof ActionGroup) {
final ActionGroup childGroup = (ActionGroup)action;
appendActionsFromGroup(childGroup);
}
else {
Presentation presentation = factory.getPresentation(action);
action.update(new AnActionEvent(null, DataManager.getInstance().getDataContext(myMainPanel),
ActionPlaces.WELCOME_SCREEN, presentation, ActionManager.getInstance(), 0));
if (presentation.isVisible()) {
appendButtonForAction(action);
}
}
}
}
示例2: fillActions
import com.intellij.openapi.actionSystem.impl.PresentationFactory; //导入方法依赖的package包/类
private void fillActions(JPanel root, final ActionGroup group, boolean quickStart) {
final AnAction[] actions = group.getChildren(null);
PresentationFactory factory = new PresentationFactory();
for (final AnAction action : actions) {
if (action instanceof ActionGroup) {
final ActionGroup childGroup = (ActionGroup)action;
fillActions(root, childGroup, quickStart);
}
else {
Presentation presentation = factory.getPresentation(action);
action.update(new AnActionEvent(null, DataManager.getInstance().getDataContext(root),
ActionPlaces.WELCOME_SCREEN, presentation, ActionManager.getInstance(), 0));
if (presentation.isVisible()) {
if (quickStart) {
myQuickStartButtons.add(new DarculaQuickStartButton(action));
} else {
myHelpButtons.add(new DarculaHelpButton(action));
}
}
}
}
}
示例3: createButton
import com.intellij.openapi.actionSystem.impl.PresentationFactory; //导入方法依赖的package包/类
@NotNull
private static ActionButton createButton(@NotNull final AnAction action) {
PresentationFactory presentationFactory = new PresentationFactory();
Icon icon = AllIcons.Actions.AllLeft;
Dimension size = new Dimension(icon.getIconWidth(), icon.getIconHeight());
return new ActionButton(action, presentationFactory.getPresentation(action), MOVE_PANEL_PLACE, size);
}
示例4: createButton
import com.intellij.openapi.actionSystem.impl.PresentationFactory; //导入方法依赖的package包/类
@Nonnull
private static ActionButton createButton(@Nonnull final AnAction action) {
PresentationFactory presentationFactory = new PresentationFactory();
Icon icon = AllIcons.Actions.AllLeft;
Dimension size = new Dimension(icon.getIconWidth(), icon.getIconHeight());
return new ActionButton(action, presentationFactory.getPresentation(action), MOVE_PANEL_PLACE, size);
}