From 3138c7f29cbf6bba58bc2a4107c08add2e058c01 Mon Sep 17 00:00:00 2001 From: Yura Date: Thu, 23 Apr 2015 17:33:20 +0100 Subject: Show change parent and change name rows in simple mode. Change-Id: I205ea72b9f0a9dfd07eb25c705662759fb56872f --- .../tools/idea/editors/theme/ThemeEditorComponent.java | 12 ++++++++---- .../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 a5f55cf8404..e6fb278721b 100644 --- a/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java +++ b/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java @@ -696,19 +696,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 0c024591482..38f10089f9a 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 @@ -192,6 +192,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(); -- cgit v1.2.3