本文整理匯總了Java中com.intellij.util.containers.ContainerUtil.ar方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerUtil.ar方法的具體用法?Java ContainerUtil.ar怎麽用?Java ContainerUtil.ar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.ar方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkFile
import com.intellij.util.containers.ContainerUtil; //導入方法依賴的package包/類
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull final InspectionManager manager, final boolean isOnTheFly) {
if (!(file instanceof PropertiesFile)) return null;
final List<IProperty> properties = ((PropertiesFile)file).getProperties();
final List<ProblemDescriptor> descriptors = new SmartList<ProblemDescriptor>();
for (IProperty property : properties) {
ProgressManager.checkCanceled();
final PropertyImpl propertyImpl = (PropertyImpl)property;
for (ASTNode node : ContainerUtil.ar(propertyImpl.getKeyNode(), propertyImpl.getValueNode())) {
if (node != null) {
PsiElement key = node.getPsi();
TextRange textRange = getTrailingSpaces(key, myIgnoreVisibleSpaces);
if (textRange != null) {
descriptors.add(manager.createProblemDescriptor(key, textRange, "Trailing spaces", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, true, new RemoveTrailingSpacesFix(myIgnoreVisibleSpaces)));
}
}
}
}
return descriptors.toArray(new ProblemDescriptor[descriptors.size()]);
}
示例2: FormDataTableCellEditor
import com.intellij.util.containers.ContainerUtil; //導入方法依賴的package包/類
public FormDataTableCellEditor(Project project, JBDebuggerFormTable.ItemInfo itemInfo) {
component = new JPanel(new BorderLayout());
editor = new EditorTextField("", project, StdFileTypes.PLAIN_TEXT);
component.add(editor, BorderLayout.CENTER);
combobox = new ComboBoxWithWidePopup<>(ContainerUtil.ar("Text", "File"));
combobox.setSelectedItem(StringUtil.isEmpty(itemInfo.type) ? "Text" : itemInfo.type);
combobox.setFocusable(false);
combobox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
itemInfo.type = e.getItem().toString();
}
});
component.add(combobox, BorderLayout.EAST);
}
示例3: MvcPathMacros
import com.intellij.util.containers.ContainerUtil; //導入方法依賴的package包/類
public MvcPathMacros() {
Set<String> macroNames = PathMacros.getInstance().getUserMacroNames();
for (String framework : ContainerUtil.ar("grails", "griffon")) {
String name = "USER_HOME_" + framework.toUpperCase();
if (!macroNames.contains(name)) { // OK, it may appear/disappear during the application lifetime, but we ignore that for now. Restart will help anyway
PathMacros.getInstance().addLegacyMacro(name, StringUtil.trimEnd(getSdkWorkDirParent(framework), "/"));
}
}
}
示例4: addGroovyAndAntJars
import com.intellij.util.containers.ContainerUtil; //導入方法依賴的package包/類
private static void addGroovyAndAntJars(JavaParameters params, Module module, String gantHome) {
final File[] groovyJars = GroovyConfigUtils.getGroovyAllJars(gantHome + "/lib/");
if (groovyJars.length > 0) {
params.getClassPath().add(groovyJars[0].getAbsolutePath());
}
if (module == null) {
return;
}
final String groovyHome = LibrariesUtil.getGroovyHomePath(module);
if (groovyHome != null) {
File[] libJars = GroovyUtils.getFilesInDirectoryByPattern(groovyHome + "/lib/", ".*\\.jar");
if (libJars.length > 0) {
params.getClassPath().addAllFiles(libJars);
}
}
List<VirtualFile> classpath = params.getClassPath().getRootDirs();
String[] characteristicClasses = ContainerUtil.ar(
LibrariesUtil.SOME_GROOVY_CLASS, "org.apache.tools.ant.BuildException", "org.apache.tools.ant.launch.AntMain",
"org.apache.commons.cli.ParseException");
for (String someClass : characteristicClasses) {
if (!LibraryUtil.isClassAvailableInLibrary(classpath, someClass)) {
VirtualFile jar = LibrariesUtil.findJarWithClass(module, someClass);
if (jar != null) {
params.getClassPath().add(jar);
}
}
}
}
示例5: addGrapeDependencies
import com.intellij.util.containers.ContainerUtil; //導入方法依賴的package包/類
private void addGrapeDependencies(List<VirtualFile> jars) {
final ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
final LibraryTable.ModifiableModel tableModel = model.getModuleLibraryTable().getModifiableModel();
for (VirtualFile jar : jars) {
final VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(jar);
if (jarRoot != null) {
OrderRootType rootType = OrderRootType.CLASSES;
String libName = "Grab:" + jar.getName();
for (String classifier : ContainerUtil.ar("sources", "source", "src")) {
if (libName.endsWith("-" + classifier + ".jar")) {
rootType = OrderRootType.SOURCES;
libName = StringUtil.trimEnd(libName, "-" + classifier + ".jar") + ".jar";
}
}
Library library = tableModel.getLibraryByName(libName);
if (library == null) {
library = tableModel.createLibrary(libName);
}
final Library.ModifiableModel libModel = library.getModifiableModel();
for (String url : libModel.getUrls(rootType)) {
libModel.removeRoot(url, rootType);
}
libModel.addRoot(jarRoot, rootType);
libModel.commit();
}
}
tableModel.commit();
model.commit();
}