本文整理汇总了Java中com.intellij.ui.PopupHandler.installUnknownPopupHandler方法的典型用法代码示例。如果您正苦于以下问题:Java PopupHandler.installUnknownPopupHandler方法的具体用法?Java PopupHandler.installUnknownPopupHandler怎么用?Java PopupHandler.installUnknownPopupHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.PopupHandler
的用法示例。
在下文中一共展示了PopupHandler.installUnknownPopupHandler方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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
示例3: 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);
}
示例4: 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();
}
示例5: 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());
}
示例6: initTree
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
private void initTree(final Tree tree)
{
final MigrationRootsTreeCellRenderer rootsTreeCellRenderer = new MigrationRootsTreeCellRenderer();
tree.setCellRenderer(rootsTreeCellRenderer);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
UIUtil.setLineStyleAngled(tree);
TreeUtil.installActions(tree);
TreeUtil.expandAll(tree);
SmartExpander.installOn(tree);
EditSourceOnDoubleClickHandler.install(tree);
new TreeSpeedSearch(tree);
PopupHandler.installUnknownPopupHandler(tree, createTreePopupActions(), ActionManager.getInstance());
}
示例7: onContentChangedIn
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
public void onContentChangedIn(EditorSource source) {
myDiffUpdater.contentRemoved(source);
final EditorEx editor = source.getEditor();
if (myIsHorizontal && source.getSide() == FragmentSide.SIDE1 && editor != null) {
editor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
}
DiffSideView viewSide = getSideView(source.getSide());
viewSide.setEditorSource(getProject(), source);
Disposer.dispose(myScrollSupport);
if (editor == null) {
if (!myDisposed) {
rediff();
}
return;
}
final MouseListener mouseListener = PopupHandler
.installUnknownPopupHandler(editor.getContentComponent(), new MergeActionGroup(this, source.getSide()), ActionManager.getInstance());
myDiffUpdater.contentAdded(source);
editor.getSettings().setLineNumbersShown(true);
editor.getSettings().setFoldingOutlineShown(false);
editor.getFoldingModel().setFoldingEnabled(false);
((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);
Editor editor1 = getEditor(FragmentSide.SIDE1);
Editor editor2 = getEditor(FragmentSide.SIDE2);
if (editor1 != null && editor2 != null && myIsSyncScroll) {
myScrollSupport.install(new EditingSides[]{this});
}
final VisibleAreaListener visibleAreaListener = mySplitter.getVisibleAreaListener();
final ScrollingModel scrollingModel = editor.getScrollingModel();
if (visibleAreaListener != null) {
scrollingModel.addVisibleAreaListener(visibleAreaListener);
scrollingModel.addVisibleAreaListener(myVisibleAreaListener);
}
myFontSizeSynchronizer.synchronize(editor);
source.addDisposable(new Disposable() {
public void dispose() {
myFontSizeSynchronizer.stopSynchronize(editor);
}
});
source.addDisposable(new Disposable() {
public void dispose() {
if (visibleAreaListener != null) {
scrollingModel.removeVisibleAreaListener(visibleAreaListener);
scrollingModel.removeVisibleAreaListener(myVisibleAreaListener);
}
editor.getContentComponent().removeMouseListener(mouseListener);
}
});
}
示例8: onContentChangedIn
import com.intellij.ui.PopupHandler; //导入方法依赖的package包/类
public void onContentChangedIn(EditorSource source) {
myDiffUpdater.contentRemoved(source);
final EditorEx editor = source.getEditor();
if (myIsHorizontal && source.getSide() == FragmentSide.SIDE1 && editor != null) {
editor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
}
DiffSideView viewSide = getSideView(source.getSide());
viewSide.setEditorSource(getProject(), source);
Disposer.dispose(myScrollSupport);
if (editor == null) {
if (!myDisposed) {
rediff();
}
return;
}
final MouseListener mouseListener = PopupHandler.installUnknownPopupHandler(editor.getContentComponent(), new MergeActionGroup(this, source.getSide()), ActionManager.getInstance());
myDiffUpdater.contentAdded(source);
editor.getSettings().setLineNumbersShown(true);
editor.getSettings().setFoldingOutlineShown(false);
editor.getFoldingModel().setFoldingEnabled(false);
((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);
Editor editor1 = getEditor(FragmentSide.SIDE1);
Editor editor2 = getEditor(FragmentSide.SIDE2);
if (editor1 != null && editor2 != null && myIsSyncScroll) {
myScrollSupport.install(new EditingSides[]{this});
}
final VisibleAreaListener visibleAreaListener = mySplitter.getVisibleAreaListener();
final ScrollingModel scrollingModel = editor.getScrollingModel();
if (visibleAreaListener != null) {
scrollingModel.addVisibleAreaListener(visibleAreaListener);
scrollingModel.addVisibleAreaListener(myVisibleAreaListener);
}
myFontSizeSynchronizer.synchronize(editor);
source.addDisposable(new Disposable() {
public void dispose() {
myFontSizeSynchronizer.stopSynchronize(editor);
}
});
source.addDisposable(new Disposable() {
public void dispose() {
if (visibleAreaListener != null) {
scrollingModel.removeVisibleAreaListener(visibleAreaListener);
scrollingModel.removeVisibleAreaListener(myVisibleAreaListener);
}
editor.getContentComponent().removeMouseListener(mouseListener);
}
});
}