summaryrefslogtreecommitdiff
path: root/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java')
-rw-r--r--plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
index 61b3c0202619..c4958502c25a 100644
--- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
+++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesPrefixGroup.java
@@ -16,11 +16,13 @@
package com.intellij.lang.properties.structureView;
import com.intellij.icons.AllIcons;
+import com.intellij.ide.structureView.StructureViewTreeElement;
import com.intellij.ide.util.treeView.smartTree.Group;
import com.intellij.ide.util.treeView.smartTree.TreeElement;
import com.intellij.lang.properties.IProperty;
import com.intellij.lang.properties.editor.ResourceBundleEditorViewElement;
import com.intellij.lang.properties.editor.ResourceBundlePropertyStructureViewElement;
+import com.intellij.lang.properties.psi.Property;
import com.intellij.navigation.ItemPresentation;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.text.StringUtil;
@@ -90,20 +92,14 @@ public class PropertiesPrefixGroup implements Group, ResourceBundleEditorViewEle
Collection<TreeElement> result = new ArrayList<TreeElement>();
List<String> prefixWords = StringUtil.split(myPrefix, mySeparator);
for (TreeElement treeElement : myProperties) {
- String key;
- if (treeElement instanceof PropertiesStructureViewElement) {
- PropertiesStructureViewElement propertiesElement = (PropertiesStructureViewElement)treeElement;
- IProperty property = propertiesElement.getValue();
-
- key = property.getUnescapedKey();
- }
- else if (treeElement instanceof ResourceBundlePropertyStructureViewElement) {
- key = ((ResourceBundlePropertyStructureViewElement)treeElement).getValue();
+ if (!(treeElement instanceof StructureViewTreeElement)) {
+ continue;
}
- else {
+ final Object value = ((StructureViewTreeElement)treeElement).getValue();
+ if (!(value instanceof IProperty)) {
continue;
}
-
+ final String key = ((IProperty) value).getUnescapedKey();
if (key == null || key.equals(myPrefix)) {
continue;
}