当前位置: 首页>>代码示例>>Java>>正文


Java LibraryEditor类代码示例

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


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


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