aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@google.com>2012-02-27 09:41:23 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-27 09:41:23 -0800
commit502b371a60e8747996abde1b5cd64ec7eb10a47f (patch)
tree59e845632462082a717b82377c2ef5b0a1f3448d /eclipse
parente86b239f27c346e29609e33dda99456bf4449806 (diff)
parentb79dc3b325db0efffec45b8ce8ec309ef22a202f (diff)
downloadsdk-502b371a60e8747996abde1b5cd64ec7eb10a47f.zip
sdk-502b371a60e8747996abde1b5cd64ec7eb10a47f.tar.gz
sdk-502b371a60e8747996abde1b5cd64ec7eb10a47f.tar.bz2
Merge "26077: 'Select all' button selects only one attribute on 'Extract style' dialog"
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.java10
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);
}