Search in sources :

Example 1 with AdditionalOptionsPanel

use of com.intellij.cvsSupport2.checkinProject.AdditionalOptionsPanel in project intellij-community by JetBrains.

the class CvsCheckinHandlerFactory method createVcsHandler.

@NotNull
@Override
protected CheckinHandler createVcsHandler(final CheckinProjectPanel panel) {
    return new CheckinHandler() {

        @Nullable
        public RefreshableOnComponent getAfterCheckinConfigurationPanel(Disposable parentDisposable) {
            final Project project = panel.getProject();
            final CvsVcs2 cvs = CvsVcs2.getInstance(project);
            final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
            final Collection<VirtualFile> roots = panel.getRoots();
            final Collection<FilePath> files = new HashSet<>();
            for (VirtualFile root : roots) {
                final VcsRoot vcsRoot = vcsManager.getVcsRootObjectFor(root);
                if (vcsRoot == null || vcsRoot.getVcs() != cvs) {
                    continue;
                }
                files.add(VcsContextFactory.SERVICE.getInstance().createFilePathOn(root));
            }
            return new AdditionalOptionsPanel(CvsConfiguration.getInstance(project), files, project);
        }
    };
}
Also used : Disposable(com.intellij.openapi.Disposable) VirtualFile(com.intellij.openapi.vfs.VirtualFile) FilePath(com.intellij.openapi.vcs.FilePath) Project(com.intellij.openapi.project.Project) CheckinHandler(com.intellij.openapi.vcs.checkin.CheckinHandler) VcsRoot(com.intellij.openapi.vcs.VcsRoot) AdditionalOptionsPanel(com.intellij.cvsSupport2.checkinProject.AdditionalOptionsPanel) ProjectLevelVcsManager(com.intellij.openapi.vcs.ProjectLevelVcsManager) HashSet(com.intellij.util.containers.HashSet) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

AdditionalOptionsPanel (com.intellij.cvsSupport2.checkinProject.AdditionalOptionsPanel)1 Disposable (com.intellij.openapi.Disposable)1 Project (com.intellij.openapi.project.Project)1 FilePath (com.intellij.openapi.vcs.FilePath)1 ProjectLevelVcsManager (com.intellij.openapi.vcs.ProjectLevelVcsManager)1 VcsRoot (com.intellij.openapi.vcs.VcsRoot)1 CheckinHandler (com.intellij.openapi.vcs.checkin.CheckinHandler)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 HashSet (com.intellij.util.containers.HashSet)1 NotNull (org.jetbrains.annotations.NotNull)1