本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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;
}
};
}
示例5: getModifierForCommandLine
import consulo.util.NotNullPairFunction; //导入依赖的package包/类
@NotNull
public abstract NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine> getModifierForCommandLine();