Search in sources :

Example 1 with FilePathChangesTreeList

use of com.intellij.openapi.vcs.changes.ui.FilePathChangesTreeList in project intellij-community by JetBrains.

the class GitSimplePathsBrowser method createBrowser.

@NotNull
private static FilePathChangesTreeList createBrowser(@NotNull Project project, @NotNull Collection<String> absolutePaths) {
    List<FilePath> filePaths = toFilePaths(absolutePaths);
    FilePathChangesTreeList browser = new FilePathChangesTreeList(project, filePaths, false, false, null, null);
    browser.setChangesToDisplay(filePaths);
    return browser;
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) FilePathChangesTreeList(com.intellij.openapi.vcs.changes.ui.FilePathChangesTreeList) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with FilePathChangesTreeList

use of com.intellij.openapi.vcs.changes.ui.FilePathChangesTreeList in project intellij-community by JetBrains.

the class UndoApplyPatchDialog method createCenterPanel.

@Nullable
@Override
protected JComponent createCenterPanel() {
    final JPanel panel = new JPanel(new BorderLayout());
    int numFiles = myFailedFilePaths.size();
    JPanel labelsPanel = new JPanel(new BorderLayout());
    String detailedText = numFiles == 0 ? "" : String.format("Failed to apply %s below.<br>", StringUtil.pluralize("file", numFiles));
    final JLabel infoLabel = new JBLabel(XmlStringUtil.wrapInHtml(detailedText + "Would you like to rollback all applied?"));
    labelsPanel.add(infoLabel, BorderLayout.NORTH);
    if (myShouldInformAboutBinaries) {
        JLabel warningLabel = new JLabel("Rollback will not affect binaries");
        warningLabel.setIcon(UIUtil.getBalloonWarningIcon());
        labelsPanel.add(warningLabel, BorderLayout.CENTER);
    }
    panel.add(labelsPanel, BorderLayout.NORTH);
    if (numFiles > 0) {
        FilePathChangesTreeList browser = new FilePathChangesTreeList(myProject, myFailedFilePaths, false, false, null, null) {

            @Override
            public Dimension getPreferredSize() {
                return new Dimension(infoLabel.getPreferredSize().width, 50);
            }
        };
        browser.setChangesToDisplay(myFailedFilePaths);
        panel.add(ScrollPaneFactory.createScrollPane(browser), BorderLayout.CENTER);
    }
    return panel;
}
Also used : FilePathChangesTreeList(com.intellij.openapi.vcs.changes.ui.FilePathChangesTreeList) JBLabel(com.intellij.ui.components.JBLabel) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

FilePathChangesTreeList (com.intellij.openapi.vcs.changes.ui.FilePathChangesTreeList)2 FilePath (com.intellij.openapi.vcs.FilePath)1 JBLabel (com.intellij.ui.components.JBLabel)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1