Search in sources :

Example 6 with WCInfoWithBranches

use of org.jetbrains.idea.svn.dialogs.WCInfoWithBranches in project intellij-community by JetBrains.

the class RootsAndBranches method createPanels.

private void createPanels(final RepositoryLocation location, final Runnable afterRefresh) {
    final Task.Backgroundable backgroundable = new Task.Backgroundable(myProject, "Subversion: loading working copies data..", false) {

        public void run(@NotNull final ProgressIndicator indicator) {
            indicator.setIndeterminate(true);
            final Map<String, SvnMergeInfoRootPanelManual> panels = new HashMap<>();
            final Map<String, MergeInfoHolder> holders = new HashMap<>();
            final List<WCInfoWithBranches> roots = myDataLoader.loadRoots();
            SwingUtilities.invokeLater(() -> {
                if (myDisposed)
                    return;
                final JPanel mainPanel = prepareData(panels, holders, roots);
                myMergePanels.clear();
                myHolders.clear();
                myMergePanels.putAll(panels);
                myHolders.putAll(holders);
                if (myPanelWrapper != null) {
                    myPanelWrapper.removeAll();
                    if (myMergePanels.isEmpty()) {
                        final JPanel emptyPanel = new JPanel(new GridBagLayout());
                        final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0);
                        final JLabel label = new JLabel("No Subversion 1.5 working copies\nof 1.5 repositories in the project");
                        label.setUI(new MultiLineLabelUI());
                        emptyPanel.add(label, gb);
                        gb.fill = GridBagConstraints.HORIZONTAL;
                        myPanelWrapper.add(emptyPanel, gb);
                    } else {
                        for (MergeInfoHolder holder : myHolders.values()) {
                            holder.updateMixedRevisionsForPanel();
                        }
                        myPanelWrapper.add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
                    }
                    myPanelWrapper.repaint();
                } else {
                    myPanel = mainPanel;
                }
                if (afterRefresh != null) {
                    afterRefresh.run();
                }
            });
        }
    };
    ProgressManager.getInstance().run(backgroundable);
}
Also used : Task(com.intellij.openapi.progress.Task) HashMap(java.util.HashMap) NotNull(org.jetbrains.annotations.NotNull) MergeInfoHolder(org.jetbrains.idea.svn.mergeinfo.MergeInfoHolder) MultiLineLabelUI(com.intellij.openapi.ui.MultiLineLabelUI) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) WCInfoWithBranches(org.jetbrains.idea.svn.dialogs.WCInfoWithBranches)

Aggregations

WCInfoWithBranches (org.jetbrains.idea.svn.dialogs.WCInfoWithBranches)6 MergeInfoHolder (org.jetbrains.idea.svn.mergeinfo.MergeInfoHolder)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 File (java.io.File)2 HashMap (java.util.HashMap)2 NotNull (org.jetbrains.annotations.NotNull)2 WCInfo (org.jetbrains.idea.svn.dialogs.WCInfo)2 MergeContext (org.jetbrains.idea.svn.integrate.MergeContext)2 BranchInfo (org.jetbrains.idea.svn.mergeinfo.BranchInfo)2 OneShotMergeInfoHelper (org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper)2 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 MultiLineLabelUI (com.intellij.openapi.ui.MultiLineLabelUI)1 Couple (com.intellij.openapi.util.Couple)1 Map (java.util.Map)1 Node (org.jetbrains.idea.svn.Node)1 RootUrlInfo (org.jetbrains.idea.svn.RootUrlInfo)1 SvnBranchConfigurationNew (org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew)1 SvnBranchItem (org.jetbrains.idea.svn.branchConfig.SvnBranchItem)1