diff options
-rw-r--r-- | android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java | 12 | ||||
-rw-r--r-- | android/src/com/android/tools/idea/editors/theme/attributes/AttributesTableModel.java | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java b/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java index 5f09da77eb6..f3816697142 100644 --- a/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java +++ b/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java @@ -713,19 +713,23 @@ public class ThemeEditorComponent extends Splitter { if (!myIsFilterEnabled) { return true; } + int row = entry.getIdentifier().intValue(); + if (entry.getModel().isSpecialRow(row)) { + return true; + } // We use the column 1 because it's the one that contains the ItemResourceValueWrapper. - Object value = entry.getModel().getValueAt(entry.getIdentifier().intValue(), 1); - String attributeName; - + Object value = entry.getModel().getValueAt(row, 1); if (value instanceof TableLabel) { return false; } + + String attributeName; if (value instanceof EditedStyleItem) { attributeName = ((EditedStyleItem)value).getQualifiedName(); } else { - attributeName = value.toString(); + attributeName = value.toString(); } ThemeEditorStyle selectedTheme = getSelectedStyle(); diff --git a/android/src/com/android/tools/idea/editors/theme/attributes/AttributesTableModel.java b/android/src/com/android/tools/idea/editors/theme/attributes/AttributesTableModel.java index 8edc34c4632..03fae504625 100644 --- a/android/src/com/android/tools/idea/editors/theme/attributes/AttributesTableModel.java +++ b/android/src/com/android/tools/idea/editors/theme/attributes/AttributesTableModel.java @@ -196,6 +196,13 @@ public class AttributesTableModel extends AbstractTableModel implements CellSpan return new AttributeContents(rowIndex - offset); } + /** + * returns true if this row is not a attribute or a label and is the Theme name or Theme parent. + */ + public boolean isSpecialRow(int row) { + return row < mySpecialRows.size(); + } + @Override public int getRowCount() { return myAttributes.size() + myLabels.size() + mySpecialRows.size(); |