Search in sources :

Example 1 with RepositoryBrowserComponent

use of org.jetbrains.idea.svn.dialogs.RepositoryBrowserComponent 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

ActionPopupMenu (com.intellij.openapi.actionSystem.ActionPopupMenu)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 Splitter (com.intellij.openapi.ui.Splitter)1 PopupHandler (com.intellij.ui.PopupHandler)1 RepositoryBrowserComponent (org.jetbrains.idea.svn.dialogs.RepositoryBrowserComponent)1 RepositoryBrowserDialog (org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog)1