Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
26,800
void () { final Pair<List<String>, Boolean> keysOrder = keysOrder(myResourceBundle); myOrdered = keysOrder != null; if (myOrdered) { myAlphaSorted = keysOrder.getSecond(); myKeysOrder = myAlphaSorted ? null : keysOrder.getFirst(); } else { myKeysOrder = null; } }
reload
26,801
Collection<String> () { final Set<String> nodes = new LinkedHashSet<>(); for (PropertiesOrder order : propertiesOrders) { nodes.addAll(order.myKeys); } return nodes; }
getNodes
26,802
Iterator<String> (String n) { final Collection<String> siblings = new LinkedHashSet<>(); for (PropertiesOrder order : propertiesOrders) { for (String nextKey : order.getNext(n)) { if (isAlphaSorted[0] && String.CASE_INSENSITIVE_ORDER.compare(n, nextKey) > 0) { isAlphaSorted[0] = false; } siblings.add(nextKey); } } retu...
getIn
26,803
boolean () { return myAlphaSorted; }
isAlphaSorted
26,804
boolean () { return myOrdered; }
isSorted
26,805
List<String> (@NotNull String key) { List<String> nextProperties = null; if (myKeyIndices.containsKey(key)) { final IntList indices = myKeyIndices.get(key); for (int i = 0; i < indices.size(); i++) { final int searchIdx = indices.getInt(i) + 1; if (searchIdx < myKeys.size()) { final String nextProperty = myKeys.get(sea...
getNext
26,806
String () { return "ResourceBundle"; }
getName
26,807
String () { return PropertiesFileType.DEFAULT_EXTENSION; }
getDefaultExtension
26,808
String () { return PropertiesBundle.message("filetype.resourcebundle.description"); }
getDescription
26,809
String () { return PropertiesBundle.message("filetype.resourcebundle.display.name"); }
getDisplayName
26,810
boolean (@NotNull VirtualFile file) { return file instanceof ResourceBundleAsVirtualFile; }
isMyFileType
26,811
ResourceBundle (@NotNull DataContext dataContext) { PsiElement element = CommonDataKeys.PSI_ELEMENT.getData(dataContext); if (element instanceof IProperty) return null; //rename property final ResourceBundle[] bundles = ResourceBundle.ARRAY_DATA_KEY.getData(dataContext); if (bundles != null && bundles.length == 1) retu...
getResourceBundleFromDataContext
26,812
void (@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor<? super PsiElement> consumer) { final PsiElement element = queryParameters.getElement(); Property prop = ReadAction.compute(() -> GotoPropertyParentDeclarationHandler.findProperty(element)); if (prop == null || !(queryParameters...
processQuery
26,813
IProperty () { return getPsiElement() != null ? myProperty : null; }
getProperty
26,814
PsiElement () { PsiElement element = myProperty.getPsiElement(); return element.isValid() ? element : null; }
getPsiElement
26,815
void (final String presentableName) { myPresentableName = presentableName; }
setPresentableName
26,816
String () { return myGrouped.getAsBoolean() ? myPresentableName : null; }
getPresentableName
26,817
IProperty () { return getProperty(); }
getValue
26,818
TextAttributes (EditorColorsScheme colorsScheme) { return null; }
getErrorTextAttributes
26,819
ItemPresentation () { return new TextAttributesPresentation() { @Nullable @Override public TextAttributesKey getTextAttributesKey() { return (getPresentableName() != null && getPresentableName().isEmpty()) ? GROUP_KEY : null; } @Override public String getPresentableText() { IProperty property = getProperty(); if (prope...
getPresentation
26,820
TextAttributesKey () { return (getPresentableName() != null && getPresentableName().isEmpty()) ? GROUP_KEY : null; }
getTextAttributesKey
26,821
String () { IProperty property = getProperty(); if (property == null) return null; String presentableName = getPresentableName(); if (presentableName == null) { return property.getName(); } return !presentableName.isEmpty() ? presentableName : PropertiesBundle.message("structure.view.empty.property.presentation"); }
getPresentableText
26,822
Icon (boolean open) { return myProperty.getIcon(0); }
getIcon
26,823
TextAttributes (EditorColorsScheme colorsScheme) { final TextAttributesKey baseAttrKey = (getPresentableName() != null && getPresentableName().isEmpty()) ? GROUP_KEY : PropertiesHighlighter.PropertiesComponent.PROPERTY_KEY.getTextAttributesKey(); final TextAttributes baseAttrs = colorsScheme.getAttributes(baseAttrKey);...
getTextAttributes
26,824
void (boolean requestFocus) { myProperty.navigate(requestFocus); }
navigate
26,825
boolean () { return myProperty.canNavigate(); }
canNavigate
26,826
boolean () { return myProperty.canNavigateToSource(); }
canNavigateToSource
26,827
PsiElement (@Nullable PsiElement sourceElement, Editor editor) { Property property = findProperty(sourceElement); if (property == null) return null; final String key = property.getKey(); if (key == null) return null; PropertiesFile currentFile = PropertiesImplUtil.getPropertiesFile(property.getContainingFile()); if (cu...
getGotoDeclarationTarget
26,828
Property (@Nullable PsiElement source) { if (source == null) return null; if (source instanceof Property) return (Property)source; final PsiElement parent = source.getParent(); return parent instanceof Property ? (Property)parent : null; }
findProperty
26,829
void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withLocalName("key"), new PsiReferenceProvider() { @Override public boolean acceptsTarget(@NotNull PsiElement target) { return target instanceof PomTargetPsiElement && ((PomTargetPsiElement)target).getT...
registerReferenceProviders
26,830
boolean (@NotNull PsiElement target) { return target instanceof PomTargetPsiElement && ((PomTargetPsiElement)target).getTarget() instanceof XmlProperty; }
acceptsTarget
26,831
void () { while (myFileModificationStamp != myFile.getModificationStamp() || myPropertiesMap == null) { myFileModificationStamp = myFile.getModificationStamp(); MostlySingularMultiMap<String, IProperty> propertiesMap = new MostlySingularMultiMap<>(); XmlTag rootTag = myFile.getRootTag(); final List<IProperty> propertie...
ensurePropertiesLoaded
26,832
PsiFile () { return myFile; }
getContainingFile
26,833
List<IProperty> () { synchronized (myLock) { ensurePropertiesLoaded(); return myProperties; } }
getProperties
26,834
IProperty (@NotNull @NonNls String key) { synchronized (myLock) { ensurePropertiesLoaded(); Iterator<IProperty> properties = myPropertiesMap.get(key).iterator(); return properties.hasNext() ? properties.next(): null; } }
findPropertyByKey
26,835
List<IProperty> (@NotNull @NonNls String key) { synchronized (myLock) { ensurePropertiesLoaded(); return ContainerUtil.collect(myPropertiesMap.get(key).iterator()); } }
findPropertiesByKey
26,836
ResourceBundle () { return PropertiesImplUtil.getResourceBundle(this); }
getResourceBundle
26,837
Locale () { return PropertiesUtil.getLocale(this); }
getLocale
26,838
IProperty (@NotNull String key, @NotNull String value, IProperty anchor) { return addPropertyAfter(key, value, anchor, true); }
addPropertyAfter
26,839
IProperty (String key, String value, @Nullable IProperty anchor, boolean addToEnd) { final XmlTag anchorTag = anchor == null ? null : (XmlTag)anchor.getPsiElement().getNavigationElement(); final XmlTag rootTag = myFile.getRootTag(); final XmlTag entry = createPropertyTag(key, value); final XmlTag addedEntry = (XmlTag) ...
addPropertyAfter
26,840
IProperty (@NotNull String key, @NotNull String value, @NotNull PropertyKeyValueFormat format) { final XmlTag entry = createPropertyTag(key, value); synchronized (myLock) { ensurePropertiesLoaded(); if (myAlphaSorted) { final XmlProperty dummyProperty = new XmlProperty(entry, this); final int insertIndex = Collections....
addProperty
26,841
XmlTag (final String key, final String value) { XmlTag rootTag = myFile.getRootTag(); XmlTag entry = rootTag.createChildTag("entry", "", value, false); entry.setAttribute("key", key); return entry; }
createPropertyTag
26,842
PropertiesFile (@NotNull PsiFile file) { CachedValuesManager manager = CachedValuesManager.getManager(file.getProject()); if (file instanceof XmlFile) { return manager.getCachedValue(file, KEY, () -> { PropertiesFile value = XmlPropertiesIndex.isPropertiesFile((XmlFile)file) ? new XmlPropertiesFileImpl((XmlFile)file) :...
getPropertiesFile
26,843
String () { return getContainingFile().getName(); }
getName
26,844
VirtualFile () { return getContainingFile().getVirtualFile(); }
getVirtualFile
26,845
PsiDirectory () { return getContainingFile().getParent(); }
getParent
26,846
Project () { return getContainingFile().getProject(); }
getProject
26,847
String () { return getContainingFile().getText(); }
getText
26,848
boolean () { synchronized (myLock) { ensurePropertiesLoaded(); return myAlphaSorted; } }
isAlphaSorted
26,849
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; XmlPropertiesFileImpl that = (XmlPropertiesFileImpl)o; if (!myFile.equals(that.myFile)) return false; return true; }
equals
26,850
int () { return myFile.hashCode(); }
hashCode
26,851
String () { return "XmlPropertiesFileImpl:" + getName(); }
toString
26,852
String () { return myTag.getAttributeValue("key"); }
getName
26,853
boolean () { return myTag.isWritable(); }
isWritable
26,854
PsiElement (@NotNull String name) { return myTag.setAttribute("key", name); }
setName
26,855
String () { return getName(); }
getKey
26,856
String () { return myTag.getValue().getText(); }
getValue
26,857
String () { return getValue(); }
getUnescapedValue
26,858
String () { return getKey(); }
getUnescapedKey
26,859
String () { return null; }
getDocCommentText
26,860
PsiElement () { return PomService.convertToPsi(this); }
getPsiElement
26,861
void (boolean requestFocus) { }
navigate
26,862
boolean () { return true; }
canNavigate
26,863
boolean () { return true; }
canNavigateToSource
26,864
Icon (int flags) { return PlatformIcons.PROPERTY_ICON; }
getIcon
26,865
boolean () { return myTag.isValid(); }
isValid
26,866
PsiElement () { return myTag; }
getNavigationElement
26,867
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; XmlProperty property = (XmlProperty)o; if (!myTag.equals(property.myTag)) return false; return true; }
equals
26,868
int () { return myTag.hashCode(); }
hashCode
26,869
String () { return "XmlProperty: key = '" + getKey() + "', value = '" + getValue() + "'"; }
toString
26,870
KeyDescriptor<Key> () { return this; }
getKeyDescriptor
26,871
DataExternalizer<String> () { return EnumeratorStringDescriptor.INSTANCE; }
getValueExternalizer
26,872
boolean (@NotNull VirtualFile file) { return file.getName().endsWith(".xml"); }
acceptInput
26,873
boolean () { return true; }
dependsOnFileContent
26,874
int () { return 2; }
getVersion
26,875
boolean (XmlFile file) { Project project = file.getProject(); if (!file.isValid()) return false; VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile == null || DumbService.isDumb(project) || NoAccessDuringPsiEvents.isInsideEventProcessing()) { CharSequence contents = file.getViewProvider().getContents(); r...
isPropertiesFile
26,876
boolean (CharSequence bytes) { return parse(bytes, true).accepted; }
isAccepted
26,877
MyIXMLBuilderAdapter (CharSequence text, boolean stopIfAccepted) { StdXMLReader reader = new StdXMLReader(CharArrayUtil.readerFromCharSequence(text)) { @Override public Reader openStream(String publicID, String systemID) throws IOException { if (!HTTP_JAVA_SUN_COM_DTD_PROPERTIES_DTD.equals(systemID)) throw new IOExcept...
parse
26,878
int (Key value) { return value.hashCode(); }
getHashCode
26,879
boolean (Key val1, Key val2) { return val1.isMarker == val2.isMarker && Objects.equals(val1.key, val2.key); }
isEqual
26,880
String () { return "Key{" + "isMarker=" + isMarker + ", key='" + key + '\'' + '}'; }
toString
26,881
int () { return isMarker ? 0 : key.hashCode(); }
hashCode
26,882
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Key key1 = (Key)o; if (isMarker != key1.isMarker) return false; if (!Objects.equals(key, key1.key)) return false; return true; }
equals
26,883
void (String key, String nsPrefix, String nsURI, String value, String type) { if (insideEntry && "key".equals(key)) { this.key = value; } }
addAttribute
26,884
Icon (@NotNull PsiElement element, int flags) { return element instanceof XmlFile && ((XmlFile)element).getFileType() == XmlFileType.INSTANCE && PropertiesImplUtil.getPropertiesFile((XmlFile)element) != null ? PropertiesIcons.XmlProperties : null; }
getIcon
26,885
boolean (@NotNull PsiElement psiElement) { return psiElement instanceof PsiNamedElement; }
canFindUsagesFor
26,886
String (@NotNull PsiElement psiElement) { return HelpID.FIND_OTHER_USAGES; }
getHelpId
26,887
String (@NotNull PsiElement element) { if (element instanceof IProperty) return PropertiesBundle.message("terms.property"); return ""; }
getType
26,888
String (@NotNull PsiElement element) { if (element instanceof PsiNamedElement) { return StringUtil.notNullize(((PsiNamedElement)element).getName()); } return element.getText(); }
getDescriptiveName
26,889
String (@NotNull PsiElement element, boolean useFullName) { return getDescriptiveName(element); }
getNodeText
26,890
WordsScanner () { return new PropertiesWordsScanner(); }
getWordsScanner
26,891
String () { return PluginPathManager.getPluginHomePath("properties") + "/tests/testData"; }
getTestDataPath
26,892
void () { final TrailingSpacesInPropertyInspection inspection = new TrailingSpacesInPropertyInspection(); myFixture.enableInspections(inspection); myFixture.configureByFile("/propertiesFile/highlighting/trailingSpaces.properties"); myFixture.checkHighlighting(true, false, true); myFixture.disableInspections(inspection)...
testSimple
26,893
void () { final TrailingSpacesInPropertyInspection inspection = new TrailingSpacesInPropertyInspection(); inspection.myIgnoreVisibleSpaces = true; myFixture.enableInspections(inspection); VirtualFile file = myFixture.copyFileToProject("/propertiesFile/highlighting/trailingSpaces2.properties"); myFixture.configureFromEx...
testOnlyNonVisible
26,894
void () { doTest(""" a.b.c=dddd a.b.d=dddd a.x=i b.n.p=ooo""", """ -Test.properties -a -b c d x b.n.p"""); }
testGrouping
26,895
void () { doTest(""" a=dddd a.b=dddd a.b.c=i a.b.c.d=ooo""", """ -Test.properties -a <property> -b <property> -c <property> d"""); }
testNesting
26,896
void () { doTest(""" log4j.category.x=dd log4j.category.xdo=dd log4j.category.middlegen.swing.ss=dd log4j.category.middlegen.plugins.ss=dd log4j.appender.middlegen.plugins.ss=dd""", """ -Test.properties -log4j appender.middlegen.plugins.ss -category -middlegen plugins.ss swing.ss x xdo"""); }
testGroupSort
26,897
void () { doTest(""" errors.byte={0} must be a BYTE type\s errors.short={0} must be a SHORT type\s error.date={0} must be a DATE types\s error.range={0} is not between {1} and {2}\s errors.email={0} is not a valid Email Address\s errors.ipaddress={0} is not a valid IP address""", """ -Test.properties -error date range ...
testFunkyGroups
26,898
void (String classText, String expected) { myFixture.configureByText("Test.properties", classText); myFixture.testStructureView(svc -> { svc.setActionActive(Sorter.ALPHA_SORTER_ID, true); svc.setActionActive(GroupByWordPrefixes.ID, true); svc.setActionActive(PropertiesFileStructureViewModel.KIND_SORTER_ID, true); JTree...
doTest
26,899
String () { return PluginPathManager.getPluginHomePath("properties") + "/tests/testData/propertiesFile/projectView"; }
getTestDataPath