summaryrefslogtreecommitdiff
path: root/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-08-20 17:28:18 -0700
committerTor Norbye <tnorbye@google.com>2014-08-20 17:28:18 -0700
commitd76e3920c56d37c942092b7dca20fcaded81c0a5 (patch)
tree80a55c7b59c38377216daaada4e8bc47b69ceb9a /plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/GroupByWordPrefixes.java
parent3b37877a2561bf9fbe072253a18688807d523505 (diff)
parent1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff)
downloadidea-d76e3920c56d37c942092b7dca20fcaded81c0a5.tar.gz
Merge remote-tracking branch 'aosp/upstream-master' into merge
Conflicts: .idea/modules.xml platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdatesXmlLoader.java Change-Id: Id899dae9a1e1c79272f8a70e14a7dcef4f760d7f
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.java13
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);