Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
26,300
ActionGroup (@NotNull EditorMouseEvent event) { DefaultActionGroup group = new DefaultActionGroup(); group.add(CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_CUT_COPY_PASTE)); group.add(CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.ACTION_EDIT_SOURCE)); group.addSeparator(); group.add(new AnAction(ResourceBundleEditorBundle.messagePointer("action.PropagateValue.text")) { @Override public void actionPerformed(@NotNull AnActionEvent e) { final String valueToPropagate = editor.getDocument().getText(); final String currentSelectedProperty = getSelectedPropertyName(); if (currentSelectedProperty == null) { return; } ApplicationManager.getApplication().runWriteAction(() -> WriteCommandAction.runWriteCommandAction(myProject, ResourceBundleEditorBundle.message("action.PropagateValue.text"), null, () -> { try { final PropertiesFile[] propertiesFiles = myResourceBundle.getPropertiesFiles().stream().filter(f -> { final IProperty property = f.findPropertyByKey(currentSelectedProperty); return property == null || !valueToPropagate.equals(property.getValue()); }).toArray(PropertiesFile[]::new); final PsiFile[] filesToPrepare = Arrays.stream(propertiesFiles).map(PropertiesFile::getContainingFile).toArray(PsiFile[]::new); if (FileModificationService.getInstance().preparePsiElementsForWrite(filesToPrepare)) { for (PropertiesFile file : propertiesFiles) { myPropertiesInsertDeleteManager.insertOrUpdateTranslation(currentSelectedProperty, valueToPropagate, file); } recreateEditorsPanel(); } } catch (final IncorrectOperationException e1) { LOG.error(e1); } })); } }); return group; }
getActionGroup
26,301
void (@NotNull AnActionEvent e) { final String valueToPropagate = editor.getDocument().getText(); final String currentSelectedProperty = getSelectedPropertyName(); if (currentSelectedProperty == null) { return; } ApplicationManager.getApplication().runWriteAction(() -> WriteCommandAction.runWriteCommandAction(myProject, ResourceBundleEditorBundle.message("action.PropagateValue.text"), null, () -> { try { final PropertiesFile[] propertiesFiles = myResourceBundle.getPropertiesFiles().stream().filter(f -> { final IProperty property = f.findPropertyByKey(currentSelectedProperty); return property == null || !valueToPropagate.equals(property.getValue()); }).toArray(PropertiesFile[]::new); final PsiFile[] filesToPrepare = Arrays.stream(propertiesFiles).map(PropertiesFile::getContainingFile).toArray(PsiFile[]::new); if (FileModificationService.getInstance().preparePsiElementsForWrite(filesToPrepare)) { for (PropertiesFile file : propertiesFiles) { myPropertiesInsertDeleteManager.insertOrUpdateTranslation(currentSelectedProperty, valueToPropagate, file); } recreateEditorsPanel(); } } catch (final IncorrectOperationException e1) { LOG.error(e1); } })); }
actionPerformed
26,302
Object (@NotNull String dataId) { return ResourceBundleEditor.this.getData(dataId); }
getData
26,303
Dimension () { return getPreferredSize(); }
getPreferredScrollableViewportSize
26,304
int (Rectangle visibleRect, int orientation, int direction) { Editor editor = myEditors.values().iterator().next(); return editor.getLineHeight()*4; }
getScrollableUnitIncrement
26,305
int (Rectangle visibleRect, int orientation, int direction) { return visibleRect.height; }
getScrollableBlockIncrement
26,306
boolean () { return true; }
getScrollableTracksViewportWidth
26,307
boolean () { return false; }
getScrollableTracksViewportHeight
26,308
void (@NotNull AnActionEvent e) { final ResourceBundleEditor editor = getEditor(e); LOG.assertTrue(editor != null); final PropertyBundleEditorStructureViewElement element = (PropertyBundleEditorStructureViewElement)editor.getSelectedElementIfOnlyOne(); LOG.assertTrue(element != null); final PsiFile file = editor.getResourceBundle().getDefaultPropertiesFile().getContainingFile(); final ShowIntentionsPass.IntentionsInfo intentions = new ShowIntentionsPass.IntentionsInfo(); boolean isQuickFixListEmpty = true; Pair<ResourceBundleEditorProblemDescriptor, HighlightDisplayKey>[] descriptorsAndSources = element.getProblemDescriptors(); for (Pair<ResourceBundleEditorProblemDescriptor, HighlightDisplayKey> p : descriptorsAndSources) { final ResourceBundleEditorProblemDescriptor d = p.getFirst(); final HighlightDisplayKey sourceKey = p.getSecond(); QuickFix[] fixes = d.getFixes(); if (fixes != null) { for (int i = 0; i < fixes.length; i++) { intentions.inspectionFixesToShow.add(new HighlightInfo.IntentionActionDescriptor(new RBEQuickFixWrapper(d, i), null, null, AllIcons.Actions.IntentionBulb, sourceKey, null, null)); isQuickFixListEmpty = false; } } } if (isQuickFixListEmpty) { return; } final Project project = e.getProject(); LOG.assertTrue(project != null); JBPopupFactory .getInstance() .createListPopup(new IntentionListStep(null, null, file, project, CachedIntentions.create(project, file, null, intentions))) .showInBestPositionFor(e.getDataContext()); }
actionPerformed
26,309
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,310
void (@NotNull AnActionEvent e) { final ResourceBundleEditor editor = getEditor(e); e.getPresentation().setEnabledAndVisible(editor != null && editor.getSelectedElementIfOnlyOne() instanceof PropertyStructureViewElement); }
update
26,311
ResourceBundleEditor (@NotNull AnActionEvent e) { final FileEditor editor = e.getData(PlatformCoreDataKeys.FILE_EDITOR); return editor instanceof ResourceBundleEditor ? (ResourceBundleEditor)editor : null; }
getEditor
26,312
String () { return getFamilyName(); }
getText
26,313
String () { return getQuickFix().getFamilyName(); }
getFamilyName
26,314
boolean (@NotNull Project project, Editor editor, PsiFile file) { return true; }
isAvailable
26,315
boolean () { return false; }
startInWriteAction
26,316
QuickFix<ResourceBundleEditorProblemDescriptor> () { return myDescriptor.getFixes()[myIndex]; }
getQuickFix
26,317
TextAttributes (EditorColorsScheme colorsScheme) { if (myInspectedPropertyProblems != null) { return myInspectedPropertyProblems.getTextAttributes(colorsScheme); } return null; }
getErrorTextAttributes
26,318
void (InspectedPropertyProblems inspectedPropertyProblems) { myInspectedPropertyProblems = inspectedPropertyProblems; }
setInspectedPropertyProblems
26,319
void (String separator) { myByWordPrefixesGrouper.setSeparator(separator); PropertiesSeparatorManager.getInstance(myResourceBundle.getProject()).setSeparator(myResourceBundle, separator); }
setSeparator
26,320
void (boolean showOnlyIncomplete) { myRoot.setShowOnlyIncomplete(showOnlyIncomplete); }
setShowOnlyIncomplete
26,321
boolean () { return myRoot.isShowOnlyIncomplete(); }
isShowOnlyIncomplete
26,322
String () { return myByWordPrefixesGrouper.getSeparator(); }
getSeparator
26,323
void (boolean state) { myGrouped = state; }
setGroupingActive
26,324
StructureViewTreeElement () { return myRoot; }
getRoot
26,325
Object () { return null; }
getCurrentEditorElement
26,326
void (@NotNull FileEditorPositionListener listener) { }
addEditorPositionListener
26,327
void (@NotNull FileEditorPositionListener listener) { }
removeEditorPositionListener
26,328
void (@NotNull ModelListener modelListener) { }
addModelListener
26,329
void (@NotNull ModelListener modelListener) { }
removeModelListener
26,330
void () { }
dispose
26,331
boolean (final Object element) { return false; }
shouldEnterElement
26,332
boolean (final StructureViewTreeElement element) { return false; }
isAlwaysShowsPlus
26,333
boolean (final StructureViewTreeElement element) { return element instanceof PropertyStructureViewElement; }
isAlwaysLeaf
26,334
void () { throw new IllegalStateException(); }
run
26,335
void () { FileDocumentManager.getInstance().saveAllDocuments(); myEventsProcessor.flush(); }
flush
26,336
void (@NotNull VirtualFileEvent event) { myEventsProcessor.queue(event, EventType.FILE_CREATED); }
fileCreated
26,337
void (@NotNull VirtualFileEvent event) { myEventsProcessor.queue(event, EventType.FILE_DELETED); }
fileDeleted
26,338
void (@NotNull VirtualFilePropertyEvent event) { myEventsProcessor.queue(event, EventType.PROPERTY_CHANGED); }
propertyChanged
26,339
void (@NotNull VirtualFileEvent event) { myEventsProcessor.queue(event, EventType.CONTENT_CHANGED); }
contentsChanged
26,340
void (Update @NotNull [] updates) { final ReadTask task = new ReadTask() { final Set<EventWithType> myEvents = myEventQueue.getAndSet(ConcurrentCollectionFactory.createConcurrentSet()); @Nullable @Override public Continuation performInReadAction(@NotNull ProgressIndicator indicator) throws ProcessCanceledException { if (!myEditor.isValid()) return null; Runnable toDo = null; NotNullLazyValue<Set<VirtualFile>> resourceBundleAsSet = NotNullLazyValue.lazy(() -> { return myEditor.getResourceBundle().getPropertiesFiles().stream().map(PropertiesFile::getVirtualFile) .collect(Collectors.toSet()); }); for (EventWithType e : myEvents) { if (e.getType() == EventType.FILE_DELETED || (e.getType() == EventType.PROPERTY_CHANGED && e.getPropertyName().equals(VirtualFile.PROP_NAME))) { if (myEditor.getTranslationEditors().containsKey(e.getFile())) { int validFilesCount = 0; ResourceBundle bundle = myEditor.getResourceBundle(); if (bundle.isValid()) { for (PropertiesFile file : bundle.getPropertiesFiles()) { if (file.getContainingFile().isValid()) { validFilesCount ++; } if (validFilesCount == 2) { break; } } } if (validFilesCount > 1) { toDo = myEditor::recreateEditorsPanel; } else { toDo = () -> { FileEditorManager.getInstance(myProject).closeFile(myEditor.getFile()); }; } break; } else if (resourceBundleAsSet.getValue().contains(e.getFile())) { //new file in bundle toDo = myEditor::recreateEditorsPanel; break; } } else if (e.getType() == EventType.FILE_CREATED) { if (resourceBundleAsSet.getValue().contains(e.getFile())) { toDo = myEditor::recreateEditorsPanel; break; } } else if (e.getType() == EventType.PROPERTY_CHANGED && e.getPropertyName().equals(VirtualFile.PROP_WRITABLE)) { if (myEditor.getTranslationEditors().containsKey(e.getFile())) { if (toDo == null) { toDo = new SetViewerPropertyRunnable(); } if (toDo instanceof SetViewerPropertyRunnable) { ((SetViewerPropertyRunnable)toDo).addFile(e.getFile(), !(boolean)e.getPropertyNewValue()); } else { toDo = myEditor::recreateEditorsPanel; break; } } } else { if (myEditor.getTranslationEditors().containsKey(e.getFile())) { if ((toDo instanceof SetViewerPropertyRunnable)) { toDo = myEditor::recreateEditorsPanel; break; } else if (toDo == null) { toDo = () -> myEditor.updateEditorsFromProperties(true); } } } } if (toDo == null) { return null; } else { Runnable toDoCopy = toDo; return new Continuation(() -> { if (myEditor.isValid()) { toDoCopy.run(); } }, ModalityState.nonModal()); } } @Override public void onCanceled(@NotNull ProgressIndicator indicator) { myEventQueue.updateAndGet(s -> { s.addAll(myEvents); return s; }); myUpdateQueue.queue(FORCE_UPDATE); } }; ProgressIndicatorUtils.scheduleWithWriteActionPriority(task); }
execute
26,341
void (@NotNull ProgressIndicator indicator) { myEventQueue.updateAndGet(s -> { s.addAll(myEvents); return s; }); myUpdateQueue.queue(FORCE_UPDATE); }
onCanceled
26,342
void (VirtualFileEvent event, EventType type) { myEventQueue.updateAndGet(s -> { s.add(new EventWithType(type, event)); return s; }); myUpdateQueue.queue(FORCE_UPDATE); }
queue
26,343
void () { myUpdateQueue.flush(); }
flush
26,344
void (VirtualFile virtualFile, boolean isViewer) { myFiles.add(virtualFile); myIsViewer.add(isViewer); }
addFile
26,345
void () { for (int i = 0; i < myFiles.size(); i++) { VirtualFile file = myFiles.get(i); final Boolean viewer = myIsViewer.get(i); final EditorEx editor = myEditor.getTranslationEditors().get(file); if (editor != null) { editor.setViewer(viewer); } } }
run
26,346
EventType () { return myType; }
getType
26,347
VirtualFile () { return myFile; }
getFile
26,348
String () { LOG.assertTrue(myType == EventType.PROPERTY_CHANGED, "Unexpected event type: " + myType); return Objects.requireNonNull(myPropertyName); }
getPropertyName
26,349
Object () { LOG.assertTrue(myType == EventType.PROPERTY_CHANGED, "Unexpected event type: " + myType); return Objects.requireNonNull(myPropertyNewValue); }
getPropertyNewValue
26,350
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EventWithType type = (EventWithType)o; if (myType != type.myType) return false; if (!myFile.equals(type.myFile)) return false; if (!Objects.equals(myPropertyName, type.myPropertyName)) return false; if (!Objects.equals(myPropertyNewValue, type.myPropertyNewValue)) return false; return true; }
equals
26,351
int () { int result = myType.hashCode(); result = 31 * result + myFile.hashCode(); result = 31 * result + (myPropertyName != null ? myPropertyName.hashCode() : 0); result = 31 * result + (myPropertyNewValue != null ? myPropertyNewValue.hashCode() : 0); return result; }
hashCode
26,352
boolean (final @NotNull Project project, final @NotNull VirtualFile file) { if (file instanceof ResourceBundleAsVirtualFile) { return true; } if (!file.isValid()) { return false; } FileType type = file.getFileType(); if (type != PropertiesFileType.INSTANCE && type != StdFileTypes.XML) { return false; } return ReadAction.compute(() -> { if (project.isDisposed()) return Boolean.FALSE; final PsiFile psiFile = PsiManager.getInstance(project).findFile(file); PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(psiFile); return propertiesFile != null && propertiesFile.getResourceBundle().getPropertiesFiles().size() > 1; }); }
accept
26,353
boolean () { return false; }
acceptRequiresReadAction
26,354
FileEditor (@NotNull Project project, @NotNull VirtualFile file) { ResourceBundle resourceBundle; if (file instanceof ResourceBundleAsVirtualFile) { resourceBundle = ((ResourceBundleAsVirtualFile)file).getResourceBundle(); } else { PsiFile psiFile = PsiManager.getInstance(project).findFile(file); if (psiFile == null) { throw new IllegalArgumentException("psifile cannot be null"); } resourceBundle = PropertiesImplUtil.getPropertiesFile(psiFile).getResourceBundle(); } return new ResourceBundleEditor(project, file, resourceBundle); }
createEditor
26,355
FileEditorState (@NotNull Element element, @NotNull Project project, @NotNull VirtualFile file) { return new ResourceBundleEditor.ResourceBundleEditorState(null); }
readState
26,356
FileEditorPolicy () { return FileEditorPolicy.PLACE_AFTER_DEFAULT_EDITOR; }
getPolicy
26,357
String () { return "ResourceBundle"; }
getEditorTypeId
26,358
void (@NotNull final AnActionEvent e) { IdeFocusManager.getGlobalInstance() .doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(getNext(e).getContentComponent(), true)); }
actionPerformed
26,359
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,360
void (@NotNull AnActionEvent e) { boolean enabled = getNext(e) != null; e.getPresentation().setEnabled(enabled); }
update
26,361
Editor (@NotNull AnActionEvent e) { final Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor == null) { return null; } return editor.getUserData(myNext ? NEXT_EDITOR_KEY : PREV_EDITOR_KEY); }
getNext
26,362
ProblemHighlightType () { return myHighlightType; }
getHighlightType
26,363
String () { return myDescriptionTemplate; }
getDescriptionTemplate
26,364
TextAttributes (EditorColorsScheme scheme) { TextAttributes mixedAttributes = null; for (HighlightInfoType type : myHighlightTypes) { final TextAttributes current = scheme.getAttributes(type.getAttributesKey()); if (mixedAttributes == null) { mixedAttributes = current; } else { mixedAttributes = TextAttributes.merge(mixedAttributes, current); } } return mixedAttributes; }
getTextAttributes
26,365
void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (customize(value)) { return; } super.customizeCellRenderer(tree, value, selected, expanded, leaf, row, hasFocus); }
customizeCellRenderer
26,366
boolean (Object value) { final Object userObject = ((DefaultMutableTreeNode)value).getUserObject(); if (!(userObject instanceof TreeElementWrapper)) { return false; } final TreeElement treeElement = ((TreeElementWrapper)userObject).getValue(); if (treeElement == null) { return false; } final ItemPresentation presentation = treeElement.getPresentation(); if (presentation instanceof TextAttributesPresentation textAttributesPresentation) { final String text = textAttributesPresentation.getPresentableText(); if (text != null) { SimpleTextAttributes attr = SimpleTextAttributes.fromTextAttributes( textAttributesPresentation.getTextAttributes( EditorColorsManager.getInstance().getSchemeForCurrentUITheme())); append(text, new SimpleTextAttributes(attr.getBgColor(), attr.getFgColor(), attr.getWaveColor(), attr.getStyle() | SimpleTextAttributes.STYLE_OPAQUE)); return true; } } return false; }
customize
26,367
IncompletePropertyInspection (PsiElement element) { final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(element.getProject()); InspectionProfile inspectionProfile = profileManager.getCurrentProfile(); return (IncompletePropertyInspection) inspectionProfile.getUnwrappedTool(TOOL_KEY, element); }
getInstance
26,368
String () { return ResourceBundleEditorBundle.message("incomplete.property.quick.fix.name"); }
getFamilyName
26,369
boolean () { return false; }
startInWriteAction
26,370
void (@NotNull Project project, @NotNull ResourceBundleEditorProblemDescriptor descriptor) { final PsiElement element = myElementPointer.getElement(); if (element == null) { return; } final IProperty property = PropertiesImplUtil.getProperty(element); if (property == null) { return; } final IncompletePropertyInspection inspection = getInstance(element); final List<PropertiesFile> allFilesWithoutTranslation = inspection.getPropertiesFilesWithoutTranslation(myResourceBundle, property.getKey()); if (allFilesWithoutTranslation.isEmpty()) { return; } final TreeSet<String> suffixesToIgnore = new TreeSet<>(ContainerUtil.map(allFilesWithoutTranslation, PropertiesUtil::getSuffix)); if (new IncompletePropertyInspectionOptionsPanel(suffixesToIgnore).showDialogAndGet(project)) { InspectionProfileModifiableModelKt.modifyAndCommitProjectProfile(project, it -> ((IncompletePropertyInspection)it.getInspectionTool(TOOL_KEY, element).getTool()).addSuffixes(suffixesToIgnore)); } }
applyFix
26,371
boolean (final String key, final ResourceBundle resourceBundle) { return isPropertyComplete(resourceBundle.getPropertiesFiles().stream().map(f -> f.findPropertyByKey(key)).filter(Objects::nonNull).toArray(IProperty[]::new), resourceBundle); }
isPropertyComplete
26,372
boolean (final IProperty[] properties, final ResourceBundle resourceBundle) { final Set<PropertiesFile> existed = ContainerUtil.map2Set(properties, IProperty::getPropertiesFile); for (PropertiesFile file : resourceBundle.getPropertiesFiles()) { if (!existed.contains(file) && !getIgnoredSuffixes().contains(PropertiesUtil.getSuffix(file))) { return false; } } return true; }
isPropertyComplete
26,373
Set<String> () { return mySuffixes; }
getIgnoredSuffixes
26,374
List<PropertiesFile> (final ResourceBundle resourceBundle, final String key) { return ContainerUtil.filter(resourceBundle.getPropertiesFiles(), propertiesFile -> propertiesFile.findPropertyByKey(key) == null && !getIgnoredSuffixes().contains(PropertiesUtil.getSuffix(propertiesFile))); }
getPropertiesFilesWithoutTranslation
26,375
void (Collection<String> suffixes) { mySuffixes.addAll(suffixes); }
addSuffixes
26,376
JPanel () { JPanel panel = ToolbarDecorator .createDecorator(myList) .disableUpDownActions() .setAddAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { final String result = Messages.showInputDialog(CommonDataKeys.PROJECT.getData(button.getDataContext()), ResourceBundleEditorBundle.message("incomplete.property.add.ignored.suffixes.dialog.message"), ResourceBundleEditorBundle.message("incomplete.property.add.ignored.suffixes.dialog.title"), null); if (result != null) { mySuffixes.addAll(StringUtil.split(result, ",")); changed(); } } }).setRemoveAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { for (String s : myList.getSelectedValuesList()) { mySuffixes.remove(s); } changed(); } }) .setToolbarPosition(ActionToolbarPosition.RIGHT) .createPanel(); myList.setCellRenderer(new ColoredListCellRenderer<>() { @Override protected void customizeCellRenderer(@NotNull JList list, @NlsSafe String suffix, int index, boolean selected, boolean hasFocus) { append(suffix); final Locale locale = PropertiesUtil.getLocale("_" + suffix + ".properties"); if (locale != PropertiesUtil.DEFAULT_LOCALE) { if (PropertiesUtil.hasDefaultLanguage(locale)) { append(" "); append(PropertiesUtil.getPresentableLocale(locale), SimpleTextAttributes.GRAY_ATTRIBUTES); } } else { append(ResourceBundleEditorBundle.message("incomplete.property.inspection.default.locale.presentation")); } } }); return UI.PanelFactory .panel(panel) .withLabel(ResourceBundleEditorBundle.message("incomplete.property.inspection.ignored.suffixes.label")) .moveLabelOnTop() .resizeY(true) .createPanel(); }
buildPanel
26,377
void (AnActionButton button) { final String result = Messages.showInputDialog(CommonDataKeys.PROJECT.getData(button.getDataContext()), ResourceBundleEditorBundle.message("incomplete.property.add.ignored.suffixes.dialog.message"), ResourceBundleEditorBundle.message("incomplete.property.add.ignored.suffixes.dialog.title"), null); if (result != null) { mySuffixes.addAll(StringUtil.split(result, ",")); changed(); } }
run
26,378
void (AnActionButton button) { for (String s : myList.getSelectedValuesList()) { mySuffixes.remove(s); } changed(); }
run
26,379
void (@NotNull JList list, @NlsSafe String suffix, int index, boolean selected, boolean hasFocus) { append(suffix); final Locale locale = PropertiesUtil.getLocale("_" + suffix + ".properties"); if (locale != PropertiesUtil.DEFAULT_LOCALE) { if (PropertiesUtil.hasDefaultLanguage(locale)) { append(" "); append(PropertiesUtil.getPresentableLocale(locale), SimpleTextAttributes.GRAY_ATTRIBUTES); } } else { append(ResourceBundleEditorBundle.message("incomplete.property.inspection.default.locale.presentation")); } }
customizeCellRenderer
26,380
boolean (Project project) { return new DialogWrapper(project) { { init(); setTitle(ResourceBundleEditorBundle.message("incomplete.property.locales.to.ignore.dialog.title")); } @Override protected JComponent createCenterPanel() { return buildPanel(); } }.showAndGet(); }
showDialogAndGet
26,381
JComponent () { return buildPanel(); }
createCenterPanel
26,382
void () { ((MyListModel)myList.getModel()).modified(); }
changed
26,383
int () { return mySuffixes.size(); }
getSize
26,384
String (int index) { return ArrayUtilRt.toStringArray(mySuffixes)[index]; }
getElementAt
26,385
void () { fireContentsChanged(this, -1, -1); }
modified
26,386
String () { return PropertiesBundle.message("remove.property.intention.text"); }
getFamilyName
26,387
boolean () { return false; }
startInWriteAction
26,388
void (@NotNull Project project, @NotNull ResourceBundleEditorProblemDescriptor descriptor) { final Property element = myRepresentativePointer.getElement(); if (element == null) return; final String key = element.getKey(); if (key == null) return; final PropertiesFile file = PropertiesImplUtil.getPropertiesFile(myRepresentativePointer.getContainingFile()); LOG.assertTrue(file != null); List<PropertiesFile> propertiesFiles = file.getResourceBundle().getPropertiesFiles(); if (!FileModificationService.getInstance() .preparePsiElementsForWrite(ContainerUtil.map(propertiesFiles, p -> p.getContainingFile()))) { return; } WriteAction.run(() -> propertiesFiles .stream() .flatMap(f -> f.findPropertiesByKey(key).stream()) .filter(Objects::nonNull) .map(IProperty::getPsiElement) .forEach(e -> e.delete()) ); }
applyFix
26,389
Set<String> () { return myDissociatedFiles; }
getDissociatedFiles
26,390
List<CustomResourceBundleState> () { return myCustomResourceBundles; }
getCustomResourceBundles
26,391
boolean () { return myCustomResourceBundles.isEmpty() && myDissociatedFiles.isEmpty(); }
isEmpty
26,392
ResourceBundleManagerState () { final ResourceBundleManagerState newState = new ResourceBundleManagerState(); final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); for (final String dissociatedFileUrl : myDissociatedFiles) { if (virtualFileManager.findFileByUrl(dissociatedFileUrl) != null) { newState.myDissociatedFiles.add(dissociatedFileUrl); } } for (CustomResourceBundleState customResourceBundle : myCustomResourceBundles) { final CustomResourceBundleState updatedCustomResourceBundle = customResourceBundle.removeNonExistentFiles(virtualFileManager); if (updatedCustomResourceBundle != null) { newState.myCustomResourceBundles.add(updatedCustomResourceBundle); } } return newState; }
removeNonExistentFiles
26,393
LocalQuickFix (PsiElement element, String key, List<PropertiesFile> files) { return QuickFixes.EMPTY_ACTION; }
createCreatePropertyFix
26,394
IntentionAction (@NotNull Property property) { return QuickFixes.EMPTY_ACTION; }
createRemovePropertyFix
26,395
LocalQuickFix (@NotNull Property property) { return QuickFixes.EMPTY_ACTION; }
createRemovePropertyLocalFix
26,396
PropertiesFile (@NotNull String bundleName, @NotNull Module searchFromModule, @Nullable Locale locale) { PropertiesReferenceManager manager = PropertiesReferenceManager.getInstance(searchFromModule.getProject()); return manager.findPropertiesFile(searchFromModule, bundleName, locale); }
getPropertiesFile
26,397
ResourceBundleWithCachedFiles (@NotNull final PropertiesFile representative) { return ReadAction.compute(() -> { final PsiFile containingFile = representative.getContainingFile(); if (!containingFile.isValid()) { return ResourceBundleWithCachedFiles.EMPTY; } final ResourceBundleManager manager = ResourceBundleManager.getInstance(representative.getProject()); final CustomResourceBundle customResourceBundle = manager.getCustomResourceBundle(representative); if (customResourceBundle != null) { return new ResourceBundleWithCachedFiles(customResourceBundle, customResourceBundle.getPropertiesFiles()); } final VirtualFile virtualFile = representative.getVirtualFile(); if (virtualFile == null) { return ResourceBundleWithCachedFiles.EMPTY; } if (manager.isDefaultDissociated(virtualFile)) { return new ResourceBundleWithCachedFiles(new ResourceBundleImpl(representative), Collections.singletonList(representative)); } final String baseName = manager.getBaseName(containingFile); final String extension = containingFile.getVirtualFile().getExtension(); final PsiDirectory directory = containingFile.getContainingDirectory(); if (directory == null) return ResourceBundleWithCachedFiles.EMPTY; final ResourceBundleWithCachedFiles bundle = getResourceBundle(baseName, extension, directory); return bundle == null ? new ResourceBundleWithCachedFiles(new ResourceBundleImpl(representative), Collections.singletonList(representative)) : bundle; }); }
getResourceBundleWithCachedFiles
26,398
List<PropertiesFile> (@NotNull PropertiesFile representative) { return getResourceBundleWithCachedFiles(representative).getFiles(); }
getResourceBundleFiles
26,399
ResourceBundle (@NotNull PropertiesFile representative) { return getResourceBundleWithCachedFiles(representative).getBundle(); }
getResourceBundle