本文整理汇总了Java中com.intellij.ui.PopupHandler.installPopupHandler方法的典型用法代码示例。如果您正苦于以下问题:Java PopupHandler.installPopupHandler方法的具体用法?Java PopupHandler.installPopupHandler怎么用?Java PopupHandler.installPopupHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.PopupHandler
的用法示例。
在下文中一共展示了PopupHandler.installPopupHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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();
}
示例4: 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());
}
示例5: 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);
}
示例6: 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);
}
示例7: buildPopupMenu
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
void buildPopupMenu() {
DefaultActionGroup actionPopupGroup = new DefaultActionGroup("MongoResultPopupGroup", true);
if (ApplicationManager.getApplication() != null) {
actionPopupGroup.add(new EditMongoDocumentAction(this));
actionPopupGroup.add(new CopyResultAction(this));
}
PopupHandler.installPopupHandler(resultTableView, actionPopupGroup, "POPUP", ActionManager.getInstance());
}
示例8: createTrees
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
protected void createTrees(@NotNull Map<String, JTree> trees) {
final JTree tree = createTree(false);
ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_METHOD_HIERARCHY_POPUP);
PopupHandler.installPopupHandler(tree, group, ActionPlaces.METHOD_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
final BaseOnThisMethodAction baseOnThisMethodAction = new BaseOnThisMethodAction();
baseOnThisMethodAction
.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_METHOD_HIERARCHY).getShortcutSet(), tree);
trees.put(METHOD_TYPE, tree);
}
示例9: SourceItemsTree
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
public SourceItemsTree(ArtifactEditorContext editorContext, ArtifactEditorImpl artifactsEditor) {
myArtifactsEditor = artifactsEditor;
myBuilder = new SimpleTreeBuilder(this, this.getBuilderModel(), new SourceItemsTreeStructure(editorContext, artifactsEditor), new WeightBasedComparator(true));
setRootVisible(false);
setShowsRootHandles(true);
Disposer.register(this, myBuilder);
PopupHandler.installPopupHandler(this, createPopupGroup(), ActionPlaces.UNKNOWN, ActionManager.getInstance());
installDnD();
}
示例10: StatisticsPanel
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
public StatisticsPanel(final Project project, final TestFrameworkRunningModel model) {
myProject = project;
myTableModel = new StatisticsTableModel();
myStatisticsTableView.setModelAndUpdateColumns(myTableModel);
myFrameworkRunningModel = model;
final Runnable gotoSuiteOrParentAction = createGotoSuiteOrParentAction();
new DoubleClickListener() {
@Override
protected boolean onDoubleClick(MouseEvent e) {
gotoSuiteOrParentAction.run();
return true;
}
}.installOn(myStatisticsTableView);
// Fire selection changed and move focus on SHIFT+ENTER
final KeyStroke shiftEnterKey = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK);
SMRunnerUtil.registerAsAction(shiftEnterKey, "select-test-proxy-in-test-view",
new Runnable() {
public void run() {
showSelectedProxyInTestsTree();
}
},
myStatisticsTableView);
// Expand selected or go to parent on ENTER
final KeyStroke enterKey = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
SMRunnerUtil.registerAsAction(enterKey, "go-to-selected-suite-or-parent",
gotoSuiteOrParentAction,
myStatisticsTableView);
// Contex menu in Table
PopupHandler.installPopupHandler(myStatisticsTableView, IdeActions.GROUP_TESTTREE_POPUP, ActionPlaces.TESTTREE_VIEW_POPUP);
// set this statistic tab as dataprovider for test's table view
DataManager.registerDataProvider(myStatisticsTableView, this);
}
示例11: init
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
public void init() {
setLayout(new BorderLayout());
myTable = new JBTable();
myTextArea = new JTextArea(0, 0);
myTextArea.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
mySplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, scrollPane, ScrollPaneFactory.createScrollPane(myTextArea));
add(mySplitPane, BorderLayout.CENTER);
add(createToolbar(), BorderLayout.WEST);
final DefaultTableModel model = new DefaultTableModel(createTableModel(new HashMap<String, String>()), new Object[]{"Name", "Value"}) {
public boolean isCellEditable(final int row, final int column) {
return false;
}
};
myTable.setModel(model);
myTable.setShowVerticalLines(true);
myTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
int index = myTable.getSelectedRow();
if (index >= 0) {
Object value = myTable.getValueAt(index, 1);
if (value instanceof String) {
myTextArea.setText(((String) value));
} else {
myTextArea.setText("");
}
} else {
myTextArea.setText("");
}
}
});
myPopupActionGroup = createPopup();
PopupHandler.installPopupHandler(myTable, myPopupActionGroup, ActionPlaces.UNKNOWN, ActionManager.getInstance());
PopupHandler.installPopupHandler(scrollPane, myPopupActionGroup, ActionPlaces.UNKNOWN, ActionManager.getInstance());
final Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_CLOSE_ACTIVE_TAB);
myCloseAction.registerCustomShortcutSet(new CustomShortcutSet(shortcuts), this);
myRefreshAction.registerCustomShortcutSet(CommonShortcuts.getRerun(), this);
}
示例12: tunePopupActionGroup
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
private void tunePopupActionGroup() {
final DefaultActionGroup propertiesPopupGroup = new DefaultActionGroup();
propertiesPopupGroup.copyFromGroup((DefaultActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_STRUCTURE_VIEW_POPUP));
propertiesPopupGroup.add(Separator.getInstance(), Constraints.FIRST);
propertiesPopupGroup.add(new IgnoreIncompletePropertyPropertiesFilesAction(), Constraints.FIRST);
propertiesPopupGroup.add(new NewPropertyAction(true), Constraints.FIRST);
PopupHandler.installPopupHandler(getTree(), propertiesPopupGroup, IdeActions.GROUP_STRUCTURE_VIEW_POPUP, ActionManager.getInstance());
}
示例13: TfsTreeForm
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
public TfsTreeForm() {
DataManager.registerDataProvider(tree, this);
new TreeSpeedSearch(tree);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
selectedItem = doGetSelectedItem();
pathField.setText(selectedItem != null ? selectedItem.path : null);
eventDispatcher.getMulticaster().selectionChanged();
}
});
PopupHandler.installPopupHandler(tree, POPUP_ACTION_GROUP, ActionPlaces.REMOTE_HOST_DIALOG_POPUP);
setMessage(null, false);
}
示例14: installHandlers
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
protected void installHandlers() {
EditSourceOnDoubleClickHandler.install(this);
new TreeSpeedSearch(this, new Convertor<TreePath, String>() {
public String convert(final TreePath path) {
final AbstractTestProxy testProxy = getSelectedTest(path);
if (testProxy == null) return null;
return testProxy.getName();
}
});
TreeUtil.installActions(this);
PopupHandler.installPopupHandler(this, IdeActions.GROUP_TESTTREE_POPUP, ActionPlaces.TESTTREE_VIEW_POPUP);
ViewAssertEqualsDiffAction.registerShortcut(this);
}
示例15: createComponent
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
@Override
public JComponent createComponent() {
if (myViewPanel == null) {
myViewPanel = new ScopeTreeViewPanel(myProject);
Disposer.register(this, myViewPanel);
myViewPanel.initListeners();
myTree = myViewPanel.getTree();
PopupHandler.installPopupHandler(myTree, IdeActions.GROUP_SCOPE_VIEW_POPUP, ActionPlaces.SCOPE_VIEW_POPUP);
enableDnD();
}
myViewPanel.selectScope(NamedScopesHolder.getScope(myProject, getSubId()));
return myViewPanel.getPanel();
}