Search in sources :

Example 1 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement in project intellij-community by JetBrains.

the class CheckoutAction method collectCheckoutPaths.

private String[] collectCheckoutPaths() {
    String[] checkoutPaths = new String[mySelectedElements.length];
    for (int i = 0; i < mySelectedElements.length; i++) {
        CvsElement selectedElement = mySelectedElements[i];
        checkoutPaths[i] = selectedElement.getCheckoutPath();
    }
    return checkoutPaths;
}
Also used : CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement)

Example 2 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement in project intellij-community by JetBrains.

the class BrowserPanel method getCvsVirtualFile.

@Nullable
private VirtualFile getCvsVirtualFile() {
    CvsElement[] currentSelection = myTree.getCurrentSelection();
    if (currentSelection.length != 1)
        return null;
    VirtualFile file = currentSelection[0].getVirtualFile();
    if (file == null)
        return null;
    if (file.isDirectory())
        return null;
    return file;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsVirtualFile(com.intellij.openapi.vcs.vfs.VcsVirtualFile) CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement) Nullable(org.jetbrains.annotations.Nullable)

Example 3 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement 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)

Example 4 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement in project intellij-community by JetBrains.

the class ChooseCheckoutMode method getSelectedFiles.

private Collection<File> getSelectedFiles() {
    final Collection<File> allFiles = new HashSet<>();
    final CvsElement[] selection = getWizard().getSelectedElements();
    if (selection == null)
        return allFiles;
    for (CvsElement cvsElement : selection) {
        allFiles.add(new File(cvsElement.getCheckoutPath()));
    }
    final ArrayList<File> result = new ArrayList<>();
    for (File file : allFiles) {
        if (!hasParentIn(allFiles, file))
            result.add(file);
    }
    Collections.sort(result, (file, file1) -> file.getPath().compareTo(file1.getPath()));
    return result;
}
Also used : CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement) File(java.io.File) CvsFile(com.intellij.cvsSupport2.cvsBrowser.CvsFile) HashSet(com.intellij.util.containers.HashSet)

Example 5 with CvsElement

use of com.intellij.cvsSupport2.cvsBrowser.CvsElement in project intellij-community by JetBrains.

the class ImportWizard method createImportDetails.

@Nullable
public ImportDetails createImportDetails() {
    final CvsElement module = mySelectCvsElementStep.getSelectedCvsElement();
    final String moduleName = mySettingsStep.getModuleName();
    final String importModuleName = module.getElementPath().equals(".") ? moduleName : module.getElementPath() + "/" + moduleName;
    final File selectedFile = mySelectImportLocationStep.getSelectedFile();
    if (selectedFile == null) {
        return null;
    }
    return new ImportDetails(selectedFile, mySettingsStep.getVendor(), mySettingsStep.getReleaseTag(), mySettingsStep.getLogMessage(), importModuleName, mySelectCVSConfigurationStep.getSelectedConfiguration(), mySettingsStep.getFileExtensions(), mySelectImportLocationStep.getIgnoreFileFilter());
}
Also used : ImportDetails(com.intellij.cvsSupport2.cvsoperations.cvsImport.ImportDetails) CvsElement(com.intellij.cvsSupport2.cvsBrowser.CvsElement) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CvsElement (com.intellij.cvsSupport2.cvsBrowser.CvsElement)7 File (java.io.File)3 CvsFile (com.intellij.cvsSupport2.cvsBrowser.CvsFile)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 Nullable (org.jetbrains.annotations.Nullable)2 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)1 CvsOperationExecutorCallback (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutorCallback)1 ModalityContext (com.intellij.cvsSupport2.cvsExecution.ModalityContext)1 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)1 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)1 ImportDetails (com.intellij.cvsSupport2.cvsoperations.cvsImport.ImportDetails)1 CheckoutWizard (com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)1 CvsModule (com.intellij.openapi.cvsIntegration.CvsModule)1 CvsRepository (com.intellij.openapi.cvsIntegration.CvsRepository)1 VcsVirtualFile (com.intellij.openapi.vcs.vfs.VcsVirtualFile)1 HashSet (com.intellij.util.containers.HashSet)1 ArrayList (java.util.ArrayList)1