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

项目:intellij-ce-playground    文件:VcsLogClassicFilterUi.java   
public VcsLogClassicFilterUi(@NotNull VcsLogUiImpl ui,
                             @NotNull VcsLogDataHolder logDataHolder,
                             @NotNull VcsLogUiProperties uiProperties,
                             @NotNull VcsLogDataPack initialDataPack) {
  myUi = ui;
  myLogDataHolder = logDataHolder;
  myUiProperties = uiProperties;
  myDataPack = initialDataPack;

  NotNullComputable<VcsLogDataPack> dataPackGetter = new NotNullComputable<VcsLogDataPack>() {
    @NotNull
    @Override
    public VcsLogDataPack compute() {
      return myDataPack;
    }
  };
  myBranchFilterModel = new BranchFilterModel(dataPackGetter);
  myUserFilterModel = new FilterModel<VcsLogUserFilter>(dataPackGetter);
  myDateFilterModel = new FilterModel<VcsLogDateFilter>(dataPackGetter);
  myStructureFilterModel = new FilterModel<VcsLogFileFilter>(dataPackGetter);
  myTextFilterModel = new TextFilterModel(dataPackGetter);

  updateUiOnFilterChange();
}
项目:consulo    文件:VcsLogClassicFilterUi.java   
public VcsLogClassicFilterUi(@Nonnull VcsLogUiImpl ui,
                             @Nonnull VcsLogData logData,
                             @Nonnull MainVcsLogUiProperties uiProperties,
                             @Nonnull VcsLogDataPack initialDataPack) {
  myUi = ui;
  myLogData = logData;
  myUiProperties = uiProperties;
  myDataPack = initialDataPack;

  NotNullComputable<VcsLogDataPack> dataPackGetter = () -> myDataPack;
  myBranchFilterModel = new BranchFilterModel(dataPackGetter, myUiProperties);
  myUserFilterModel = new UserFilterModel(dataPackGetter, uiProperties);
  myDateFilterModel = new DateFilterModel(dataPackGetter, uiProperties);
  myStructureFilterModel = new FileFilterModel(dataPackGetter, myLogData.getLogProviders().keySet(), uiProperties);
  myTextFilterModel = new TextFilterModel(dataPackGetter, myUiProperties);

  updateUiOnFilterChange();
  myUi.applyFiltersAndUpdateUi(getFilters());
}
项目:intellij-ce-playground    文件:LibraryCompositionSettings.java   
public LibraryCompositionSettings(final @NotNull CustomLibraryDescription libraryDescription,
                                  final @NotNull NotNullComputable<String> pathProvider,
                                  @NotNull FrameworkLibraryVersionFilter versionFilter,
                                  final List<? extends FrameworkLibraryVersion> allVersions) {
  myLibraryDescription = libraryDescription;
  myPathProvider = pathProvider;
  myVersionFilter = versionFilter;
  myNewLibraryLevel = libraryDescription.getDefaultLevel();
  myAllVersions = allVersions;
  final List<? extends FrameworkLibraryVersion> versions = getCompatibleVersions();
  if (!versions.isEmpty()) {
    myDownloadSettings = createDownloadSettings(versions.get(0));
  }
}
项目:intellij-ce-playground    文件:LibraryOptionsPanel.java   
public LibraryOptionsPanel(@NotNull final CustomLibraryDescription libraryDescription,
                           @NotNull final String path,
                           @NotNull final FrameworkLibraryVersionFilter versionFilter,
                           @NotNull final LibrariesContainer librariesContainer,
                           final boolean showDoNotCreateOption) {

  this(libraryDescription, new NotNullComputable<String>() {
    @NotNull
    @Override
    public String compute() {
      return path;
    }
  }, versionFilter, librariesContainer, showDoNotCreateOption);
}
项目:intellij-ce-playground    文件:LibraryOptionsPanel.java   
public LibraryOptionsPanel(@NotNull final CustomLibraryDescription libraryDescription,
                           @NotNull final NotNullComputable<String> pathProvider,
                           @NotNull final FrameworkLibraryVersionFilter versionFilter,
                           @NotNull final LibrariesContainer librariesContainer,
                           final boolean showDoNotCreateOption) {
  myLibraryDescription = libraryDescription;
  myLibrariesContainer = librariesContainer;
  final DownloadableLibraryDescription description = getDownloadableDescription(libraryDescription);
  if (description != null) {
    showCard("loading");
    description.fetchVersions(new DownloadableFileSetVersions.FileSetVersionsCallback<FrameworkLibraryVersion>() {
      @Override
      public void onSuccess(@NotNull final List<? extends FrameworkLibraryVersion> versions) {
        //noinspection SSBasedInspection
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            if (!myDisposed) {
              showSettingsPanel(libraryDescription, pathProvider, versionFilter, showDoNotCreateOption, versions);
              onVersionChanged(getPresentableVersion());
            }
          }
        });
      }
    });
  }
  else {
    showSettingsPanel(libraryDescription, pathProvider, versionFilter, showDoNotCreateOption,
                      new ArrayList<FrameworkLibraryVersion>());
  }
}
项目:intellij-ce-playground    文件:StubIndexImpl.java   
public <K> void updateIndex(@NotNull StubIndexKey key, int fileId, @NotNull final Map<K, StubIdList> oldValues, @NotNull final Map<K, StubIdList> newValues) {
  try {
    final MyIndex<K> index = (MyIndex<K>)myIndices.get(key);
    UpdateData<K, StubIdList> updateData;

    if (MapDiffUpdateData.ourDiffUpdateEnabled) {
      updateData = new MapDiffUpdateData<K, StubIdList>(key) {
        @Override
        public void save(int inputId) throws IOException {
        }

        @Override
        protected Map<K, StubIdList> getNewValue() {
          return newValues;
        }

        @Override
        protected Map<K, StubIdList> getCurrentValue() throws IOException {
          return oldValues;
        }
      };
    } else {
      updateData = index.new SimpleUpdateData(key, fileId, newValues, new NotNullComputable<Collection<K>>() {
        @NotNull
        @Override
        public Collection<K> compute() {
          return oldValues.keySet();
        }
      });
    }
    index.updateWithMap(fileId, updateData);
  }
  catch (StorageException e) {
    LOG.info(e);
    requestRebuild();
  }
}
项目:intellij-ce-playground    文件:FrameworkSupportOptionsComponent.java   
public FrameworkSupportOptionsComponent(FrameworkSupportModelBase model,
                                        LibrariesContainer container,
                                        Disposable parentDisposable,
                                        final FrameworkSupportInModuleProvider provider,
                                        final FrameworkSupportInModuleConfigurable configurable) {
  myModel = model;
  myConfigurable = configurable;
  VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 3, true, false);
  layout.setVerticalFill(true);
  myMainPanel = new JPanel(layout);
  myModel.registerOptionsComponent(provider, this);
  List<FrameworkVersion> versions = provider.getFrameworkType().getVersions();
  if (!versions.isEmpty()) {
    myFrameworkVersionComponent = new FrameworkVersionComponent(model, provider.getFrameworkType().getId(), versions, "Versions:");
    myMainPanel.add(myFrameworkVersionComponent.getMainPanel());
  }
  else {
    myFrameworkVersionComponent = null;
  }

  final JComponent component = myConfigurable.createComponent();
  if (component != null) {
    myMainPanel.add(component);
  }

  final boolean addSeparator = component != null || myFrameworkVersionComponent != null;
  myLibraryOptionsPanelWrapper = new JPanel(new BorderLayout());
  myMainPanel.add(myLibraryOptionsPanelWrapper);
  if (myConfigurable instanceof OldFrameworkSupportProviderWrapper.FrameworkSupportConfigurableWrapper) {
    ((OldFrameworkSupportProviderWrapper.FrameworkSupportConfigurableWrapper)myConfigurable).getConfigurable().addListener(
      new FrameworkSupportConfigurableListener() {
        public void frameworkVersionChanged() {
          updateLibrariesPanel();
        }
      });
  }
  model.addFrameworkListener(new FrameworkSupportModelAdapter() {
    @Override
    public void wizardStepUpdated() {
      updateLibrariesPanel();
    }
  }, parentDisposable);

  final CustomLibraryDescription description = myConfigurable.createLibraryDescription();
  if (description != null) {
    myLibraryOptionsPanel = new LibraryOptionsPanel(description, new NotNullComputable<String>() {
      @NotNull
      @Override
      public String compute() {
        return myModel.getBaseDirectoryForLibrariesPath();
      }
    }, createLibraryVersionFilter(), container, !myConfigurable.isOnlyLibraryAdded()) {
      @Override
      protected void onVersionChanged(@Nullable String version) {
        if (myFrameworkVersionComponent == null) {
          myModel.setSelectedLibraryVersion(provider.getId(), version);
        }
      }
    };
    myLibraryOptionsPanel.setLibraryProvider(myModel.getLibraryProvider());
    Disposer.register(myConfigurable, myLibraryOptionsPanel);
    if (addSeparator) {
      JComponent separator1 = SeparatorFactory.createSeparator("Libraries", null);
      separator1.setBorder(IdeBorderFactory.createEmptyBorder(5, 0, 5, 5));
      myLibraryOptionsPanelWrapper.add(BorderLayout.NORTH, separator1);
    }
    myLibraryOptionsPanelWrapper.add(BorderLayout.CENTER, myLibraryOptionsPanel.getMainPanel());
    myLibraryOptionsPanelWrapper.setVisible(myConfigurable.isVisible());
  }
}
项目:intellij-ce-playground    文件:VcsLogClassicFilterUi.java   
public TextFilterModel(NotNullComputable<VcsLogDataPack> dataPackProvider) {
  super(dataPackProvider);
}
项目:consulo    文件:VcsLogClassicFilterUi.java   
public TextFilterModel(NotNullComputable<VcsLogDataPack> dataPackProvider, @Nonnull MainVcsLogUiProperties properties) {
  super("text", dataPackProvider, properties);
}
项目:consulo    文件:VcsLogClassicFilterUi.java   
public FileFilterModel(NotNullComputable<VcsLogDataPack> dataPackGetter,
                       @Nonnull Set<VirtualFile> roots,
                       MainVcsLogUiProperties uiProperties) {
  super("file", dataPackGetter, uiProperties);
  myRoots = roots;
}
项目:consulo    文件:VcsLogClassicFilterUi.java   
public DateFilterModel(NotNullComputable<VcsLogDataPack> dataPackGetter, MainVcsLogUiProperties uiProperties) {
  super("date", dataPackGetter, uiProperties);
}
项目:consulo    文件:VcsLogClassicFilterUi.java   
public UserFilterModel(NotNullComputable<VcsLogDataPack> dataPackGetter, MainVcsLogUiProperties uiProperties) {
  super("user", dataPackGetter, uiProperties);
}