@NotNull public String[] getArray() { return ArrayUtil.toStringArray(getList()); }
@NotNull private String[] selectedCustomTags() { return ArrayUtil.toStringArray(StringUtil.split(myCustomTagsField.getText(), " ")); }
private JComponent createNamePanel() { JPanel panel = new JPanel(new BorderLayout()); String[] names = ArrayUtil.toStringArray(myOperation.getSuggestedNames()); myNameField = new NameSuggestionsField(names, myOperation.getProject(), GoFileType.INSTANCE); myNameField.setBorder(IdeBorderFactory.createEmptyBorder(3, 5, 2, 3)); myNameField.addDataChangedListener(this::validateButtons); JLabel label = new JLabel(UIUtil.replaceMnemonicAmpersand(RefactoringBundle.message("name.prompt"))); label.setLabelFor(myNameField); panel.add(myNameField, BorderLayout.CENTER); panel.add(label, BorderLayout.WEST); return panel; }
@NotNull public static String[] getCreateProjectCommand(@NotNull SymfonyInstallerVersion version, @NotNull String installerPath, @NotNull String newProjectPath, @NotNull String phpPath, @Nullable String commandLineOptions) { List<String> commands = new ArrayList<>(); commands.add(phpPath); commands.add(installerPath); // "php symfony demo" if("demo".equals(version.getVersion())) { commands.add("demo"); commands.add(newProjectPath + "/" + PROJECT_SUB_FOLDER); } else { commands.add("new"); commands.add(newProjectPath + "/" + PROJECT_SUB_FOLDER); commands.add(version.getVersion()); } if(commandLineOptions != null) { commands.add(commandLineOptions); } return ArrayUtil.toStringArray(commands); }
@NotNull @Override public String[] getNames(Project project, boolean b) { if(!Symfony2ProjectComponent.isEnabled(project)) { return new String[0]; } Collection<String> services = ContainerCollectionResolver.getServiceNames(project); return ArrayUtil.toStringArray(services); }
@NotNull @Override public String[] getNames(Project project, boolean b) { if(!Symfony2ProjectComponent.isEnabled(project)) { return new String[0]; } Set<String> routeNames = new HashSet<>(); Map<String, Route> routes = RouteHelper.getAllRoutes(project); for (Route route : routes.values()) { routeNames.add(route.getName()); } return ArrayUtil.toStringArray(routeNames); }
@NotNull @Override public String[] getNames(Project project, boolean b) { if(!Symfony2ProjectComponent.isEnabled(project)) { return new String[0]; } Set<String> routeNames = new HashSet<>(); for (SymfonyCommand symfonyCommand : SymfonyCommandUtil.getCommands(project)) { routeNames.add(symfonyCommand.getName()); } return ArrayUtil.toStringArray(routeNames); }
@NotNull @Override public String[] getNames(Project project, boolean b) { return ArrayUtil.toStringArray(PerlPackageUtil.getDefinedPackageNames(project)); }
private static String[] loadFile(File f1) { if (!f1.exists()) { return ArrayUtil.EMPTY_STRING_ARRAY; } ArrayList<String> list = new ArrayList<String>(); BufferedReader in = null; try { in = new BufferedReader(new FileReader(f1)); String str; while ((str = in.readLine()) != null) { list.add(str); } } catch (Exception ex) { ex.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } } return ArrayUtil.toStringArray(list); }
@NotNull @Override public String[] getNames(final Project project, final boolean includeNonProjectItems) { return ArrayUtil.toStringArray(StubIndex.getInstance().getAllKeys(DAllNameIndex.KEY, project)); }
@NotNull @Override public String[] getNames(final Project project, final boolean includeNonProjectItems) { return ArrayUtil.toStringArray(StubIndex.getInstance().getAllKeys(DAllNameIndex.KEY, project)); }
public PerlInjectionMarkersTable(@NotNull Project project) { super(new MyModel()); myProject = project; final TableColumn languageColumn = getColumnModel().getColumn(1); List<String> languageIds = Language.getRegisteredLanguages().stream() .map(Language::getID) .filter(it -> !it.isEmpty()) .sorted() .collect(Collectors.toList()); ComboBoxTableRenderer<String> roleComboBoxTableRenderer = new ComboBoxTableRenderer<String>(ArrayUtil.toStringArray(languageIds)) { @Override public boolean isCellEditable(EventObject event) { if (event instanceof MouseEvent) { return ((MouseEvent)event).getClickCount() >= 1; } return true; } }; languageColumn.setCellRenderer(roleComboBoxTableRenderer); languageColumn.setCellEditor(roleComboBoxTableRenderer); getColumnModel().getColumn(0).setPreferredWidth(200); languageColumn.setPreferredWidth(600); }
private void generatePsiIntf(BnfRule rule, RuleInfo info) { String psiClass = info.intfClass; String stubClass = info.stub; Collection<String> psiSupers = info.superInterfaces; if (StringUtil.isNotEmpty(stubClass)) { psiSupers = new LinkedHashSet<>(psiSupers); psiSupers.add(STUB_BASED_PSI_ELEMENT + "<" + stubClass + ">"); } Set<String> imports = ContainerUtil.newLinkedHashSet(); imports.addAll(Arrays.asList("java.util.List", "org.jetbrains.annotations.*", PSI_ELEMENT_CLASS)); imports.addAll(psiSupers); imports.addAll(getRuleMethodTypesToImport(rule)); generateClassHeader(psiClass, imports, "", Java.INTERFACE, ArrayUtil.toStringArray(psiSupers)); generatePsiClassMethods(rule, info, true); out("}"); }
public static String[] getReadableProperties(PsiClass aClass, boolean includeSuperClass) { List<String> result = new ArrayList<String>(); PsiMethod[] methods; if (includeSuperClass) { methods = aClass.getAllMethods(); } else { methods = aClass.getMethods(); } for (PsiMethod method : methods) { if (CommonClassNames.JAVA_LANG_OBJECT.equals(method.getContainingClass().getQualifiedName())) continue; if (isSimplePropertyGetter(method)) { result.add(getPropertyName(method)); } } return ArrayUtil.toStringArray(result); }
public static String[] getWritableProperties(PsiClass aClass, boolean includeSuperClass) { List<String> result = new ArrayList<String>(); PsiMethod[] methods; if (includeSuperClass) { methods = aClass.getAllMethods(); } else { methods = aClass.getMethods(); } for (PsiMethod method : methods) { if (CommonClassNames.JAVA_LANG_OBJECT.equals(method.getContainingClass().getQualifiedName())) continue; if (isSimplePropertySetter(method)) { result.add(getPropertyName(method)); } } return ArrayUtil.toStringArray(result); }
protected boolean validateCommon() throws ConfigurationException { final Set<HybrisModuleDescriptor> moduleDuplicates = this.calculateSelectedModuleDuplicates(); final Collection<String> moduleDuplicateNames = newHashSet(moduleDuplicates.size()); for (HybrisModuleDescriptor moduleDuplicate : moduleDuplicates) { moduleDuplicateNames.add(this.getModuleNameAndPath(moduleDuplicate)); } if (!moduleDuplicates.isEmpty()) { throw new ConfigurationException( HybrisI18NBundleUtils.message( "hybris.project.import.duplicate.projects.found", StringUtil.join(ArrayUtil.toStringArray(moduleDuplicateNames), "\n") ), HybrisI18NBundleUtils.message("hybris.project.error") ); } return true; }
@NotNull @Override public String[] getNames(final Project project, final boolean includeNonProjectItems) { if (includeNonProjectItems || !CommonIdeaService.getInstance().isHybrisProject(project)) { return ArrayUtil.EMPTY_STRING_ARRAY; } final GlobalSearchScope scope = new OotbClassesSearchScope(project); final List<String> result = new ArrayList<>(); final Processor<String> processor = Processors.cancelableCollectProcessor(result); PsiShortNamesCache.getInstance(project).processAllClassNames( processor, scope, IdFilter.getProjectIdFilter(project, true) ); return ArrayUtil.toStringArray(result); }
private void doTest(String text, boolean first, String... expected) { BnfFile f = (BnfFile)myFixture.configureByText("a.bnf", text); List<BnfRule> rules = f.getRules(); assertFalse(rules.isEmpty()); BnfFirstNextAnalyzer analyzer = new BnfFirstNextAnalyzer().setPredicateLookAhead(true); Set<String> strings = analyzer.asStrings(first? analyzer.calcFirst(rules.get(0)) : analyzer.calcNext(rules.get(0)).keySet()); String[] result = ArrayUtil.toStringArray(strings); Arrays.sort(result); assertOrderedEquals(result, expected); } }
String[] imagesArray = ArrayUtil.toStringArray(images); int[] resultIndex = new int[]{-1}; ApplicationManager.getApplication().invokeAndWait(
@Nullable protected PerlWslData createDataInteractively() { String[] ids = ArrayUtil.toStringArray(ContainerUtil.map(WSLUtil.getAvailableDistributions(), WSLDistribution::getId)); if (ids.length < 1) { return null; } int[] result = new int[]{-1}; ApplicationManager.getApplication().invokeAndWait( () -> result[0] = Messages.showChooseDialog( PerlWslBundle.message("perl.host.handler.wsl.choose.distro.message"), PerlWslBundle.message("perl.host.handler.wsl.choose.distro.title"), ids, ids[0], null)); int index = result[0]; if (index < 0 || index >= ids.length) { return null; } PerlWslData hostData = createData(); hostData.setDistributionId(ids[index]); return hostData; }