Search in sources :

Example 46 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class CommandParametersResolutionModule method resolveWorkingDirectory.

@NotNull
private File resolveWorkingDirectory(@NotNull Command command) {
    SvnTarget target = command.getTarget();
    File workingDirectory = target.isFile() ? target.getFile() : null;
    // TODO: Do we really need search existing parent - or just take parent directory if target is file???
    workingDirectory = CommandUtil.findExistingParent(workingDirectory);
    return workingDirectory != null ? workingDirectory : getDefaultWorkingDirectory(myVcs.getProject());
}
Also used : SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Example 47 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class ProxyModule method ensureGroupForHost.

@NotNull
private String ensureGroupForHost(@NotNull Command command, @NotNull String host) {
    IdeaSVNConfigFile configFile = new IdeaSVNConfigFile(myAuthenticationService.getSpecialConfigDir());
    String groupName = SvnAuthenticationManager.getGroupForHost(host, configFile);
    if (StringUtil.isEmptyOrSpaces(groupName)) {
        groupName = IdeaSVNConfigFile.getNewGroupName(host, configFile);
        command.put("--config-option");
        command.put(String.format("servers:groups:%s=%s*", groupName, host));
    }
    return groupName;
}
Also used : IdeaSVNConfigFile(org.jetbrains.idea.svn.IdeaSVNConfigFile) NotNull(org.jetbrains.annotations.NotNull)

Example 48 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class DefaultBranchConfigInitializer method getDefaultConfiguration.

@NotNull
private static SvnBranchConfigurationNew getDefaultConfiguration(@NotNull SvnVcs vcs, @NotNull SVNURL url) throws SVNException, VcsException {
    SvnBranchConfigurationNew result = new SvnBranchConfigurationNew();
    result.setTrunkUrl(url.toString());
    SVNURL branchLocationsParent = getBranchLocationsParent(url);
    if (branchLocationsParent != null) {
        SvnTarget target = SvnTarget.fromURL(branchLocationsParent);
        vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, createHandler(result, target.getURL()));
    }
    return result;
}
Also used : SVNURL(org.tmatesoft.svn.core.SVNURL) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) NotNull(org.jetbrains.annotations.NotNull)

Example 49 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class SshTunnelRuntimeModule method buildTunnelCommandLine.

@NotNull
private GeneralCommandLine buildTunnelCommandLine(@NotNull String sshPath) {
    GeneralCommandLine result = new GeneralCommandLine(sshPath);
    boolean isPuttyLinkClient = StringUtil.endsWithIgnoreCase(FileUtil.getNameWithoutExtension(sshPath), "plink");
    SvnConfigurationState state = getState();
    // quiet mode
    if (!isPuttyLinkClient) {
        result.addParameter("-q");
    }
    result.addParameters(isPuttyLinkClient ? "-P" : "-p", String.valueOf(state.sshPort));
    if (!StringUtil.isEmpty(state.sshUserName)) {
        result.addParameters("-l", state.sshUserName);
    }
    if (SvnConfiguration.SshConnectionType.PRIVATE_KEY.equals(state.sshConnectionType) && !StringUtil.isEmpty(state.sshPrivateKeyPath)) {
        result.addParameters("-i", FileUtil.toSystemIndependentName(state.sshPrivateKeyPath));
    }
    return result;
}
Also used : GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) SvnConfigurationState(org.jetbrains.idea.svn.SvnConfigurationState) NotNull(org.jetbrains.annotations.NotNull)

Example 50 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class TestNGConsoleProperties method initScope.

@NotNull
@Override
protected GlobalSearchScope initScope() {
    final TestNGConfiguration configuration = getConfiguration();
    final String testObject = configuration.getPersistantData().TEST_OBJECT;
    if (TestType.CLASS.getType().equals(testObject) || TestType.METHOD.getType().equals(testObject)) {
        return super.initScope();
    } else {
        final SourceScope sourceScope = configuration.getPersistantData().getScope().getSourceScope(configuration);
        return sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(getProject());
    }
}
Also used : SourceScope(com.intellij.execution.testframework.SourceScope) TestNGConfiguration(com.theoryinpractice.testng.configuration.TestNGConfiguration) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotNull (org.jetbrains.annotations.NotNull)8141 VirtualFile (com.intellij.openapi.vfs.VirtualFile)888 ArrayList (java.util.ArrayList)809 PsiElement (com.intellij.psi.PsiElement)764 Project (com.intellij.openapi.project.Project)647 File (java.io.File)627 Nullable (org.jetbrains.annotations.Nullable)518 List (java.util.List)400 PsiFile (com.intellij.psi.PsiFile)358 Module (com.intellij.openapi.module.Module)336 IOException (java.io.IOException)325 TextRange (com.intellij.openapi.util.TextRange)260 Document (com.intellij.openapi.editor.Document)173 ContainerUtil (com.intellij.util.containers.ContainerUtil)173 BasePhpElementVisitor (com.kalessil.phpStorm.phpInspectionsEA.openApi.BasePhpElementVisitor)169 ASTNode (com.intellij.lang.ASTNode)167 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)167 Map (java.util.Map)156 java.util (java.util)154 IElementType (com.intellij.psi.tree.IElementType)146