• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LibraryEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createOptionsPanel

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
  myLibraryEditorComponent = new LibraryRootsComponent(myProject, new Computable<LibraryEditor>() {
    @Override
    public LibraryEditor compute() {
      return getLibraryEditor();
    }
  });
  myLibraryEditorComponent.addListener(new Runnable() {
    @Override
    public void run() {
      myContext.getDaemonAnalyzer().queueUpdate(myProjectStructureElement);
      updateName();
    }
  });
  return myLibraryEditorComponent.getComponent();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:LibraryConfigurable.java


示例2: getPresentableVersion

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Nullable
private String getPresentableVersion() {
  switch (myButtonEnumModel.getSelected()) {
    case DOWNLOAD:
      LibraryDownloadSettings settings = mySettings.getDownloadSettings();
      if (settings != null) {
        return settings.getVersion().getVersionNumber();
      }
      break;
    case USE_LIBRARY:
      LibraryEditor item = myLibraryComboBoxModel.getSelectedItem();
      if (item instanceof ExistingLibraryEditor) {
        return item.getName();
      }
      break;
    default:
      return null;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:LibraryOptionsPanel.java


示例3: EditLibraryDialog

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
public EditLibraryDialog(Component parent, LibraryCompositionSettings settings, final LibraryEditor libraryEditor) {
  super(parent, true);
  mySettings = settings;
  myLibraryEditor = libraryEditor;
  myLibraryRootsComponent = new LibraryRootsComponent(null, libraryEditor);
  myLibraryRootsComponent.resetProperties();

  Disposer.register(getDisposable(), myLibraryRootsComponent);

  final boolean newLibrary = libraryEditor instanceof NewLibraryEditor;
  setTitle((newLibrary ? "Create" : "Edit") + " Library");

  myBuilder = LibraryNameAndLevelPanel.createFormBuilder();
  myNameAndLevelPanel = new LibraryNameAndLevelPanel(myBuilder, libraryEditor.getName(), newLibrary ? settings.getNewLibraryLevel() : null);
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:EditLibraryDialog.java


示例4: createNewLibrary

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public NewLibraryConfiguration createNewLibrary(@NotNull JComponent parentComponent, VirtualFile contextDirectory) {
  final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, false, true, false, false, true);
  descriptor.setTitle(IdeBundle.message("new.library.file.chooser.title"));
  descriptor.setDescription(IdeBundle.message("new.library.file.chooser.description"));
  final VirtualFile[] files = FileChooser.chooseFiles(descriptor, parentComponent, null, contextDirectory);
  if (files.length == 0) {
    return null;
  }
  return new NewLibraryConfiguration(myDefaultLibraryName, getDownloadableLibraryType(), new LibraryVersionProperties()) {
    @Override
    public void addRoots(@NotNull LibraryEditor editor) {
      for (VirtualFile file : files) {
        editor.addRoot(file, OrderRootType.CLASSES);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:CustomLibraryDescriptionBase.java


示例5: save

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
private void save() {
  if (myLibraryEditorComponent != null) {
    executeProjectChanges(myProject, new Runnable() {
      @Override
      public void run() {
        LibraryEditor editor = myLibraryEditorComponent.getLibraryEditor();
        Library.ModifiableModel libraryModel = myLibrary.getModifiableModel();
        try {
          addUrls(editor, libraryModel, SOURCES);
          addUrls(editor, libraryModel, JavadocOrderRootType.getInstance());
        }
        finally {
          libraryModel.commit();
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LibraryPropertiesDialog.java


示例6: resolveAndDownload

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
public static NewLibraryConfiguration resolveAndDownload(final Project project,
                                                         final String coord,
                                                         boolean attachJavaDoc,
                                                         boolean attachSources,
                                                         @Nullable final String copyTo,
                                                         List<MavenRepositoryInfo> repositories) {
  RepositoryLibraryProperties libraryProperties = new RepositoryLibraryProperties(coord);
  final List<OrderRoot> roots = MavenDependenciesRemoteManager.getInstance(project)
    .downloadDependenciesModal(libraryProperties, attachSources, attachJavaDoc, copyTo);
  if (roots == null || roots.size() == 0) {
    return null;
  }
  notifyArtifactsDownloaded(project, roots);
  RepositoryLibraryDescription libraryDescription = RepositoryLibraryDescription.findDescription(libraryProperties);
  return new NewLibraryConfiguration(
    libraryDescription.getDisplayName(libraryProperties.getVersion()),
    RepositoryLibraryType.getInstance(),
    new RepositoryLibraryProperties(coord)) {
    @Override
    public void addRoots(@NotNull LibraryEditor editor) {
      editor.addRoots(roots);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RepositoryAttachHandler.java


示例7: fillLibrary

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
protected void fillLibrary(String path, LibraryEditor libraryEditor) {
  File srcRoot = new File(path + "/src/main");
    if (srcRoot.exists()) {
      libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(srcRoot), OrderRootType.SOURCES);
    }

    File[] jars;
    File libDir = new File(path + "/lib");
    if (libDir.exists()) {
      jars = libDir.listFiles();
    } else {
      jars = new File(path + "/embeddable").listFiles();
    }
    if (jars != null) {
      for (File file : jars) {
        if (file.getName().endsWith(".jar")) {
          libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES);
        }
      }
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:GroovyLibraryPresentationProvider.java


示例8: fillLibrary

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
protected void fillLibrary(String path, LibraryEditor libraryEditor) {
  File srcRoot = new File(path + "/src/main");
  if (srcRoot.exists()) {
    libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(srcRoot), OrderRootType.SOURCES);
  }

  // Add Gant jars
  File lib = new File(path + "/lib");
  File[] jars = lib.exists() ? lib.listFiles() : new File[0];
  if (jars != null) {
    for (File file : jars) {
      if (file.getName().endsWith(".jar")) {
        libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:GantLibraryPresentationProvider.java


示例9: addSources

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
private static void addSources(LibraryEditor libraryEditor, File srcRoot) {
  File compilerSrc = new File(srcRoot, "Compiler/src");
  if (compilerSrc.exists()) {
    libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(compilerSrc), OrderRootType.SOURCES);
  }

  File stdLibSrc = new File(srcRoot, "StdLib/src");
  if (stdLibSrc.exists()) {
    libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(stdLibSrc), OrderRootType.SOURCES);
  }

  File mainSrc = new File(srcRoot, "main");
  if (mainSrc.exists()) {
    libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(mainSrc), OrderRootType.SOURCES);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GppLibraryPresentationProvider.java


示例10: createNewLibrary

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public NewLibraryConfiguration createNewLibrary(@NotNull JComponent jComponent, @Nullable VirtualFile virtualFile,
                                                @NotNull Project project) {
    final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createAllButJarContentsDescriptor();
    descriptor.setTitle(LuaBundle.message("new.library.file.chooser.title"));
    descriptor.setDescription(LuaBundle.message("new.library.file.chooser.description"));
    final VirtualFile[] files = FileChooser.chooseFiles(descriptor, jComponent, project, virtualFile);
    if (files.length == 0) {
        return null;
    }
    return new NewLibraryConfiguration("Lua Library", this, new DummyLibraryProperties()) {
        @Override
        public void addRoots(@NotNull LibraryEditor editor) {
            for (VirtualFile file : files) {
                editor.addRoot(file, OrderRootType.CLASSES);
            }
        }
    };
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:20,代码来源:LuaLibraryType.java


示例11: attachLibrary

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Nullable
public static NewLibraryConfiguration attachLibrary(final @NotNull Project project,
                                                    List<DeftRegistryEntryInfo> registryEntries) {
  final Ref<NewLibraryConfiguration> result = Ref.create(null);

  for (DeftRegistryEntryInfo registryEntry : registryEntries) {
    AccessToken accessToken = WriteAction.start();
    try {
      final List<OrderRoot> roots = createRoots(registryEntry);

      result.set(new NewLibraryConfiguration(registryEntry.getLibraryName(),
                     DeftLibraryType.getInstance(),
                     new DeftLibraryProperties(registryEntry.getLibraryName())) {
                         @Override
                         public void addRoots(@NotNull LibraryEditor editor) {
                           editor.addRoots(roots);
                         }
                       });
    } finally {
      accessToken.finish();
    }
  }

  return result.get();
}
 
开发者ID:dylan-foundry,项目名称:DeftIDEA,代码行数:26,代码来源:LibraryAttachHandler.java


示例12: addRoots

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public void addRoots(@NotNull LibraryEditor editor)
{
    final List<File> libs = muleSdk.getLibraryEntries();
    for (File file : libs)
    {
        editor.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES);
    }
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:10,代码来源:MuleLibraryDescription.java


示例13: isChanged

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public boolean isChanged() {
  for (LibraryEditor libraryEditor : myLibrary2EditorMap.values()) {
    if (libraryEditor.hasChanges()) return true;
  }
  return getLibrariesModifiableModel().isChanged();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:LibrariesModifiableModel.java


示例14: doConfigure

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
private void doConfigure() {
  switch (myButtonEnumModel.getSelected()) {
    case DOWNLOAD:
      final LibraryDownloadSettings oldDownloadSettings = mySettings.getDownloadSettings();
      LOG.assertTrue(oldDownloadSettings != null);
      final LibraryDownloadSettings newDownloadSettings = DownloadingOptionsDialog.showDialog(myPanel, oldDownloadSettings,
                                                                                              mySettings.getCompatibleVersions(), true);
      if (newDownloadSettings != null) {
        mySettings.setDownloadSettings(newDownloadSettings);
      }
      break;

    case USE_LIBRARY:
      final Object item = myExistingLibraryComboBox.getSelectedItem();
      if (item instanceof LibraryEditor) {
        EditLibraryDialog dialog = new EditLibraryDialog(myPanel, mySettings, (LibraryEditor)item);
        dialog.show();
        if (item instanceof ExistingLibraryEditor) {
          new WriteAction() {
            protected void run(@NotNull final Result result) {
              ((ExistingLibraryEditor)item).commit();
            }
          }.execute();
        }
      }
      break;

    case USE_FROM_PROVIDER:
    case SETUP_LIBRARY_LATER:
      break;
  }
  updateState();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:LibraryOptionsPanel.java


示例15: selectFiles

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public VirtualFile[] selectFiles(final @NotNull JComponent parent, @Nullable VirtualFile initialSelection,
                                 final @Nullable Module contextModule, @NotNull LibraryEditor libraryEditor) {
  final FileChooserDescriptor chooserDescriptor = createChooserDescriptor();
  chooserDescriptor.setTitle(getChooserTitle(libraryEditor.getName()));
  chooserDescriptor.setDescription(getChooserDescription());
  if (contextModule != null) {
    chooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, contextModule);
  }
  return FileChooser.chooseFiles(chooserDescriptor, parent, contextModule != null ? contextModule.getProject() : null, initialSelection);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ChooserBasedAttachRootButtonDescriptor.java


示例16: doCreate

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
private static <P extends LibraryProperties<?>> NewLibraryConfiguration doCreate(final LibraryType<P> type, final String name, final List<OrderRoot> roots) {
  return new NewLibraryConfiguration(name, type, type != null ? type.getKind().createDefaultProperties() : null) {
    @Override
    public void addRoots(@NotNull LibraryEditor editor) {
      editor.addRoots(roots);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LibraryTypeServiceImpl.java


示例17: addUrls

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
private static void addUrls(@NotNull LibraryEditor editor, @NotNull Library.ModifiableModel libraryModel, @NotNull OrderRootType type) {
  Set<String> existingUrls = Sets.newHashSet(libraryModel.getUrls(type));
  for (String url : editor.getUrls(type)) {
    if (!existingUrls.contains(url)) {
      libraryModel.addRoot(url, type);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LibraryPropertiesDialog.java


示例18: fillLibrary

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
protected void fillLibrary(String path, LibraryEditor libraryEditor) {
  File lib = new File(path + "/lib");
  File[] jars = lib.exists() ? lib.listFiles() : new File[0];
  if (jars != null) {
    for (File file : jars) {
      if (file.getName().endsWith(".jar")) {
        libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GradleLibraryPresentationProvider.java


示例19: edit

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
protected void edit() {
  @NotNull RepositoryLibraryProperties properties = myEditorComponent.getProperties();
  //String oldVersion = properties.getVersion();
  boolean wasGeneratedName =
    RepositoryLibraryType.getInstance().getDescription(properties).equals(myEditorComponent.getLibraryEditor().getName());
  RepositoryLibraryPropertiesModel model = new RepositoryLibraryPropertiesModel(
    properties.getVersion(),
    RepositoryUtils.libraryHasSources(myEditorComponent.getLibraryEditor()),
    RepositoryUtils.libraryHasJavaDocs(myEditorComponent.getLibraryEditor()));
  RepositoryLibraryPropertiesDialog dialog = new RepositoryLibraryPropertiesDialog(
    myEditorComponent.getProject(),
    model,
    RepositoryLibraryDescription.findDescription(properties),
    true);
  if (!dialog.showAndGet()) {
    return;
  }
  myEditorComponent.getProperties().changeVersion(model.getVersion());
  if (wasGeneratedName) {
    myEditorComponent.renameLibrary(RepositoryLibraryType.getInstance().getDescription(properties));
  }

  final LibraryEditor libraryEditor = myEditorComponent.getLibraryEditor();
  MavenDependenciesRemoteManager.getInstance(myEditorComponent.getProject())
    .downloadDependenciesAsync(
      properties,
      model.isDownloadSources(),
      model.isDownloadJavaDocs(),
      RepositoryUtils.getStorageRoot(myEditorComponent.getLibraryEditor().getUrls(OrderRootType.CLASSES), myEditorComponent.getProject()),
      new MavenRemoteTask.ResultProcessor<List<OrderRoot>>() {
        @Override
        public void process(List<OrderRoot> roots) {
          libraryEditor.removeAllRoots();
          libraryEditor.addRoots(roots);
        }
      }
    );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:RepositoryLibraryWithDescriptionEditor.java


示例20: selectFiles

import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor; //导入依赖的package包/类
@Override
public VirtualFile[] selectFiles(@NotNull JComponent parent,
                                 @Nullable VirtualFile initialSelection,
                                 @Nullable Module contextModule,
                                 @NotNull LibraryEditor libraryEditor) {
    final VirtualFile vFile = Util.showSpecifyJavadocUrlDialog(parent);
    if (vFile != null) {
        return new VirtualFile[]{vFile};
    }
    return VirtualFile.EMPTY_ARRAY;
}
 
开发者ID:shekn-itrtch,项目名称:DLangPlugin,代码行数:12,代码来源:DLangLibraryRootsComponentDescriptor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OFTableStatistics类代码示例发布时间:2022-05-22
下一篇:
Java BuildConfig类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap