diff options
author | Tor Norbye <tnorbye@google.com> | 2012-02-27 07:26:50 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-02-27 07:26:50 -0800 |
commit | b79dc3b325db0efffec45b8ce8ec309ef22a202f (patch) | |
tree | 3027cd9fecc7451e567f65a65fa7b15c29c78781 /eclipse | |
parent | 9109f4c300ac241beaa6adec77844b81e8fc2552 (diff) | |
download | sdk-b79dc3b325db0efffec45b8ce8ec309ef22a202f.zip sdk-b79dc3b325db0efffec45b8ce8ec309ef22a202f.tar.gz sdk-b79dc3b325db0efffec45b8ce8ec309ef22a202f.tar.bz2 |
26077: 'Select all' button selects only one attribute on 'Extract style' dialog
Change-Id: Ie77933fdb529fd5c8cfc960804196fed3ea3c659
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleWizard.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleWizard.java index cf6e967..cbe5120 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleWizard.java @@ -89,6 +89,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { private Map<Attr, Integer> mFrequencyCount; private Set<Attr> mShown; private List<Attr> mInitialChecked; + private List<Attr> mAllChecked; private List<Map.Entry<String, List<Attr>>> mRoot; private Map<String, List<Attr>> mAvailableAttributes; @@ -192,7 +193,8 @@ class ExtractStyleWizard extends VisualRefactoringWizard { @Override public void widgetSelected(SelectionEvent e) { // Select "all" (but not conflicting settings) - mCheckedView.setCheckedElements(initialSelection); + mCheckedView.setCheckedElements(mAllChecked.toArray()); + validatePage(); } }); Button uncheckAllButton = new Button(buttonForm, SWT.FLAT); @@ -201,6 +203,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { @Override public void widgetSelected(SelectionEvent e) { mCheckedView.setAllChecked(false); + validatePage(); } }); @@ -257,6 +260,10 @@ class ExtractStyleWizard extends VisualRefactoringWizard { // The list of initially checked attributes. mInitialChecked = new ArrayList<Attr>(); + // The list of attributes to be checked if "Select All" is chosen (this is not + // the same as *all* attributes, since we need to exclude any conflicts) + mAllChecked = new ArrayList<Attr>(); + // All attributes. mAllAttributes = new ArrayList<Attr>(); @@ -327,6 +334,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { mAllAttributes.addAll(uniqueValueAttrs); mShown.addAll(uniqueValueAttrs); Attr first = uniqueValueAttrs.get(0); + mAllChecked.add(first); if (mInSelection.contains(first)) { mInitialChecked.add(first); } |