本文整理汇总了Java中com.intellij.ui.PopupHandler类的典型用法代码示例。如果您正苦于以下问题:Java PopupHandler类的具体用法?Java PopupHandler怎么用?Java PopupHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PopupHandler类属于com.intellij.ui包,在下文中一共展示了PopupHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureActions
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
private void configureActions() {
createExecuteDocumentAction();
actionGroup.addSeparator();
createVersionSwitcherAction();
actionGroup.addSeparator();
createOpenDocumentAction();
actionGroup.addSeparator();
createRefreshRepositoryAction();
toolBar.updateActionsImmediately();
// Context menu with the plugin actions.
getRepositoryTree().addMouseListener(new PopupHandler() {
@Override
public void invokePopup(final Component comp, final int x, final int y) {
ActionPopupMenu actionPopupMenu = ActionManager.getInstance().createActionPopupMenu("LivingDoc.RepositoryViewToolbar", actionGroup);
actionPopupMenu.getComponent().show(comp, x, y);
}
});
}
示例2: createTrees
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
@Override
protected void createTrees(@NotNull final Map<String, JTree> type2TreeMap) {
ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_CALL_HIERARCHY_POPUP);
final JTree tree1 = createTree(false);
PopupHandler.installPopupHandler(tree1, group, ActionPlaces.CALL_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
final BaseOnThisMethodAction baseOnThisMethodAction = new BaseOnThisMethodAction();
baseOnThisMethodAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(), tree1);
type2TreeMap.put(CALLEE_TYPE, tree1);
final JTree tree2 = createTree(false);
PopupHandler.installPopupHandler(tree2, group, ActionPlaces.CALL_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisMethodAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(), tree2);
type2TreeMap.put(CALLER_TYPE, tree2);
}
示例3: createToolbar
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
private JComponent createToolbar() {
ActionGroup group = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_MAIN_TOOLBAR);
final ActionToolbar toolBar= myActionManager.createActionToolbar(
ActionPlaces.MAIN_TOOLBAR,
group,
true
);
toolBar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY);
DefaultActionGroup menuGroup = new DefaultActionGroup();
menuGroup.add(new ViewToolbarAction());
menuGroup.add(new CustomizeUIAction());
PopupHandler.installUnknownPopupHandler(toolBar.getComponent(), menuGroup, myActionManager);
return toolBar.getComponent();
}
示例4: createTreeAndSetupCommonActions
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
protected void createTreeAndSetupCommonActions(@NotNull Map<String, JTree> trees, ActionGroup group) {
final BaseOnThisTypeAction baseOnThisTypeAction = createBaseOnThisAction();
final JTree tree1 = createTree(true);
PopupHandler.installPopupHandler(tree1, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree1);
trees.put(TYPE_HIERARCHY_TYPE, tree1);
final JTree tree2 = createTree(true);
PopupHandler.installPopupHandler(tree2, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree2);
trees.put(SUPERTYPES_HIERARCHY_TYPE, tree2);
final JTree tree3 = createTree(true);
PopupHandler.installPopupHandler(tree3, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree3);
trees.put(SUBTYPES_HIERARCHY_TYPE, tree3);
}
示例5: createToolbar
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
private JComponent createToolbar() {
MqRefreshAction mqRefreshAction = new MqRefreshAction();
EmptyAction.setupAction(mqRefreshAction, "hg4idea.QRefresh", this);
MqDeleteAction mqDeleteAction = new MqDeleteAction();
EmptyAction.setupAction(mqDeleteAction, "hg4idea.QDelete", this);
PopupHandler.installPopupHandler(myPatchTable, POPUP_ACTION_GROUP, ActionPlaces.PROJECT_VIEW_POPUP);
ActionManager actionManager = ActionManager.getInstance();
DefaultActionGroup toolbarGroup = new DefaultActionGroup();
toolbarGroup.add(mqRefreshAction);
toolbarGroup.add(actionManager.getAction("Hg.MQ.Unapplied"));
toolbarGroup.add(mqDeleteAction);
ActionToolbar toolbar = actionManager.createActionToolbar(TOOLBAR_ACTION_GROUP, toolbarGroup, false);
toolbar.setTargetComponent(this);
return toolbar.getComponent();
}
示例6: BrowserPanel
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
public BrowserPanel(CvsRootConfiguration configuration, Project project, Consumer<VcsException> errorCallback) {
super(new BorderLayout(2, 0));
setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
myProject = project;
myCvsRootConfiguration = configuration;
myTree = new CvsTree(project, false, TreeSelectionModel.SINGLE_TREE_SELECTION, true, true, errorCallback);
add(myTree, BorderLayout.CENTER);
myTree.init();
myTree.setCvsRootConfiguration(configuration);
myCheckoutHelper = new CheckoutHelper(configuration, this);
TreeUIHelper uiHelper = TreeUIHelper.getInstance();
uiHelper.installEditSourceOnDoubleClick(myTree.getTree());
TreeUtil.installActions(myTree.getTree());
ActionGroup group = getActionGroup();
PopupHandler.installPopupHandler(myTree.getTree(), group, ActionPlaces.CHECKOUT_POPUP, ActionManager.getInstance());
}
示例7: TestRunResultsView
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
public TestRunResultsView(Project project) {
this.model = new ListTreeTableModelOnColumns(null, COLUMNS.toArray(new ColumnInfo[COLUMNS.size()]));
this.tree = new TreeTable(this.model);
this.tree.getColumnModel().getColumn(0).setMinWidth(TestMeasureColumnInfo.MeasureProperty.GROUP.width * 2);
for (TestMeasureColumnInfo.MeasureProperty prop : TestMeasureColumnInfo.MeasureProperty.values()) {
//first column is name column which is not included in MeasureProperties, that's why we add 1.
this.tree.getColumnModel().getColumn(prop.ordinal() + 1).setMinWidth(prop.width);
}
this.panel = JBUI.Panels.simplePanel().addToCenter(ScrollPaneFactory.createScrollPane(this.tree));
//set text when no tests were fetched yet
this.setEmptyText(Messages.getMessage("execution.result.ui.loading"));
//add rightclick dialog
DefaultActionGroup dag = new DefaultActionGroup();
dag.add(new OpenInEditorAction(() -> {
TestResultNode node = this.getSelectedNode();
if (node != null) {
return node.getResult();
}
return null;
}, project));
PopupHandler.installUnknownPopupHandler(this.tree, dag, ActionManager.getInstance());
}
开发者ID:Dynatrace,项目名称:Dynatrace-AppMon-IntelliJ-IDEA-Integration-Plugin,代码行数:26,代码来源:TestRunResultsView.java
示例8: registerThreadsPopupMenu
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
private void registerThreadsPopupMenu(final JList framesList) {
final PopupHandler popupHandler = new PopupHandler() {
public void invokePopup(Component comp, int x, int y) {
DefaultActionGroup group = (DefaultActionGroup)ActionManager.getInstance().getAction(DebuggerActions.THREADS_PANEL_POPUP);
ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(DebuggerActions.THREADS_PANEL_POPUP, group);
popupMenu.getComponent().show(comp, x, y);
}
};
framesList.addMouseListener(popupHandler);
registerDisposable(new Disposable() {
public void dispose() {
myThreadsCombo.removeItemListener(myThreadsListener);
framesList.removeMouseListener(popupHandler);
}
});
}
示例9: createTrees
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
protected void createTrees(@NotNull Map<String, JTree> trees) {
ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_TYPE_HIERARCHY_POPUP);
final BaseOnThisTypeAction baseOnThisTypeAction = new BaseOnThisTypeAction();
final JTree tree1 = createTree(true);
PopupHandler.installPopupHandler(tree1, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree1);
trees.put(TYPE_HIERARCHY_TYPE, tree1);
final JTree tree2 = createTree(true);
PopupHandler.installPopupHandler(tree2, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree2);
trees.put(SUPERTYPES_HIERARCHY_TYPE, tree2);
final JTree tree3 = createTree(true);
PopupHandler.installPopupHandler(tree3, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree3);
trees.put(SUBTYPES_HIERARCHY_TYPE, tree3);
}
示例10: CommentsTree
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
protected CommentsTree(@NotNull final Project project, @NotNull final Review review, @NotNull DefaultTreeModel model,
@Nullable final Editor editor, @Nullable final FilePath filePath) {
super(model);
myReview = review;
setExpandableItemsEnabled(false);
setRowHeight(0);
final CommentNodeRenderer renderer = new CommentNodeRenderer(this, review, project);
setCellRenderer(renderer);
getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
final DefaultActionGroup group = new DefaultActionGroup();
final AddCommentAction replyToComment = new AddCommentAction(review, editor, filePath,
CrucibleBundle.message("crucible.add.reply"), true);
replyToComment.setContextComponent(this);
group.add(replyToComment);
PopupHandler.installUnknownPopupHandler(this, group, ActionManager.getInstance());
TreeUtil.expandAll(this);
new MyLinkMouseListener(renderer, project, review).installOn(this);
}
示例11: createToolbar
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
private JComponent createToolbar() {
ActionGroup group = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_MAIN_TOOLBAR);
final ActionToolbar toolBar= myActionManager.createActionToolbar(
ActionPlaces.MAIN_TOOLBAR,
group,
true
);
toolBar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY);
DefaultActionGroup menuGroup = new DefaultActionGroup();
menuGroup.add(new ViewToolbarAction());
menuGroup.add(new CustomizeUIAction());
PopupHandler.installUnknownPopupHandler(toolBar.getComponent(), menuGroup, myActionManager);
return toolBar.getComponent();
}
示例12: createTreeAndSetupCommonActions
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
protected void createTreeAndSetupCommonActions(@Nonnull Map<String, JTree> trees, ActionGroup group) {
final BaseOnThisTypeAction baseOnThisTypeAction = createBaseOnThisAction();
final JTree tree1 = createTree(true);
PopupHandler.installPopupHandler(tree1, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree1);
trees.put(TYPE_HIERARCHY_TYPE, tree1);
final JTree tree2 = createTree(true);
PopupHandler.installPopupHandler(tree2, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree2);
trees.put(SUPERTYPES_HIERARCHY_TYPE, tree2);
final JTree tree3 = createTree(true);
PopupHandler.installPopupHandler(tree3, group, ActionPlaces.TYPE_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
baseOnThisTypeAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_TYPE_HIERARCHY).getShortcutSet(), tree3);
trees.put(SUBTYPES_HIERARCHY_TYPE, tree3);
}
示例13: initTree
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
private void initTree(final MyTree tree) {
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setCellRenderer(new MyTreeCellRenderer(tree == myLeftTree));
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
UIUtil.setLineStyleAngled(tree);
TreeUtil.installActions(tree);
SmartExpander.installOn(tree);
EditSourceOnDoubleClickHandler.install(tree);
new TreeSpeedSearch(tree);
PopupHandler.installUnknownPopupHandler(tree, createTreePopupActions(), ActionManager.getInstance());
}
示例14: InspectDebuggerTree
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
public InspectDebuggerTree(Project project) {
super(project);
final PopupHandler popupHandler = new PopupHandler() {
public void invokePopup(Component comp, int x, int y) {
ActionPopupMenu popupMenu = createPopupMenu();
if (popupMenu != null) {
myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y);
}
}
};
addMouseListener(popupHandler);
new ValueNodeDnD(this, project);
}
示例15: DebuggerTreePanel
import com.intellij.ui.PopupHandler; //导入依赖的package包/类
public DebuggerTreePanel(Project project, DebuggerStateManager stateManager) {
super(project, stateManager);
myTree = createTreeView();
final PopupHandler popupHandler = new PopupHandler() {
@Override
public void invokePopup(Component comp, int x, int y) {
ActionPopupMenu popupMenu = createPopupMenu();
if (popupMenu != null) {
myTree.myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y);
}
}
};
myTree.addMouseListener(popupHandler);
setFocusTraversalPolicy(new IdeFocusTraversalPolicy() {
@Override
public Component getDefaultComponentImpl(Container focusCycleRoot) {
return myTree;
}
});
registerDisposable(new Disposable() {
@Override
public void dispose() {
myTree.removeMouseListener(popupHandler);
}
});
final Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts("ToggleBookmark");
final CustomShortcutSet shortcutSet = shortcuts.length > 0? new CustomShortcutSet(shortcuts) : new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0));
overrideShortcut(myTree, XDebuggerActions.MARK_OBJECT, shortcutSet);
}