本文整理汇总了Java中com.intellij.openapi.util.NotNullLazyValue类的典型用法代码示例。如果您正苦于以下问题:Java NotNullLazyValue类的具体用法?Java NotNullLazyValue怎么用?Java NotNullLazyValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotNullLazyValue类属于com.intellij.openapi.util包,在下文中一共展示了NotNullLazyValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JavaOverrideImplementMemberChooser
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private JavaOverrideImplementMemberChooser(final PsiMethodMember[] allElements,
final PsiMethodMember[] onlyPrimaryElements,
final NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
final @NotNull Project project,
final boolean isInsertOverrideVisible,
final boolean merge,
final boolean toImplement,
final boolean sortedByOverriding) {
super(false, true, project, isInsertOverrideVisible, null, null);
myAllElements = allElements;
myOnlyPrimaryElements = onlyPrimaryElements;
myLazyElementsWithPercent = lazyElementsWithPercent;
myProject = project;
myMerge = merge;
myToImplement = toImplement;
mySortedByOverriding = sortedByOverriding;
resetElements(getInitialElements(allElements, onlyPrimaryElements, lazyElementsWithPercent, merge, toImplement, sortedByOverriding));
init();
}
示例2: ExtensibleQueryFactory
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
@Override
@NotNull
protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
@Override
@NotNull
protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
@NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
int pos = epName.lastIndexOf('.');
if (pos >= 0) {
epName = epName.substring(pos+1);
}
epName = epNamespace + "." + StringUtil.decapitalize(epName);
return Extensions.getRootArea().getExtensionPoint(epName);
}
};
}
};
}
示例3: getValue
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
@NotNull
public NotNullLazyValue<?> getValue() {
if (value == null) {
value = new AtomicNotNullLazyValue<Object>() {
@NotNull
@Override
protected Object compute() {
try {
if (service == null) {
Class<Object> aClass = findClass(implementation);
return asInstance ? instantiate(aClass, ApplicationManager.getApplication().getPicoContainer(), true) : aClass;
}
else {
return ServiceManager.getService(findClass(service));
}
}
catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
};
}
return value;
}
示例4: ProjectDataManager
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public ProjectDataManager() {
myServices = new NotNullLazyValue<Map<Key<?>, List<ProjectDataService<?, ?>>>>() {
@NotNull
@Override
protected Map<Key<?>, List<ProjectDataService<?, ?>>> compute() {
Map<Key<?>, List<ProjectDataService<?, ?>>> result = ContainerUtilRt.newHashMap();
for (ProjectDataService<?, ?> service : ProjectDataService.EP_NAME.getExtensions()) {
List<ProjectDataService<?, ?>> services = result.get(service.getTargetDataKey());
if (services == null) {
result.put(service.getTargetDataKey(), services = ContainerUtilRt.newArrayList());
}
services.add(service);
}
for (List<ProjectDataService<?, ?>> services : result.values()) {
ExternalSystemApiUtil.orderAwareSort(services);
}
return result;
}
};
}
示例5: collectFields
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static NotNullLazyValue<Set<ArrangementSettingsToken>> collectFields(@NotNull final Class<?> clazz) {
return new NotNullLazyValue<Set<ArrangementSettingsToken>>() {
@NotNull
@Override
protected Set<ArrangementSettingsToken> compute() {
Set<ArrangementSettingsToken> result = ContainerUtilRt.newHashSet();
for (Field field : clazz.getFields()) {
if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) {
try {
result.add((ArrangementSettingsToken)field.get(null));
}
catch (IllegalAccessException e) {
assert false : e;
}
}
}
return result;
}
};
}
示例6: createPointersThunk
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static <T> NotNullLazyValue<List<SmartPsiElementPointer>> createPointersThunk(boolean lazy,
final Project project,
final Factory<Collection<T>> targets,
final NotNullFunction<T, Collection<? extends PsiElement>> converter) {
if (!lazy) {
return NotNullLazyValue.createConstantValue(calcPsiTargets(project, targets.create(), converter));
}
return new NotNullLazyValue<List<SmartPsiElementPointer>>() {
@Override
@NotNull
public List<SmartPsiElementPointer> compute() {
return calcPsiTargets(project, targets.create(), converter);
}
};
}
示例7: collectFields
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static NotNullLazyValue<Set<ArrangementSettingsToken>> collectFields(@NotNull final Class<?> clazz) {
return new NotNullLazyValue<Set<ArrangementSettingsToken>>() {
@NotNull
@Override
protected Set<ArrangementSettingsToken> compute() {
Set<ArrangementSettingsToken> result = ContainerUtilRt.newHashSet();
for (Field field : clazz.getFields()) {
if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) {
try {
result.add((ArrangementSettingsToken)field.get(null));
}
catch (IllegalAccessException e) {
assert false : e;
}
}
}
return result;
}
};
}
示例8: createLineMarkerInfo
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@NotNull PsiElement element) {
final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
final String tooltip = renderer.getTooltipText();
NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
@NotNull
@Override
protected Collection<? extends GotoRelatedItem> compute() {
if (myGotoRelatedItemProvider != null) {
return ContainerUtil.concat(myTargets.getValue(), myGotoRelatedItemProvider);
}
return Collections.emptyList();
}
};
return new RelatedItemLineMarkerInfo<PsiElement>(element, element.getTextRange(), renderer.getIcon(), Pass.UPDATE_OVERRIDEN_MARKERS,
tooltip == null ? null : new ConstantFunction<PsiElement, String>(tooltip),
renderer.isNavigateAction() ? renderer : null, renderer.getAlignment(),
gotoTargets);
}
示例9: addParameterExpression
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public void addParameterExpression(Object o)
{
if(myCallArguments.isEmpty())
{
myCallArguments = new SmartList<>();
}
myCallArguments.add(NotNullLazyValue.createValue(() ->
{
Object value = o;
if(value instanceof String)
{
value = StringUtil.QUOTER.fun((String) value);
}
return new CSharpLightCallArgument(CSharpFileFactory.createExpression(getProject(), String.valueOf(value)));
}));
}
示例10: LambdaResult
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
@RequiredReadAction
public LambdaResult(@NotNull PsiElement scope, @NotNull CSharpMethodDeclaration element, @NotNull DotNetGenericExtractor extractor)
{
super(element, extractor);
myScope = scope;
myParameterInfosValue = NotNullLazyValue.createValue(() ->
{
CSharpSimpleParameterInfo[] parameterInfos = myElement.getParameterInfos();
if(myExtractor == DotNetGenericExtractor.EMPTY)
{
return parameterInfos;
}
CSharpSimpleParameterInfo[] temp = new CSharpSimpleParameterInfo[parameterInfos.length];
for(int i = 0; i < parameterInfos.length; i++)
{
CSharpSimpleParameterInfo parameterInfo = parameterInfos[i];
DotNetTypeRef typeRef = GenericUnwrapTool.exchangeTypeRef(parameterInfo.getTypeRef(), getGenericExtractor(), myScope);
temp[i] = new CSharpSimpleParameterInfo(parameterInfo.getIndex(), parameterInfo.getName(), parameterInfo.getElement(), typeRef);
}
return temp;
});
myElementValue = NotNullLazyValue.createValue(() -> CSharpLambdaResolveResultUtil.createTypeFromDelegate(myElement, myExtractor));
myReturnTypRefValue = NotNullLazyValue.createValue(() -> GenericUnwrapTool.exchangeTypeRef(myElement.getReturnTypeRef(), getGenericExtractor(), scope));
}
示例11: MsilMethodAsCSharpLikeMethodDeclaration
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
@RequiredReadAction
public MsilMethodAsCSharpLikeMethodDeclaration(PsiElement parent, @NotNull CSharpModifier[] modifiers, MsilMethodEntry methodEntry)
{
super(parent, methodEntry);
myModifierList = new MsilModifierListToCSharpModifierList(modifiers, this, methodEntry.getModifierList());
myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.getReturnTypeRef(), myOriginal));
myParameterTypeRefsValue = NotNullLazyValue.createValue(() ->
{
DotNetTypeRef[] parameters = myOriginal.getParameterTypeRefs();
DotNetTypeRef[] refs = new DotNetTypeRef[parameters.length];
for(int i = 0; i < parameters.length; i++)
{
refs[i] = MsilToCSharpUtil.extractToCSharp(parameters[i], myOriginal);
}
return refs;
});
}
示例12: ExtensibleQueryFactory
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
@Override
@Nonnull
protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
@Override
@Nonnull
protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
@NonNls String epName = ExtensibleQueryFactory.this.getClass().getName();
int pos = epName.lastIndexOf('.');
if (pos >= 0) {
epName = epName.substring(pos+1);
}
epName = epNamespace + "." + StringUtil.decapitalize(epName);
return Extensions.getRootArea().getExtensionPoint(epName);
}
};
}
};
}
示例13: collectFields
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private static NotNullLazyValue<Set<ArrangementSettingsToken>> collectFields(@Nonnull final Class<?> clazz) {
return new NotNullLazyValue<Set<ArrangementSettingsToken>>() {
@Nonnull
@Override
protected Set<ArrangementSettingsToken> compute() {
Set<ArrangementSettingsToken> result = ContainerUtilRt.newHashSet();
for (Field field : clazz.getFields()) {
if (ArrangementSettingsToken.class.isAssignableFrom(field.getType())) {
try {
result.add((ArrangementSettingsToken)field.get(null));
}
catch (IllegalAccessException e) {
assert false : e;
}
}
}
return result;
}
};
}
示例14: createLineMarkerInfo
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@Nonnull PsiElement element) {
final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
final String tooltip = renderer.getTooltipText();
NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
@Nonnull
@Override
protected Collection<? extends GotoRelatedItem> compute() {
if (myGotoRelatedItemProvider != null) {
return ContainerUtil.concat(myTargets.getValue(), myGotoRelatedItemProvider);
}
return Collections.emptyList();
}
};
return new RelatedItemLineMarkerInfo<PsiElement>(element, element.getTextRange(), renderer.getIcon(), Pass.LINE_MARKERS,
tooltip == null ? null : new ConstantFunction<PsiElement, String>(tooltip),
renderer.isNavigateAction() ? renderer : null, renderer.getAlignment(),
gotoTargets);
}
示例15: JavaOverrideImplementMemberChooser
import com.intellij.openapi.util.NotNullLazyValue; //导入依赖的package包/类
private JavaOverrideImplementMemberChooser(final PsiMethodMember[] allElements,
final PsiMethodMember[] onlyPrimaryElements,
final NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
final @NotNull Project project,
final boolean isInsertOverrideVisible,
final boolean merge,
final boolean toImplement,
final boolean sortedByOverriding)
{
super(false, true, project, isInsertOverrideVisible, null, null);
myAllElements = allElements;
myOnlyPrimaryElements = onlyPrimaryElements;
myLazyElementsWithPercent = lazyElementsWithPercent;
myProject = project;
myMerge = merge;
myToImplement = toImplement;
mySortedByOverriding = sortedByOverriding;
resetElements(getInitialElements(allElements, onlyPrimaryElements, lazyElementsWithPercent, merge, toImplement, sortedByOverriding));
init();
}