Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
69,100 | AppDictionaryState () { return ApplicationManager.getApplication().getService(AppDictionaryState.class); } | getInstance |
69,101 | void (@NotNull DictionaryState state) { if (state.name == null) { state.name = DEFAULT_NAME; } super.loadState(state); myDictListenerEventDispatcher.getMulticaster().dictChanged(getDictionary()); } | loadState |
69,102 | void (DictionaryStateListener listener, Disposable parentDisposable) { myDictListenerEventDispatcher.addListener(listener, parentDisposable); } | addAppDictListener |
69,103 | void (@NotNull EditableDictionary dictionary) { this.dictionary = dictionary; this.name = dictionary.getName(); synchronizeWords(); } | setDictionary |
69,104 | EditableDictionary () { return dictionary; } | getDictionary |
69,105 | DictionaryState () { synchronizeWords(); return this; } | getState |
69,106 | void () { if (dictionary != null) { this.words = CollectionFactory.createSmallMemoryFootprintSet(dictionary.getWords()); } } | synchronizeWords |
69,107 | void (@NotNull DictionaryState state) { if (state.name != null) { name = state.name; words = state.words; } retrieveDictionary(); } | loadState |
69,108 | void () { assert name != null; dictionary = new UserDictionary(name); dictionary.addToDictionary(words); } | retrieveDictionary |
69,109 | String () { return "DictionaryState{" + "dictionary=" + dictionary + '}'; } | toString |
69,110 | void (ProjectDictionary projectDictionary) { dictionaryStates.clear(); Set<EditableDictionary> projectDictionaries = projectDictionary.getDictionaries(); if (projectDictionaries != null) { for (EditableDictionary dic : projectDictionary.getDictionaries()) { dictionaryStates.add(new DictionaryState(dic)); } } } | setProjectDictionary |
69,111 | ProjectDictionary () { if (projectDictionary == null) { projectDictionary = new ProjectDictionary(); } return projectDictionary; } | getProjectDictionary |
69,112 | ProjectDictionaryState () { if (projectDictionary != null) { //ensure all dictionaries within project dictionary will be stored setProjectDictionary(projectDictionary); } return this; } | getState |
69,113 | void (@NotNull ProjectDictionaryState state) { this.dictionaryStates = state.dictionaryStates; retrieveProjectDictionaries(); } | loadState |
69,114 | void () { Set<EditableDictionary> dictionaries = new HashSet<>(); if (dictionaryStates != null) { for (DictionaryState dictionaryState : dictionaryStates) { dictionaryState.loadState(dictionaryState); dictionaries.add(dictionaryState.getDictionary()); } } projectDictionary = new ProjectDictionary(dictionaries); myDictL... | retrieveProjectDictionaries |
69,115 | String () { return "ProjectDictionaryState{" + "projectDictionary=" + projectDictionary + '}'; } | toString |
69,116 | void (DictionaryStateListener listener) { myDictListenerEventDispatcher.addListener(listener); } | addProjectDictListener |
69,117 | void (ActionEvent e) { myDictionariesComboBox.setEnabled(myUseSingleDictionary.isSelected()); } | actionPerformed |
69,118 | JCheckBox (String path, boolean checked) { return new JCheckBox(FileUtil.toSystemDependentName(path), checked); } | createCheckBox |
69,119 | void () { super.apply(); final HashSet<String> runtimeDisabledDictionaries = new HashSet<>(); for (Pair<String, Boolean> pair : providedDictionaries) { if (pair.second) continue; if (runtimeDictionaries.contains(pair.first)) { runtimeDisabledDictionaries.add(pair.first); } } settings.setRuntimeDisabledDictionariesNames... | apply |
69,120 | void () { super.reset(); fillProvidedDictionaries(); } | reset |
69,121 | String () { final String supported = CustomDictionaryProvider.EP_NAME.getExtensionList().stream() .map(ext -> ext.getDictionaryType()) .collect(Collectors.joining(", ")); return supported.isEmpty() ? supported : ", " + supported; } | getSupportedDictionariesDescription |
69,122 | JComponent () { return root; } | getPane |
69,123 | boolean () { return wordsPanel.isModified() || myProvidedDictionariesChooserComponent.isModified() || myDictionariesPanel.isModified() || settings.isUseSingleDictionaryToSave() != myUseSingleDictionary.isSelected() || (settings.isUseSingleDictionaryToSave() && !StringUtil.equals(settings.getDictionaryToSave(), (String)... | isModified |
69,124 | void () { myUseSingleDictionary.setSelected(settings.isUseSingleDictionaryToSave()); myDictionariesComboBox.setSelectedItem(settings.getDictionaryToSave()); myDictionariesComboBox.setEnabled(myUseSingleDictionary.isSelected()); myDictionariesPanel.reset(); myProvidedDictionariesChooserComponent.reset(); } | reset |
69,125 | void () { providedDictionaries.clear(); for (String dictionary : SpellCheckerManager.getBundledDictionaries()) { providedDictionaries.add(Pair.create(dictionary, true)); } runtimeDictionaries.clear(); for (String dictionary : ContainerUtil.map(SpellCheckerManager.getRuntimeDictionaries(), (it) -> it.getName())) { runti... | fillProvidedDictionaries |
69,126 | void () { if (wordsPanel != null) { Disposer.dispose(wordsPanel); } } | dispose |
69,127 | void (ToolbarDecorator decorator) { decorator.setRemoveAction((button) -> { SpellcheckerActionStatistics.REMOVE_FROM_ACCEPTED_WORDS.log(manager.getProject()); ListUtil.removeSelectedItems(myList); }); } | customizeDecorator |
69,128 | String () { SpellcheckerActionStatistics.ADD_TO_ACCEPTED_WORDS.log(manager.getProject()); String word = Messages.showInputDialog(SpellCheckerBundle.message("enter.simple.word"), SpellCheckerBundle.message("add.new.word"), null); if (word == null) { return null; } else { word = word.trim(); } if (Strings.isMixedCase(wor... | findItemToAdd |
69,129 | void () { myListModel.removeAllElements(); } | dispose |
69,130 | List<String> () { Object[] pairs = getListItems(); if (pairs == null) { return new ArrayList<>(); } List<String> words = new ArrayList<>(); for (Object pair : pairs) { words.add(pair.toString()); } return words; } | getWords |
69,131 | boolean () { List<String> newWords = getWords(); Set<String> words = manager.getUserDictionaryWords(); if (newWords.size() != words.size()) { return true; } return !(words.containsAll(newWords) && newWords.containsAll(words)); } | isModified |
69,132 | String () { //This is NLS safe since dictionary names are NLS return myDictionaryToSave; } | getDictionaryToSave |
69,133 | void (String dictionaryToSave) { myDictionaryToSave = dictionaryToSave; } | setDictionaryToSave |
69,134 | boolean () { return myUseSingleDictionaryToSave; } | isUseSingleDictionaryToSave |
69,135 | void (boolean useSingleDictionaryToSave) { this.myUseSingleDictionaryToSave = useSingleDictionaryToSave; } | setUseSingleDictionaryToSave |
69,136 | boolean () { return mySettingsTransferred; } | isSettingsTransferred |
69,137 | void (boolean settingsTransferred) { mySettingsTransferred = settingsTransferred; } | setSettingsTransferred |
69,138 | SpellCheckerSettings (Project project) { return project.getService(SpellCheckerSettings.class); } | getInstance |
69,139 | List<String> () { return myCustomDictionariesPaths; } | getCustomDictionariesPaths |
69,140 | void (List<String> customDictionariesPaths) { myCustomDictionariesPaths = customDictionariesPaths; ApplicationManager.getApplication().getMessageBus() .syncPublisher(CustomDictionaryPathListener.Companion.getTOPIC()) .dictionariesChanged(customDictionariesPaths); } | setCustomDictionariesPaths |
69,141 | Set<String> () { return myRuntimeDisabledDictionariesNames; } | getRuntimeDisabledDictionariesNames |
69,142 | void (Set<String> runtimeDisabledDictionariesNames) { myRuntimeDisabledDictionariesNames = runtimeDisabledDictionariesNames; } | setRuntimeDisabledDictionariesNames |
69,143 | Element () { if (myRuntimeDisabledDictionariesNames.isEmpty() && myOldDictionaryFoldersPaths.isEmpty() && myCustomDictionariesPaths.isEmpty() && myUseSingleDictionaryToSave == DEFAULT_USE_SINGLE_DICT && myDictionaryToSave.equals(DEFAULT_DICTIONARY_TO_SAVE) && !mySettingsTransferred) { return null; } final Element eleme... | getState |
69,144 | void (@NotNull final Element element) { myRuntimeDisabledDictionariesNames.clear(); myCustomDictionariesPaths.clear(); myOldDictionaryFoldersPaths.clear(); try { // runtime final int runtimeDictionariesSize = StringUtil.parseInt(element.getAttributeValue(RUNTIME_DICTIONARIES_ATTR_NAME), 0); for (int i = 0; i < runtimeD... | loadState |
69,145 | String () { return SpellCheckerBundle.message("spelling"); } | getDisplayName |
69,146 | String () { return "reference.settings.ide.settings.spelling"; } | getHelpTopic |
69,147 | String () { return getHelpTopic(); } | getId |
69,148 | JComponent () { if (settingsPane == null) { settingsPane = new SpellCheckerSettingsPane(settings, project); } return settingsPane.getPane(); } | createComponent |
69,149 | boolean () { return settingsPane == null || settingsPane.isModified(); } | isModified |
69,150 | void () { if (settingsPane != null) { settingsPane.reset(); } } | reset |
69,151 | void () { settingsPane = null; } | disposeUIResources |
69,152 | void (AnActionButton button) { myCustomDictionariesTableView.stopEditing(); doChooseFiles(project, files -> files.stream() .map(VirtualFile::getPath) .map(PathUtil::toSystemDependentName) .filter(path -> !myCustomDictionariesTableView.getItems().contains(path)) .forEach(path -> myCustomDictionariesTableView.getListTabl... | run |
69,153 | void (AnActionButton anActionButton) { String selectedDictionary = myCustomDictionariesTableView.getSelectedObject(); if (selectedDictionary == null) return; if (defaultDictionaries.contains(selectedDictionary)) { selectedDictionary = selectedDictionary.equals(SpellCheckerBundle.message("app.dictionary")) ? myManager.g... | run |
69,154 | void (@NotNull Project project, @NotNull Consumer<? super List<VirtualFile>> consumer) { final FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, true) { @Override public boolean isFileSelectable(@Nullable VirtualFile file) { return file != null && extensionEquals(... | doChooseFiles |
69,155 | boolean (@Nullable VirtualFile file) { return file != null && extensionEquals(file.getPath(), "dic"); } | isFileSelectable |
69,156 | List<String> () { return removedDictionaries; } | getRemovedDictionaries |
69,157 | boolean () { List<String> oldPaths = mySettings.getCustomDictionariesPaths(); Collection<String> collection = myCustomDictionariesTableView.getItems(); if (collection.isEmpty()) { return !oldPaths.isEmpty(); } Set<String> newPaths = new HashSet<>(); for (String t : collection) { if (!defaultDictionaries.contains(t)) { ... | isModified |
69,158 | void () { myCustomDictionariesTableView.getListTableModel() .setItems(new ArrayList<>(ContainerUtil.concat(defaultDictionaries, mySettings.getCustomDictionariesPaths()))); removedDictionaries.clear(); } | reset |
69,159 | void () { List<String> oldPaths = mySettings.getCustomDictionariesPaths(); List<String> newPaths = new ArrayList<>(ContainerUtil.filter(myCustomDictionariesTableView.getItems(), dict -> { return !defaultDictionaries.contains(dict); })); mySettings.setCustomDictionariesPaths(newPaths); myManager.updateBundledDictionarie... | apply |
69,160 | List<String> () { return myCustomDictionariesTableView.getItems(); } | getValues |
69,161 | TableCellRenderer (List<String> defaultDictionaries) { return new TableCellRenderer() { final SimpleColoredComponent myLabel = new SimpleColoredComponent(); @Override public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, f... | createTypeRenderer |
69,162 | Component (final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { myLabel.clear(); myLabel.append((String)value, SimpleTextAttributes.REGULAR_ATTRIBUTES); String type; if (defaultDictionaries.contains(value)) { type = SpellCheckerBundle.message("buil... | getTableCellRendererComponent |
69,163 | ColumnInfo[] () { return new ColumnInfo[]{ new ColumnInfo<String, String>(SpellCheckerBundle.message("custom.dictionary.title")) { @Override public String valueOf(final String info) { return info; } @Nullable @Override public TableCellRenderer getRenderer(String s) { return myTypeRenderer; } } }; } | createDictionaryColumnInfos |
69,164 | String (final String info) { return info; } | valueOf |
69,165 | TableCellRenderer (String s) { return myTypeRenderer; } | getRenderer |
69,166 | EventLogGroup () { return GROUP; } | getGroup |
69,167 | Set<MetricEvent> (@NotNull Project project) { SpellCheckerSettings settings = SpellCheckerSettings.getInstance(project); Set<MetricEvent> result = ContainerUtil.newHashSet(ALL_BUNDLED_ENABLED.metric(true), MAX_SPELLCHECKER_SUGGESTIONS.metric(5), CUSTOM_DIC_COUNT.metric(settings.getCustomDictionariesPaths().size()), USE... | getMetrics |
69,168 | String () { return name; } | getName |
69,169 | Boolean (@NotNull String word) { boolean contains = words.contains(word); if (contains) return true; return null; } | contains |
69,170 | Set<String> () { return words; } | getWords |
69,171 | Set<String> () { return words; } | getEditableWords |
69,172 | void () { words.clear(); } | clear |
69,173 | void (String word) { if (word == null) { return; } words.add(word); } | addToDictionary |
69,174 | void (String word) { if (word == null) { return; } words.remove(word); } | removeFromDictionary |
69,175 | void (@Nullable Collection<String> words) { clear(); addToDictionary(words); } | replaceAll |
69,176 | void (@Nullable Collection<String> words) { if (words == null || words.isEmpty()) { return; } for (String word : words) { addToDictionary(word); } } | addToDictionary |
69,177 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserDictionary that = (UserDictionary)o; return name.equals(that.name); } | equals |
69,178 | int () { return name.hashCode(); } | hashCode |
69,179 | String () { return "UserDictionary{" + "name='" + name + '\'' + ", words.count=" + words.size() + '}'; } | toString |
69,180 | String () { return DEFAULT_PROJECT_DICTIONARY_NAME; } | getName |
69,181 | void (String name) { activeName = name; } | setActiveName |
69,182 | Boolean (@NotNull String word) { if (dictionaries == null) { return null; // still ("WORD_OF_ENTIRELY_UNKNOWN_LETTERS_FOR_ALL"); } int errors = 0; for (Dictionary dictionary : dictionaries) { Boolean contains = dictionary.contains(word); if (contains == null) { errors++; } else if (contains) { return true; } } if (erro... | contains |
69,183 | void (String word) { getActiveDictionary().addToDictionary(word); } | addToDictionary |
69,184 | void (String word) { getActiveDictionary().removeFromDictionary(word); } | removeFromDictionary |
69,185 | EditableDictionary () { return ensureCurrentUserDictionary(); } | getActiveDictionary |
69,186 | EditableDictionary () { if (activeName == null) { activeName = DEFAULT_CURRENT_USER_NAME; } EditableDictionary result = getDictionaryByName(activeName); if (result == null) { result = new UserDictionary(activeName); if (dictionaries == null) { dictionaries = CollectionFactory.createSmallMemoryFootprintSet(); } dictiona... | ensureCurrentUserDictionary |
69,187 | EditableDictionary (@NotNull String name) { if (dictionaries == null) { return null; } EditableDictionary result = null; for (EditableDictionary dictionary : dictionaries) { if (dictionary.getName().equals(name)) { result = dictionary; break; } } return result; } | getDictionaryByName |
69,188 | void (@Nullable Collection<String> words) { getActiveDictionary().replaceAll(words); } | replaceAll |
69,189 | void () { getActiveDictionary().clear(); } | clear |
69,190 | Set<String> () { if (dictionaries == null) { return Collections.emptySet(); } Set<String> words = CollectionFactory.createSmallMemoryFootprintSet(); for (Dictionary dictionary : dictionaries) { words.addAll(dictionary.getWords()); } return words; } | getWords |
69,191 | Set<String> () { return getActiveDictionary().getWords(); } | getEditableWords |
69,192 | void (@Nullable Collection<String> words) { getActiveDictionary().addToDictionary(words); } | addToDictionary |
69,193 | Set<EditableDictionary> () { return dictionaries; } | getDictionaries |
69,194 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ProjectDictionary that = (ProjectDictionary)o; if (!Objects.equals(activeName, that.activeName)) return false; if (!Objects.equals(dictionaries, that.dictionaries)) return false; return true; } | equals |
69,195 | int () { int result = activeName != null ? activeName.hashCode() : 0; result = 31 * result + (dictionaries != null ? dictionaries.hashCode() : 0); return result; } | hashCode |
69,196 | String () { return "ProjectDictionary{" + "activeName='" + activeName + '\'' + ", dictionaries=" + dictionaries + '}'; } | toString |
69,197 | void (String dictName, VirtualFile path) { myDict2FolderMap.putValue(dictName, path); } | addFolder |
69,198 | void (VirtualFile folder) { myExcludedFolders.add(folder); } | excludeFolder |
69,199 | void () { ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> { ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator(); progressIndicator.setIndeterminate(false); // let's do result a bit more predictable final List<String> dictionaries = new ArrayList<>(myDict2Fo... | generate |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.