diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-20 17:01:23 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-08-20 17:01:23 -0700 |
commit | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (patch) | |
tree | 2f4cc6d69645bd460aa253fdecb606d764fbd25d /plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java | |
parent | 02cf98d65c798d368fcec43ed64a001d513bdd4f (diff) | |
download | idea-1aa2e09bdbd413eacb677e9fa4b50630530d0656.tar.gz |
Snapshot idea/138.1696 from git://git.jetbrains.org/idea/community.git
Change-Id: I50c97b83a815ce635e49a38380ba5b8765e4b16a
Diffstat (limited to 'plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java')
-rw-r--r-- | plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java index b67f6bfbea3f..efdbeaf3e863 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java @@ -16,6 +16,7 @@ package com.intellij.lang.properties.structureView; import com.intellij.icons.AllIcons; +import com.intellij.ide.structureView.StructureViewTreeElement; import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.ide.util.treeView.smartTree.*; import com.intellij.lang.properties.IProperty; @@ -65,14 +66,14 @@ public class GroupByWordPrefixes implements Grouper, Sorter { parentPrefixLength = 0; } for (TreeElement element : children) { - String text = null; - if (element instanceof PropertiesStructureViewElement) { - IProperty property = ((PropertiesStructureViewElement)element).getValue(); - text = property.getUnescapedKey(); + if (!(element instanceof StructureViewTreeElement)) { + continue; } - else if (element instanceof ResourceBundlePropertyStructureViewElement) { - text = ((ResourceBundlePropertyStructureViewElement)element).getValue(); + final Object value = ((StructureViewTreeElement)element).getValue(); + if (!(value instanceof IProperty)) { + continue; } + final String text = ((IProperty) value).getUnescapedKey(); if (text == null) continue; LOG.assertTrue(text.startsWith(parentPrefix) || text.startsWith(mySeparator)); List<String> words = StringUtil.split(text, mySeparator); |