Search in sources :

Example 1 with CvsRepository

use of com.intellij.openapi.cvsIntegration.CvsRepository in project intellij-community by JetBrains.

the class CvsServicesImpl method openInEditor.

public void openInEditor(Project project, CvsModule cvsFile) {
    CvsRepository repository = cvsFile.getRepository();
    RevisionOrDate revisionOrDate = RevisionOrDateImpl.createOn(new DateOrRevisionSettings().updateFrom(repository.getDateOrRevision()));
    GetFileContentOperation operation = new GetFileContentOperation(new File(cvsFile.getPathInCvs()), CvsRootConfiguration.createOn(repository), revisionOrDate);
    ComparableVcsRevisionOnOperation revision = new ComparableVcsRevisionOnOperation(operation, project);
    VcsVirtualFile vcsVirtualFile = new VcsVirtualFile(cvsFile.getPathInCvs(), revision, VcsFileSystem.getInstance());
    OpenFileDescriptor openFileDescriptor = new OpenFileDescriptor(project, vcsVirtualFile);
    FileEditorManager.getInstance(project).openTextEditor(openFileDescriptor, false);
}
Also used : GetFileContentOperation(com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation) DateOrRevisionSettings(com.intellij.cvsSupport2.config.DateOrRevisionSettings) VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile) OpenFileDescriptor(com.intellij.openapi.fileEditor.OpenFileDescriptor) CvsRepository(com.intellij.openapi.cvsIntegration.CvsRepository) ComparableVcsRevisionOnOperation(com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation) RevisionOrDate(com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate) File(java.io.File) VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile)

Example 2 with CvsRepository

use of com.intellij.openapi.cvsIntegration.CvsRepository in project intellij-community by JetBrains.

the class ModuleChooser method getSelectedModules.

public CvsModule[] getSelectedModules() {
    CvsRepository repository = getSelectedRepository();
    CvsElement[] selectedCvsElement = mySelectCvsElementStep.getSelectedCvsElements();
    ArrayList<CvsModule> result = new ArrayList<>();
    for (CvsElement cvsElement : selectedCvsElement) {
        result.add(new CvsModule(repository, cvsElement.getElementPath(), cvsElement instanceof CvsFile));
    }
    return result.toArray(new CvsModule[result.size()]);
}
Also used : ArrayList(java.util.ArrayList) CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement) CvsRepository(com.intellij.openapi.cvsIntegration.CvsRepository) CvsModule(com.intellij.openapi.cvsIntegration.CvsModule) CvsFile(com.intellij.cvsSupport2.cvsBrowser.CvsFile)

Aggregations

CvsRepository (com.intellij.openapi.cvsIntegration.CvsRepository)2 DateOrRevisionSettings (com.intellij.cvsSupport2.config.DateOrRevisionSettings)1 CvsElement (com.intellij.cvsSupport2.cvsBrowser.CvsElement)1 CvsFile (com.intellij.cvsSupport2.cvsBrowser.CvsFile)1 GetFileContentOperation (com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation)1 RevisionOrDate (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.RevisionOrDate)1 ComparableVcsRevisionOnOperation (com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation)1 CvsModule (com.intellij.openapi.cvsIntegration.CvsModule)1 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)1 VcsVirtualFile (com.intellij.openapi.vcs.vfs.VcsVirtualFile)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1