aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-04-05 14:36:22 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-04-05 14:36:23 -0700
commitd2ac8a61c333779b865cc95100dbd46f5cee3e69 (patch)
treeb000f09c5b4c4afa6fe2891a681e9ef59b8c8860 /eclipse
parent23ace30ff0d20f23524f527eb6cbd0a97c2bfdbd (diff)
parentdbed8623e1cbbe767f9347f4e8a41b835793191e (diff)
downloadsdk-d2ac8a61c333779b865cc95100dbd46f5cee3e69.zip
sdk-d2ac8a61c333779b865cc95100dbd46f5cee3e69.tar.gz
sdk-d2ac8a61c333779b865cc95100dbd46f5cee3e69.tar.bz2
Merge "Automatically safe files before refreshing lint."
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintViewPart.java10
2 files changed, 8 insertions, 4 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
index 3297756..cd077ec 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
@@ -115,7 +115,7 @@ class AddSuppressAttribute implements ICompletionProposal {
// Use the non-namespace form of set attribute since we can't
// reference the namespace until the model has been reloaded
- mElement.setAttribute(prefix + ':' + ATTR_IGNORE, mId);
+ mElement.setAttribute(prefix + ':' + ATTR_IGNORE, ignore);
UiElementNode rootUiNode = mEditor.getUiRootNode();
if (rootUiNode != null) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintViewPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintViewPart.java
index 956ee9d..e9f94cc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintViewPart.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintViewPart.java
@@ -229,7 +229,7 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha
mRemoveAllAction = new LintViewAction("Remove All", ACTION_REMOVE_ALL,
sharedImages.getImageDescriptor(ISharedImages.IMG_ELCL_REMOVEALL),
sharedImages.getImageDescriptor(ISharedImages.IMG_ELCL_REMOVEALL_DISABLED));
- mRefreshAction = new LintViewAction("Refresh", ACTION_REFRESH,
+ mRefreshAction = new LintViewAction("Refresh (& Save Files)", ACTION_REFRESH,
iconFactory.getImageDescriptor(REFRESH_ICON), null);
mRemoveAllAction.setEnabled(true);
mCollapseAll = new LintViewAction("Collapse All", ACTION_COLLAPSE,
@@ -461,6 +461,11 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha
public void run() {
switch (mAction) {
case ACTION_REFRESH: {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ if (workbench != null) {
+ workbench.saveAllEditors(false /*confirm*/);
+ }
+
Job[] jobs = EclipseLintRunner.getCurrentJobs();
if (jobs.length > 0) {
EclipseLintRunner.cancelCurrentJobs(false);
@@ -471,9 +476,8 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha
}
Job job = EclipseLintRunner.startLint(resources, null,
false /*fatalOnly*/, false /*show*/);
- if (job != null) {
+ if (job != null && workbench != null) {
job.addJobChangeListener(LintViewPart.this);
- IWorkbench workbench = PlatformUI.getWorkbench();
ISharedImages sharedImages = workbench.getSharedImages();
setImageDescriptor(sharedImages.getImageDescriptor(
ISharedImages.IMG_ELCL_STOP));