Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
26,200
List<PsiElement> (final PropertiesPrefixGroup propertiesPrefixGroup) { return ContainerUtil.mapNotNull(propertiesPrefixGroup.getChildren(), treeElement -> { if (treeElement instanceof PropertyStructureViewElement) { return ((PropertyStructureViewElement)treeElement).getPsiElement(); } return null; }); }
getPsiElementsFromGroup
26,201
void (boolean showOnlyIncomplete) { myShowOnlyIncomplete = showOnlyIncomplete; }
setShowOnlyIncomplete
26,202
boolean () { return myShowOnlyIncomplete; }
isShowOnlyIncomplete
26,203
ResourceBundle () { return myResourceBundle.isValid() ? myResourceBundle : null; }
getValue
26,204
ItemPresentation () { return new ItemPresentation() { @Override public String getPresentableText() { return myResourceBundle.isValid() ? myResourceBundle.getBaseName() : null; } @Override public Icon getIcon(boolean open) { return AllIcons.FileTypes.Properties; } }; }
getPresentation
26,205
String () { return myResourceBundle.isValid() ? myResourceBundle.getBaseName() : null; }
getPresentableText
26,206
Icon (boolean open) { return AllIcons.FileTypes.Properties; }
getIcon
26,207
void (@NotNull final AnActionEvent e) { final Project project = getEventProject(e); if (project == null) { return; } ResourceBundleEditor resourceBundleEditor; final DataContext context = e.getDataContext(); FileEditor fileEditor = PlatformCoreDataKeys.FILE_EDITOR.getData(context); if (fileEditor instanceof ResourceBun...
actionPerformed
26,208
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,209
void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { e.getPresentation().setEnabledAndVisible(false); return; } if (!myEnabledForce) { final FileEditor editor = e.getData(PlatformCoreDataKeys.FILE_EDITOR); e.getPresentation().setEnabledAndVisible(editor instanceof ResourceBundleEdi...
update
26,210
String (@NotNull ResourceBundleEditor resourceBundleEditor) { Object item = resourceBundleEditor.getSelectedElementIfOnlyOne(); if (item instanceof PropertiesPrefixGroup prefixGroup) { return prefixGroup.getPrefix() + prefixGroup.getSeparator(); } return null; }
getSelectedPrefixText
26,211
boolean (final String inputString) { return !inputString.isEmpty(); }
checkInput
26,212
boolean (final String inputString) { final String newPropertyName = myPrefix == null ? inputString : (myPrefix + mySeparator + inputString); final ResourceBundle resourceBundle = myResourceBundleEditor.getResourceBundle(); for (final PropertiesFile propertiesFile : resourceBundle.getPropertiesFiles()) { IProperty key =...
canClose
26,213
ActionGroup () { final DefaultActionGroup result = (DefaultActionGroup) super.createActionGroup(); result.add(new ContextHelpAction(getHelpID()), Constraints.LAST); return result; }
createActionGroup
26,214
void (@NotNull final DefaultActionGroup result) { super.addGroupByActions(result); result.add(createSettingsActionGroup()); result.add(new NewPropertyAction(true), Constraints.FIRST); }
addGroupByActions
26,215
ActionGroup () { DefaultActionGroup actionGroup = DefaultActionGroup.createPopupGroup(ResourceBundleEditorBundle.messagePointer("resource.bundle.editor.settings.action.title")); final Presentation presentation = actionGroup.getTemplatePresentation(); presentation.setIcon(AllIcons.General.GearPlain); actionGroup.add(new...
createSettingsActionGroup
26,216
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
26,217
boolean (@NotNull AnActionEvent e) { return ((ResourceBundleStructureViewModel)getTreeModel()).isShowOnlyIncomplete(); }
isSelected
26,218
void (@NotNull AnActionEvent e, boolean state) { ((ResourceBundleStructureViewModel)getTreeModel()).setShowOnlyIncomplete(state); rebuild(); }
setSelected
26,219
void () { final DefaultActionGroup propertiesPopupGroup = new DefaultActionGroup(); propertiesPopupGroup.copyFromGroup((DefaultActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_STRUCTURE_VIEW_POPUP)); propertiesPopupGroup.add(Separator.getInstance(), Constraints.FIRST); propertiesPopupGroup.add(new New...
tunePopupActionGroup
26,220
Object (@NotNull String dataId) { if (ResourceBundle.ARRAY_DATA_KEY.is(dataId)) { return new ResourceBundle[]{myResourceBundle}; } else if (PlatformCoreDataKeys.BGT_DATA_PROVIDER.is(dataId)) { DataProvider superProvider = (DataProvider)super.getData(dataId); JBIterable<Object> selection = JBIterable.of(getTree().getSel...
getData
26,221
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,222
void (@NotNull DataContext dataContext) { PsiElement[] selectedPsiElements = PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext); if (selectedPsiElements == null) return; List<PsiFile> psiFiles = ContainerUtil.findAll(selectedPsiElements, PsiFile.class); DeleteProvider delegate; if (!psiFiles.isEmpty()) { deleg...
deleteElement
26,223
boolean (@NotNull DataContext dataContext) { return CommonDataKeys.PROJECT.getData(dataContext) != null; }
canDeleteElement
26,224
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,225
void (@NotNull DataContext dataContext) { PsiElement[] selectedPsiElements = PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext); if (selectedPsiElements != null) { List<String> names = new ArrayList<>(selectedPsiElements.length); for (PsiElement element : selectedPsiElements) { if (element instanceof PsiNamedE...
performCopy
26,226
boolean (@NotNull DataContext dataContext) { return true; }
isCopyEnabled
26,227
boolean (@NotNull DataContext dataContext) { return true; }
isCopyVisible
26,228
boolean () { return false; }
showScrollToFromSourceActions
26,229
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,230
void (@NotNull final DataContext dataContext) { final List<PropertiesFile> bundlePropertiesFiles = myResourceBundle.getPropertiesFiles(); final List<PsiElement> toDelete = new ArrayList<>(); for (IProperty property : myProperties) { final String key = property.getKey(); if (key == null) { LOG.error("key must be not nul...
deleteElement
26,231
boolean (@NotNull final DataContext dataContext) { return true; }
canDeleteElement
26,232
String () { return "editing.propertyFile.bundleEditor"; }
getHelpID
26,233
void (@NotNull AnActionEvent e) { final ResourceBundleEditor editor = (ResourceBundleEditor)e.getData(PlatformCoreDataKeys.FILE_EDITOR); LOG.assertTrue(editor != null); editor.selectNextIncompleteProperty(); }
actionPerformed
26,234
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,235
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(e.getData(PlatformCoreDataKeys.FILE_EDITOR) instanceof ResourceBundleEditor); }
update
26,236
void (@NotNull String newName, @NotNull ResourceBundle targetResourceBundle, @NotNull ResourceBundle sourceResourceBundle, @NotNull Project project) { if (sourceResourceBundle.equals(targetResourceBundle)) { DataManager.getInstance() .getDataContextFromFocusAsync() .onSuccess(context -> { final FileEditor fileEditor = ...
updateBundleEditors
26,237
void (@NotNull ProgressIndicator progress) { InspectionProfile profileToUse = InspectionProfileManager.getInstance().getCurrentProfile(); ResourceBundle rb = myEditor.getResourceBundle(); if (!rb.isValid()) return; final PsiFile containingFile = rb.getDefaultPropertiesFile().getContainingFile(); List<InspectionVisitorW...
collectInformation
26,238
void () { myEditor.getStructureViewComponent().repaint(); }
applyInformationToEditor
26,239
HighlightSeverity () { return mySeverity; }
getSeverity
26,240
HighlightDisplayKey () { return myKey; }
getKey
26,241
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
26,242
boolean (@NotNull AnActionEvent e) { return keepEmptyProperties(); }
isSelected
26,243
void (@NotNull AnActionEvent e, boolean state) { PropertiesComponent.getInstance().setValue(SELECTION_KEY, state, true); }
setSelected
26,244
boolean () { return PropertiesComponent.getInstance().getBoolean(SELECTION_KEY, true); }
keepEmptyProperties
26,245
JPanel () { return myPanel; }
getComponent
26,246
void (TreeSelectionEvent e) { // filter out temp unselect/select events if (getSelectedElementIfOnlyOne() instanceof ResourceBundleFileStructureViewElement) { ((CardLayout)myValuesPanel.getLayout()).show(myValuesPanel, NO_PROPERTY_SELECTED); writePreviouslySelectedPropertyValue(e); selectedPropertiesFile = null; select...
valueChanged
26,247
void (TreeSelectionEvent e) { if (selectedProperty != null && e.getOldLeadSelectionPath() != null) { for (Map.Entry<VirtualFile, EditorEx> entry : myEditors.entrySet()) { if (entry.getValue() == mySelectedEditor) { writeEditorPropertyValue(selectedProperty.getName(), mySelectedEditor, entry.getKey()); break; } } } }
writePreviouslySelectedPropertyValue
26,248
boolean (@Nullable IProperty oldSelected, @Nullable IProperty newSelected) { if (oldSelected == newSelected) { return true; } if (oldSelected == null || newSelected == null) { return false; } final PsiElement oldPsiElement = oldSelected.getPsiElement(); if (!oldPsiElement.isValid()) { return false; } return oldPsiEleme...
arePropertiesEquivalent
26,249
void (@NotNull FileEditorManagerEvent event) { onSelectionChanged(event); }
selectionChanged
26,250
VirtualFile () { return myFile; }
getFile
26,251
ResourceBundle () { return myResourceBundle; }
getResourceBundle
26,252
void () { myStructureViewComponent.rebuild(); }
updateTreeRoot
26,253
ResourceBundlePropertiesUpdateManager () { return myPropertiesInsertDeleteManager; }
getPropertiesInsertDeleteManager
26,254
void (@NotNull FileEditorManagerEvent event) { if (!myResourceBundle.isValid()) return; // Ignore events which don't target current editor. FileEditor oldEditor = event.getOldEditor(); FileEditor newEditor = event.getNewEditor(); if (oldEditor != this && newEditor != this) { return; } // We want to sync selected proper...
onSelectionChanged
26,255
void (@NotNull Editor propertiesFileEditor) { int line = propertiesFileEditor.getCaretModel().getLogicalPosition().line; Document document = propertiesFileEditor.getDocument(); if (line >= document.getLineCount()) { return; } final String propertyName = getPropertyName(document, line); if (propertyName == null) { retur...
setStructureViewSelectionFromPropertiesFile
26,256
void (@NotNull final String propertyName) { if (myStructureViewComponent.isDisposed()) { return; } JTree tree = myStructureViewComponent.getTree(); Object root = tree.getModel().getRoot(); if (isLoadingChildrenFor(root)) { boolean isEditorVisible = false; for (FileEditor editor : FileEditorManager.getInstance(myProject...
setStructureViewSelection
26,257
void () { myVfsListener.flush(); }
flush
26,258
boolean (Object nodeObject) { if (!(nodeObject instanceof DefaultMutableTreeNode node)) return false; int loadingNodes = 0; for (int i = 0; i < Math.min(node.getChildCount(), 2); i++) { TreeNode child = node.getChildAt(i); if (child instanceof LoadingNode) { loadingNodes++; } } return loadingNodes > 0 && loadingNodes =...
isLoadingChildrenFor
26,259
String (@NotNull Document document, int line) { int startOffset = document.getLineStartOffset(line); int endOffset = StringUtil.indexOf(document.getCharsSequence(), '=', startOffset, document.getLineEndOffset(line)); if (endOffset <= startOffset) { return null; } String propertyName = document.getCharsSequence().subSeq...
getPropertyName
26,260
void (@NotNull Editor propertiesFileEditor) { String selectedPropertyName = getSelectedPropertyName(); if (selectedPropertyName == null) { return; } Document document = propertiesFileEditor.getDocument(); for (int i = 0; i < document.getLineCount(); i++) { String propertyName = getPropertyName(document, i); if (selecte...
setPropertiesFileSelectionFromStructureView
26,261
void (final @Nullable String propertyName, final @NotNull Editor editor, final @NotNull VirtualFile file) { final String currentValue = editor.getDocument().getText(); final String currentSelectedProperty = propertyName == null ? getSelectedPropertyName() : propertyName; if (currentSelectedProperty == null) { return; }...
writeEditorPropertyValue
26,262
void () { super.updateUI(); getViewport().setBackground(UIUtil.getPanelBackground()); }
updateUI
26,263
void (KeyEvent e) { if (editor.isViewer()) { editor.setViewer(ReadonlyStatusHandler.getInstance(myProject) .ensureFilesWritable(Collections.singletonList(propertiesFile.getVirtualFile())).hasReadonlyFiles()); } }
keyTyped
26,264
void (@NotNull final Editor editor) { mySelectedEditor = editor; }
focusGained
26,265
void (@NotNull final Editor editor) { if (!editor.isViewer() && propertiesFile.getContainingFile().isValid()) { writeEditorPropertyValue(null, editor, propertiesFile.getVirtualFile()); myVfsListener.flush(); } }
focusLost
26,266
Dimension () { Insets insets = getBorder().getBorderInsets(this); return new Dimension(100,editor.getLineHeight()*4+ insets.top + insets.bottom); }
getPreferredSize
26,267
String (@Nullable final IProperty property) { if (property == null) { return ""; } else { String rawValue = property.getValue(); return rawValue == null ? "" : PropertiesResourceBundleUtil.fromPropertyValueToValueEditor(rawValue); } }
getPropertyEditorValue
26,268
ResourceBundleEditorFileListener () { final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); ResourceBundleEditorFileListener myVfsListener = new ResourceBundleEditorFileListener(this); virtualFileManager.addVirtualFileListener(myVfsListener, this); PsiTreeChangeAdapter psiTreeChangeAdapter = n...
installPropertiesChangeListeners
26,269
void (@NotNull PsiTreeChangeEvent event) { final PsiFile file = event.getFile(); if (file instanceof XmlFile) { final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(file); if (propertiesFile != null) { final ResourceBundle bundle = propertiesFile.getResourceBundle(); if (bundle.equals(myResourceBu...
childAdded
26,270
void (@NotNull PsiTreeChangeEvent event) { final PsiFile file = event.getFile(); final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(file); if (propertiesFile != null) { final ResourceBundle bundle = propertiesFile.getResourceBundle(); if (bundle.equals(myResourceBundle) && myEditors.containsKey(...
childRemoved
26,271
void () { myBackSlashPressed.clear(); UIUtil.invokeLaterIfNeeded(() -> { updateEditorsFromProperties(true); final StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject); if (statusBar != null) { statusBar.setInfo(ResourceBundleEditorBundle.message("status.bar.selection.changed.message", getSelectedPr...
selectionChanged
26,272
void (final String value, final Document document, final VirtualFile propertiesFile) { @NonNls String text = myBackSlashPressed.contains(propertiesFile) ? value + "\\" : value; UndoUtil.disableUndoIn(document, () -> document.replaceString(0, document.getTextLength(), text)); }
updateDocumentFromPropertyValue
26,273
JBIterable<Object> () { if (!isValid()) { return JBIterable.empty(); } JTree tree = myStructureViewComponent.getTree(); return JBIterable.of(tree.getSelectionModel().getSelectionPaths()) .map(TreeUtil::getLastUserObject); }
getSelectedNodes
26,274
String () { final IProperty selectedProperty = getSelectedProperty(); return selectedProperty == null ? null : selectedProperty.getName(); }
getSelectedPropertyName
26,275
Collection<ResourceBundleEditorViewElement> () { return getSelectedNodes() .filter(AbstractTreeNode.class) .filterMap(AbstractTreeNode::getValue) .filter(ResourceBundleEditorViewElement.class) .toList(); }
getSelectedElements
26,276
Collection<Object> () { return getSelectedNodes() .filter(AbstractTreeNode.class) .filterMap(AbstractTreeNode::getValue) .toList(); }
getSelectedObjects
26,277
Object () { final Collection<Object> selectedElements = getSelectedObjects(); return selectedElements.size() == 1 ? ContainerUtil.getFirstItem(selectedElements) : null; }
getSelectedElementIfOnlyOne
26,278
void () { if (getSelectedNodes().size() != 1) { return; } final IProperty selectedProperty = getSelectedProperty(); if (selectedProperty == null) { return; } final ResourceBundleFileStructureViewElement root = (ResourceBundleFileStructureViewElement)myStructureViewComponent.getTreeModel().getRoot(); final Set<String> p...
selectNextIncompleteProperty
26,279
JComponent () { return myDataProviderPanel; }
getComponent
26,280
StructureViewComponent () { return myStructureViewComponent; }
getStructureViewComponent
26,281
Object (@NotNull String dataId) { if (SelectInContext.DATA_KEY.is(dataId)) { VirtualFile file = getSelectedPropertiesFile(); return file == null ? null : new FileSelectInContext(myProject, file); } return null; }
getData
26,282
VirtualFile () { if (mySelectedEditor == null) return null; VirtualFile selectedFile = null; for (Map.Entry<VirtualFile, EditorEx> entry : myEditors.entrySet()) { Editor editor = entry.getValue(); if (editor == mySelectedEditor) { selectedFile = entry.getKey(); break; } } return selectedFile; }
getSelectedPropertiesFile
26,283
JComponent () { return myStructureViewPanel; }
getPreferredFocusedComponent
26,284
String () { return ResourceBundleEditorBundle.message("resource.bundle.editor.title"); }
getName
26,285
ResourceBundleEditorState (@NotNull FileEditorStateLevel level) { return new ResourceBundleEditorState(getSelectedPropertyName()); }
getState
26,286
void (@Nullable final String propertyName) { if (propertyName != null) { setStructureViewSelection(propertyName); } }
selectProperty
26,287
void (@NotNull FileEditorState state) { selectProperty(((ResourceBundleEditorState)state).getPropertyName()); }
setState
26,288
boolean () { return false; }
isModified
26,289
boolean () { return !myDisposed && !myProject.isDisposed(); }
isValid
26,290
void () { final StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject); if (statusBar != null) { statusBar.setInfo(""); } }
deselectNotify
26,291
void (@NotNull PropertyChangeListener listener) { }
addPropertyChangeListener
26,292
void (@NotNull PropertyChangeListener listener) { }
removePropertyChangeListener
26,293
BackgroundEditorHighlighter () { return myHighlighter; }
getBackgroundHighlighter
26,294
void () { if (mySelectedEditor != null) { for (final Map.Entry<VirtualFile, EditorEx> entry : myEditors.entrySet()) { if (mySelectedEditor.equals(entry.getValue())) { writeEditorPropertyValue(null, mySelectedEditor, entry.getKey()); } } } myDisposed = true; Disposer.dispose(myStructureViewComponent); releaseAllEditors(...
dispose
26,295
void () { for (final Editor editor : myEditors.values()) { if (!editor.isDisposed()) { EditorFactory.getInstance().releaseEditor(editor); } } myEditors.clear(); }
releaseAllEditors
26,296
boolean (@NotNull FileEditorState otherState, @NotNull FileEditorStateLevel level) { return false; }
canBeMergedWith
26,297
String () { return myPropertyName; }
getPropertyName
26,298
EditorEx () { EditorFactory editorFactory = EditorFactory.getInstance(); Document document = editorFactory.createDocument(""); EditorEx editor = (EditorEx)editorFactory.createEditor(document); reinitSettings(editor); editor.putUserData(RESOURCE_BUNDLE_EDITOR_KEY, this); return editor; }
createEditor
26,299
void (final EditorEx editor) { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); editor.setColorsScheme(scheme); editor.setBorder(BorderFactory.createLineBorder(JBColor.border(), 1)); EditorSettings settings = editor.getSettings(); settings.setLineNumbersShown(false); settings.setWhitespa...
reinitSettings