use of com.intellij.ui.PopupHandler in project intellij-community by JetBrains.
the class CopyOptionsDialog method createUI.
private void createUI() {
myMainPanel = new JPanel(new BorderLayout());
myBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject));
final DefaultActionGroup group = new DefaultActionGroup();
group.add(new RepositoryBrowserDialog.MkDirAction(myBrowser) {
@Override
public void update(AnActionEvent e) {
super.update(e);
e.getPresentation().setText("New Remote Folder...");
}
});
group.add(new RepositoryBrowserDialog.DeleteAction(myBrowser));
group.add(new RepositoryBrowserDialog.RefreshAction(myBrowser));
final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu("", group);
final JPopupMenu component = popupMenu.getComponent();
myBrowser.getRepositoryTree().addMouseListener(new PopupHandler() {
@Override
public void invokePopup(Component comp, int x, int y) {
component.show(comp, x, y);
}
});
final Splitter splitter = new Splitter(true);
splitter.setProportion(0.7f);
final JPanel wrapper = createBrowserPartWrapper();
splitter.setFirstComponent(wrapper);
final JPanel commitMessageWrapper = createCommitMessageWrapper();
splitter.setSecondComponent(commitMessageWrapper);
myMainPanel.add(splitter, BorderLayout.CENTER);
final JPanel recentMessagesWrapper = new JPanel(new BorderLayout());
recentMessagesWrapper.add(new JLabel("Recent Messages:"), BorderLayout.NORTH);
myMessagesBox = new JComboBox();
recentMessagesWrapper.add(myMessagesBox, BorderLayout.SOUTH);
recentMessagesWrapper.setBorder(JBUI.Borders.emptyTop(4));
myMainPanel.add(recentMessagesWrapper, BorderLayout.SOUTH);
}
Aggregations