Java 类com.intellij.openapi.util.NotNullLazyValue 实例源码

项目:intellij-ce-playground    文件:JavaOverrideImplementMemberChooser.java   
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();
}
项目:intellij-ce-playground    文件:ExtensibleQueryFactory.java   
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);
        }
      };
    }
  };
}
项目:intellij-ce-playground    文件:JsonRpcDomainBean.java   
@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;
}
项目:intellij-ce-playground    文件:ProjectDataManager.java   
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;
    }
  };
}
项目:intellij-ce-playground    文件:StdArrangementTokens.java   
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;
    }
  };
}
项目:intellij-ce-playground    文件:NavigationGutterIconBuilder.java   
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);
    }
  };
}
项目:tools-idea    文件:JavaOverrideImplementMemberChooser.java   
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();
}
项目:tools-idea    文件:ExtensibleQueryFactory.java   
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);
        }
      };
    }
  };
}
项目:tools-idea    文件:StdArrangementTokens.java   
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;
    }
  };
}
项目:tools-idea    文件:NavigationGutterIconBuilder.java   
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);
}
项目:consulo-csharp    文件:CSharpAbstractLightAttributeBuilder.java   
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)));
    }));
}
项目:consulo-csharp    文件:CSharpUserTypeRef.java   
@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));
}
项目:consulo-csharp    文件:MsilMethodAsCSharpLikeMethodDeclaration.java   
@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;
    });
}
项目:consulo    文件:ExtensibleQueryFactory.java   
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);
        }
      };
    }
  };
}
项目:consulo    文件:StdArrangementTokens.java   
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;
    }
  };
}
项目:consulo    文件:NavigationGutterIconBuilder.java   
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);
}
项目:consulo-java    文件:JavaOverrideImplementMemberChooser.java   
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();
}
项目:catberry-idea-plugin    文件:TemplateEngineProvider.java   
public TemplateEngineProvider(Project project, NotNullLazyValue<ModificationTracker> tracker) {
  super(project);

  this.tracker = tracker;
  for (TemplateEngine engine : TemplateEngine.values()) {
    engines.put("catberry-" + engine, engine);
  }
}
项目:intellij-ce-playground    文件:JavaOverrideImplementMemberChooser.java   
private static PsiMethodMember[] getInitialElements(PsiMethodMember[] allElements,
                                                    PsiMethodMember[] onlyPrimaryElements,
                                                    NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
                                                    boolean merge,
                                                    boolean toImplement,
                                                    boolean sortByOverriding) {
  final boolean showElementsWithPercents = sortByOverriding && !toImplement;
  final PsiMethodMember[] defaultElements = toImplement || merge ? allElements : onlyPrimaryElements;
  return showElementsWithPercents ? lazyElementsWithPercent.getValue() : defaultElements;
}
项目:intellij-ce-playground    文件:JsonRpcServer.java   
public void registerDomain(@NotNull String name, @NotNull NotNullLazyValue commands, boolean overridable) {
  if (domains.containsKey(name)) {
    if (overridable) {
      return;
    }
    else {
      throw new IllegalArgumentException(name + " is already registered");
    }
  }

  domains.put(name, commands);
}
项目:intellij-ce-playground    文件:RelatedItemLineMarkerInfo.java   
public RelatedItemLineMarkerInfo(@NotNull T element, @NotNull TextRange range, Icon icon, int updatePass,
                                 @Nullable Function<? super T, String> tooltipProvider,
                                 @Nullable GutterIconNavigationHandler<T> navHandler,
                                 @NotNull GutterIconRenderer.Alignment alignment,
                                 @NotNull NotNullLazyValue<Collection<? extends GotoRelatedItem>> targets) {
  super(element, range, icon, updatePass, tooltipProvider, navHandler, alignment);
  myTargets = targets;
}
项目:intellij-ce-playground    文件:RelatedItemLineMarkerInfo.java   
public RelatedItemLineMarkerInfo(@NotNull T element, @NotNull TextRange range, Icon icon, int updatePass,
                                 @Nullable Function<? super T, String> tooltipProvider,
                                 @Nullable GutterIconNavigationHandler<T> navHandler,
                                 @NotNull GutterIconRenderer.Alignment alignment,
                                 @NotNull final Collection<? extends GotoRelatedItem> targets) {
  this(element, range, icon, updatePass, tooltipProvider, navHandler, alignment, new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
    @NotNull
    @Override
    protected Collection<? extends GotoRelatedItem> compute() {
      return targets;
    }
  });
}
项目:intellij-ce-playground    文件:InspectionManagerEx.java   
public InspectionManagerEx(final Project project) {
  super(project);
  if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myContentManager = new NotNullLazyValue<ContentManager>() {
      @NotNull
      @Override
      protected ContentManager compute() {
        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        toolWindowManager.registerToolWindow(ToolWindowId.INSPECTION, true, ToolWindowAnchor.BOTTOM, project);
        return ContentFactory.SERVICE.getInstance().createContentManager(new TabbedPaneContentUI(), true, project);
      }
    };
  }
  else {
    myContentManager = new NotNullLazyValue<ContentManager>() {
      @NotNull
      @Override
      protected ContentManager compute() {
        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.INSPECTION, true, ToolWindowAnchor.BOTTOM, project);
        ContentManager contentManager = toolWindow.getContentManager();
        toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowInspection);
        new ContentManagerWatcher(toolWindow, contentManager);
        return contentManager;
      }
    };
  }
}
项目:intellij-ce-playground    文件:WebProjectTemplate.java   
public void reset() {
  myPeerHolder = new NotNullLazyValue<GeneratorPeer<T>>() {
    @NotNull
    @Override
    protected GeneratorPeer<T> compute() {
      return createPeer();
    }
  };
}
项目:intellij-ce-playground    文件:PyClassImpl.java   
public boolean isNewStyleClass(@Nullable TypeEvalContext context) {
  return new NotNullLazyValue<ParameterizedCachedValue<Boolean, TypeEvalContext>>() {
    @NotNull
    @Override
    protected ParameterizedCachedValue<Boolean, TypeEvalContext> compute() {
      return CachedValuesManager.getManager(getProject()).createParameterizedCachedValue(new NewStyleCachedValueProvider(), false);
    }
  }.getValue().getValue(context);
}
项目:intellij-ce-playground    文件:NavigationGutterIconBuilder.java   
public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@NotNull PsiElement element) {
  final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
  final String tooltip = renderer.getTooltipText();
  NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = createGotoTargetsThunk(myLazy, myGotoRelatedItemProvider,
                                                                                               evaluateAndForget(myTargets));
  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);
}
项目:intellij-ce-playground    文件:NavigationGutterIconBuilder.java   
private static <T> Factory<T> evaluateAndForget(NotNullLazyValue<T> lazyValue) {
  final Ref<NotNullLazyValue<T>> ref = Ref.create(lazyValue);
  return new Factory<T>() {
    @Override
    public T create() {
      T result = ref.get().getValue();
      ref.set(null);
      return result;
    }
  };
}
项目:intellij-ce-playground    文件:NavigationGutterIconBuilder.java   
private MyNavigationGutterIconRenderer createGutterIconRenderer(@NotNull final Project project) {
  checkBuilt();

  NotNullLazyValue<List<SmartPsiElementPointer>> pointers = createPointersThunk(myLazy, project, evaluateAndForget(myTargets),
                                                                                myConverter);

  final boolean empty = isEmpty();

  if (myTooltipText == null && !myLazy) {
    final SortedSet<String> names = new TreeSet<String>();
    for (T t : myTargets.getValue()) {
      final String text = myNamer.fun(t);
      if (text != null) {
        names.add(MessageFormat.format(PATTERN, text));
      }
    }
    @NonNls StringBuilder sb = new StringBuilder("<html><body>");
    if (myTooltipTitle != null) {
      sb.append(myTooltipTitle).append("<br>");
    }
    for (String name : names) {
      sb.append(name).append("<br>");
    }
    sb.append("</body></html>");
    myTooltipText = sb.toString();
  }

  Computable<PsiElementListCellRenderer> renderer =
    myCellRenderer == null ? new Computable<PsiElementListCellRenderer>() {
      @Override
      public PsiElementListCellRenderer compute() {
        return new DefaultPsiElementCellRenderer();
      }
    } : myCellRenderer;
  return new MyNavigationGutterIconRenderer(this, myAlignment, myIcon, myTooltipText, pointers, renderer, empty);
}
项目:intellij-ce-playground    文件:NavigationGutterIconBuilder.java   
public MyNavigationGutterIconRenderer(@NotNull NavigationGutterIconBuilder builder,
                                      final Alignment alignment,
                                      final Icon icon,
                                      @Nullable final String tooltipText,
                                      @NotNull NotNullLazyValue<List<SmartPsiElementPointer>> pointers,
                                      Computable<PsiElementListCellRenderer> cellRenderer,
                                      boolean empty) {
  super(builder.myPopupTitle, builder.myEmptyText, cellRenderer, pointers);
  myAlignment = alignment;
  myIcon = icon;
  myTooltipText = tooltipText;
  myEmpty = empty;
}
项目:intellij-ce-playground    文件:NavigationGutterIconRenderer.java   
protected NavigationGutterIconRenderer(final String popupTitle, final String emptyText, @NotNull Computable<PsiElementListCellRenderer> cellRenderer,
  @NotNull NotNullLazyValue<List<SmartPsiElementPointer>> pointers) {
  myPopupTitle = popupTitle;
  myEmptyText = emptyText;
  myCellRenderer = cellRenderer;
  myPointers = pointers;
}
项目:tools-idea    文件:JavaOverrideImplementMemberChooser.java   
private static PsiMethodMember[] getInitialElements(PsiMethodMember[] allElements,
                                                    PsiMethodMember[] onlyPrimaryElements,
                                                    NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
                                                    boolean merge,
                                                    boolean toImplement,
                                                    boolean sortByOverriding) {
  final boolean showElementsWithPercents = sortByOverriding && !toImplement;
  final PsiMethodMember[] defaultElements = toImplement || merge ? allElements : onlyPrimaryElements;
  return showElementsWithPercents ? lazyElementsWithPercent.getValue() : defaultElements;
}
项目:tools-idea    文件:RelatedItemLineMarkerInfo.java   
public RelatedItemLineMarkerInfo(@NotNull T element, @NotNull TextRange range, Icon icon, int updatePass,
                                 @Nullable Function<? super T, String> tooltipProvider,
                                 @Nullable GutterIconNavigationHandler<T> navHandler,
                                 GutterIconRenderer.Alignment alignment,
                                 @NotNull NotNullLazyValue<Collection<? extends GotoRelatedItem>> targets) {
  super(element, range, icon, updatePass, tooltipProvider, navHandler, alignment);
  myTargets = targets;
}
项目:tools-idea    文件:RelatedItemLineMarkerInfo.java   
public RelatedItemLineMarkerInfo(@NotNull T element, @NotNull TextRange range, Icon icon, int updatePass,
                                 @Nullable Function<? super T, String> tooltipProvider,
                                 @Nullable GutterIconNavigationHandler<T> navHandler,
                                 GutterIconRenderer.Alignment alignment,
                                 @NotNull final Collection<? extends GotoRelatedItem> targets) {
  this(element, range, icon, updatePass, tooltipProvider, navHandler, alignment, new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
    @NotNull
    @Override
    protected Collection<? extends GotoRelatedItem> compute() {
      return targets;
    }
  });
}
项目:tools-idea    文件:InspectionManagerEx.java   
public InspectionManagerEx(final Project project) {
  super(project);
  if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myContentManager = new NotNullLazyValue<ContentManager>() {
      @NotNull
      @Override
      protected ContentManager compute() {
        return ContentFactory.SERVICE.getInstance().createContentManager(new TabbedPaneContentUI(), true, project);
      }
    };
  }
  else {
    myContentManager = new NotNullLazyValue<ContentManager>() {
      @NotNull
      @Override
      protected ContentManager compute() {
        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        ToolWindow toolWindow =
          toolWindowManager.registerToolWindow(ToolWindowId.INSPECTION, true, ToolWindowAnchor.BOTTOM, project);
        ContentManager contentManager = toolWindow.getContentManager();
        toolWindow.setIcon(AllIcons.Toolwindows.ToolWindowInspection);
        new ContentManagerWatcher(toolWindow, contentManager);
        return contentManager;
      }
    };
  }
}
项目:tools-idea    文件:CompletionUtil.java   
/** @see CompletionDataEP */
@Deprecated
public static void registerCompletionData(FileType fileType, final CompletionData completionData) {
  registerCompletionData(fileType, new NotNullLazyValue<CompletionData>() {
    @Override
    @NotNull
    protected CompletionData compute() {
      return completionData;
    }
  });
}
项目:tools-idea    文件:CompletionUtil.java   
@Nullable
public static CompletionData getCompletionDataByFileType(FileType fileType) {
  for(CompletionDataEP ep: Extensions.getExtensions(CompletionDataEP.EP_NAME)) {
    if (ep.fileType.equals(fileType.getName())) {
      return ep.getHandler();
    }
  }
  final NotNullLazyValue<CompletionData> lazyValue = ourCustomCompletionDatas.get(fileType);
  return lazyValue == null ? null : lazyValue.getValue();
}
项目:tools-idea    文件:NavigationGutterIconBuilder.java   
public NavigationGutterIconBuilder<T> setTargets(@NotNull final Collection<? extends T> targets) {
  myTargets = new NotNullLazyValue<Collection<? extends T>>() {
    @NotNull
    public Collection<? extends T> compute() {
      return targets;
    }
  };
  return this;
}
项目:tools-idea    文件:NavigationGutterIconBuilder.java   
public MyNavigationGutterIconRenderer(@NotNull NavigationGutterIconBuilder builder,
                                      final Alignment alignment,
                                      final Icon icon,
                                      @Nullable final String tooltipText,
                                      @NotNull NotNullLazyValue<List<SmartPsiElementPointer>> pointers,
                                      Computable<PsiElementListCellRenderer> cellRenderer,
                                      boolean empty) {
  super(builder.myPopupTitle, builder.myEmptyText, cellRenderer, pointers);
  myAlignment = alignment;
  myIcon = icon;
  myTooltipText = tooltipText;
  myEmpty = empty;
}
项目:tools-idea    文件:NavigationGutterIconRenderer.java   
protected NavigationGutterIconRenderer(final String popupTitle, final String emptyText, @NotNull Computable<PsiElementListCellRenderer> cellRenderer,
  @NotNull NotNullLazyValue<List<SmartPsiElementPointer>> pointers) {
  myPopupTitle = popupTitle;
  myEmptyText = emptyText;
  myCellRenderer = cellRenderer;
  myPointers = pointers;
}
项目:consulo-csharp    文件:CSharpAbstractLightAttributeBuilder.java   
@NotNull
@Override
public CSharpCallArgument[] getCallArguments()
{
    if(myCallArguments.isEmpty())
    {
        return CSharpCallArgument.EMPTY_ARRAY;
    }
    List<CSharpCallArgument> arguments = new ArrayList<>(myCallArguments.size());
    for(NotNullLazyValue<CSharpCallArgument> callArgument : myCallArguments)
    {
        arguments.add(callArgument.getValue());
    }
    return ContainerUtil.toArray(arguments, CSharpCallArgument.ARRAY_FACTORY);
}