当前位置: 首页>>代码示例>>Java>>正文


Java NotNullPairFunction类代码示例

本文整理汇总了Java中consulo.util.NotNullPairFunction的典型用法代码示例。如果您正苦于以下问题:Java NotNullPairFunction类的具体用法?Java NotNullPairFunction怎么用?Java NotNullPairFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NotNullPairFunction类属于consulo.util包,在下文中一共展示了NotNullPairFunction类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: elementToLookup

import consulo.util.NotNullPairFunction; //导入依赖的package包/类
public static void elementToLookup(@NotNull CompletionResultSet resultSet,
		@NotNull IElementType elementType,
		@Nullable NotNullPairFunction<LookupElementBuilder, IElementType, LookupElement> decorator,
		@Nullable Condition<IElementType> condition)
{
	if(condition != null && !condition.value(elementType))
	{
		return;
	}

	String keyword = ourCache.get(elementType);
	LookupElementBuilder builder = LookupElementBuilder.create(elementType, keyword);
	builder = builder.bold();
	LookupElement item = builder;
	if(decorator != null)
	{
		item = decorator.fun(builder, elementType);
	}

	item.putUserData(KEYWORD_ELEMENT_TYPE, elementType);
	resultSet.addElement(item);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:23,代码来源:CSharpCompletionUtil.java

示例2: tokenSetToLookup

import consulo.util.NotNullPairFunction; //导入依赖的package包/类
public static void tokenSetToLookup(@NotNull CompletionResultSet resultSet,
		@NotNull TokenSet tokenSet,
		@Nullable NotNullPairFunction<LookupElementBuilder, IElementType, LookupElement> decorator,
		@Nullable Condition<IElementType> condition)
{
	for(IElementType elementType : tokenSet.getTypes())
	{
		elementToLookup(resultSet, elementType, decorator, condition);
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:11,代码来源:CSharpCompletionUtil.java

示例3: doExecute

import consulo.util.NotNullPairFunction; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull final ExecutionEnvironment environment) throws ExecutionException
{
	if(state instanceof PatchableRunProfileState)
	{
		CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.getOrCreate((RunConfigurationBase) environment.getRunProfile());

		CoverageRunner coverageRunner = coverageEnabledConfiguration.getCoverageRunner();
		if(!coverageEnabledConfiguration.isCoverageEnabled() || coverageRunner == null)
		{
			throw new ExecutionException("Coverage is not enabled");
		}

		DotNetCoverageRunner dotNetCoverageRunner = (DotNetCoverageRunner) coverageRunner;

		NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine> modifierForCommandLine = dotNetCoverageRunner.getModifierForCommandLine();

		DotNetConfigurationWithCoverage runProfile = (DotNetConfigurationWithCoverage) environment.getRunProfile();

		PatchableRunProfileState patchableRunProfileState = (PatchableRunProfileState) state;
		patchableRunProfileState.modifyCommandLine(generalCommandLine -> modifierForCommandLine.fun(runProfile, generalCommandLine));

		patchableRunProfileState.setProcessHandlerConsumer(osProcessHandler -> CoverageHelper.attachToProcess((RunConfigurationBase) runProfile, osProcessHandler, environment.getRunnerSettings()));
	}
	else
	{
		throw new ExecutionException("Unknown configuration");
	}
	return super.doExecute(state, environment);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:32,代码来源:DotNetCoverageProgramRunner.java

示例4: getModifierForCommandLine

import consulo.util.NotNullPairFunction; //导入依赖的package包/类
@NotNull
@Override
public NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine> getModifierForCommandLine()
{
	return new NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine>()
	{
		@NotNull
		@Override
		public GeneralCommandLine fun(DotNetConfigurationWithCoverage t, GeneralCommandLine v)
		{
			CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.get(t);

			File openCoverConsoleExecutable = getOpenCoverConsoleExecutable();

			GeneralCommandLine newCommandLine = new GeneralCommandLine();
			newCommandLine.setExePath(openCoverConsoleExecutable.getPath());
			newCommandLine.addParameter("-register:user");
			newCommandLine.addParameter("-target:" + v.getExePath());
			newCommandLine.addParameter("-filter:+[*]*");
			newCommandLine.addParameter("-output:" + coverageEnabledConfiguration.getCoverageFilePath());

			String parametersAsString = ParametersListUtil.join(v.getParametersList().getParameters());
			if(!StringUtil.isEmpty(parametersAsString))
			{
				newCommandLine.addParameter("-targetargs:" + parametersAsString + "");
			}
			return newCommandLine;
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:31,代码来源:OpenCoverCoverageRunner.java

示例5: getModifierForCommandLine

import consulo.util.NotNullPairFunction; //导入依赖的package包/类
@NotNull
public abstract NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine> getModifierForCommandLine();
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:3,代码来源:DotNetCoverageRunner.java


注:本文中的consulo.util.NotNullPairFunction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。