Search in sources :

Example 11 with PopupHandler

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);
}
Also used : PopupHandler(com.intellij.ui.PopupHandler) Splitter(com.intellij.openapi.ui.Splitter) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) RepositoryBrowserDialog(org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog) ActionPopupMenu(com.intellij.openapi.actionSystem.ActionPopupMenu) RepositoryBrowserComponent(org.jetbrains.idea.svn.dialogs.RepositoryBrowserComponent) RepositoryBrowserComponent(org.jetbrains.idea.svn.dialogs.RepositoryBrowserComponent)

Aggregations

PopupHandler (com.intellij.ui.PopupHandler)11 Nullable (org.jetbrains.annotations.Nullable)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 KeyAdapter (java.awt.event.KeyAdapter)2 KeyEvent (java.awt.event.KeyEvent)2 MouseAdapter (java.awt.event.MouseAdapter)2 AndroidSourceSet (com.android.tools.idea.npw.project.AndroidSourceSet)1 IconProperty (com.android.tools.idea.ui.properties.swing.IconProperty)1 SelectedItemProperty (com.android.tools.idea.ui.properties.swing.SelectedItemProperty)1 TextProperty (com.android.tools.idea.ui.properties.swing.TextProperty)1 VisibleProperty (com.android.tools.idea.ui.properties.swing.VisibleProperty)1 Validator (com.android.tools.idea.ui.validation.Validator)1 OccurenceNavigatorSupport (com.intellij.ide.OccurenceNavigatorSupport)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 NodeRenderer (com.intellij.ide.util.treeView.NodeRenderer)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 ActionPopupMenu (com.intellij.openapi.actionSystem.ActionPopupMenu)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1