diff options
author | Tor Norbye <tnorbye@google.com> | 2011-12-20 20:20:24 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-12-21 13:36:23 -0800 |
commit | ab36f4e7488358dea4ab6b54ee2b7bef3da0232b (patch) | |
tree | e6846336e35cd0fb29addf962c9031c68492ed30 /eclipse/plugins | |
parent | 4ae7075d188a35298d834bfcd0500b77b08a12ab (diff) | |
download | sdk-ab36f4e7488358dea4ab6b54ee2b7bef3da0232b.zip sdk-ab36f4e7488358dea4ab6b54ee2b7bef3da0232b.tar.gz sdk-ab36f4e7488358dea4ab6b54ee2b7bef3da0232b.tar.bz2 |
Update SDK codebase to JDK 6
This changeset makes the SDK codebase compile with source=1.6 (which
means it also requires JDK 6). This means that methods implementing an
interface requires @Override's. It also means we can start using APIs
like the ArrayDeque class and methods like String#isEmpty().
This changeset looks big but the change is trivial: it's basically
adding @Override in all the places that need it, along with some other
automatic Eclipse cleanup in certain files (such as reordering imports
where they were incorrectly ordered (because older versions of Eclipse
didn't always handle inner classes right)), as well as cleaning up
trailing whitespace and removing some $NON-NLS-1$ markers on lines
where there aren't any string literals anymore.
This changeset also sets the source and target JDK level to 6 in the
Eclipse compiler .settings file, and synchronizes this file to all the
other Eclipse SDK projects.
Change-Id: I6a9585aa44c3dee9a5c00739ab22fbdbcb9f8275
Diffstat (limited to 'eclipse/plugins')
316 files changed, 1983 insertions, 288 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/.settings/org.eclipse.jdt.core.prefs index f4696e4..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Wed Mar 16 15:10:40 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -16,6 +25,7 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore @@ -24,6 +34,7 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning @@ -37,11 +48,15 @@ org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning @@ -55,6 +70,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled @@ -62,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/actions/AddNativeAction.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/actions/AddNativeAction.java index fdb96b6..50580e9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/actions/AddNativeAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/actions/AddNativeAction.java @@ -32,6 +32,7 @@ public class AddNativeAction implements IObjectActionDelegate { private IWorkbenchPart mPart; private ISelection mSelection; + @Override public void run(IAction action) { IProject project = null; if (mSelection instanceof IStructuredSelection) { @@ -55,10 +56,12 @@ public class AddNativeAction implements IObjectActionDelegate { } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { mPart = targetPart; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/build/NdkEnvSupplier.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/build/NdkEnvSupplier.java index 3259a4e..246f35f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/build/NdkEnvSupplier.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/build/NdkEnvSupplier.java @@ -39,10 +39,12 @@ public class NdkEnvSupplier implements IConfigurationEnvironmentVariableSupplier if (Platform.getOS().equals(Platform.OS_WIN32)) {
// For Windows, need to add a shell to the path
IBuildEnvironmentVariable path = new IBuildEnvironmentVariable() {
+ @Override
public String getName() {
return "PATH"; //$NON-NLS-1$
}
+ @Override
public String getValue() {
// I'm giving MSYS precedence over Cygwin. I'm biased that
// way :)
@@ -62,10 +64,12 @@ public class NdkEnvSupplier implements IConfigurationEnvironmentVariableSupplier return null;
}
+ @Override
public int getOperation() {
return ENVVAR_PREPEND;
}
+ @Override
public String getDelimiter() {
return ";"; //$NON-NLS-1$
}
@@ -75,18 +79,22 @@ public class NdkEnvSupplier implements IConfigurationEnvironmentVariableSupplier // Since we're using real paths, need to tell cygwin it's OK
IBuildEnvironmentVariable cygwin = new IBuildEnvironmentVariable() {
+ @Override
public String getName() {
return "CYGWIN"; //$NON-NLS-1$
}
+ @Override
public String getValue() {
return "nodosfilewarning"; //$NON-NLS-1$
}
+ @Override
public int getOperation() {
return ENVVAR_REPLACE;
}
+ @Override
public String getDelimiter() {
return null;
}
@@ -96,12 +104,14 @@ public class NdkEnvSupplier implements IConfigurationEnvironmentVariableSupplier }
}
+ @Override
public IBuildEnvironmentVariable getVariable(String variableName,
IConfiguration configuration, IEnvironmentVariableProvider provider) {
init();
return mEnvVars.get(variableName);
}
+ @Override
public IBuildEnvironmentVariable[] getVariables(
IConfiguration configuration, IEnvironmentVariableProvider provider) {
init();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkDiscoveredPathInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkDiscoveredPathInfo.java index 7baeb63..c6a05de 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkDiscoveredPathInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkDiscoveredPathInfo.java @@ -57,10 +57,12 @@ public class NdkDiscoveredPathInfo implements IDiscoveredPathInfo { load();
}
+ @Override
public IProject getProject() {
return mProject;
}
+ @Override
public IPath[] getIncludePaths() {
if (mNeedReindexing) {
// Call for a reindex
@@ -82,6 +84,7 @@ public class NdkDiscoveredPathInfo implements IDiscoveredPathInfo { mNeedReindexing = true;
}
+ @Override
public Map<String, String> getSymbols() {
if (mSymbols == null)
mSymbols = new HashMap<String, String>();
@@ -92,6 +95,7 @@ public class NdkDiscoveredPathInfo implements IDiscoveredPathInfo { this.mSymbols = symbols;
}
+ @Override
public IDiscoveredScannerInfoSerializable getSerializable() {
return null;
}
@@ -111,11 +115,11 @@ public class NdkDiscoveredPathInfo implements IDiscoveredPathInfo { private boolean needUpdating() {
if (mLastUpdate == IFile.NULL_STAMP)
return true;
- return mProject.getFile(ANDROID_MK).getLocalTimeStamp() > mLastUpdate; //$NON-NLS-1$
+ return mProject.getFile(ANDROID_MK).getLocalTimeStamp() > mLastUpdate;
}
private void recordUpdate() {
- mLastUpdate = mProject.getFile(ANDROID_MK).getLocalTimeStamp(); //$NON-NLS-1$
+ mLastUpdate = mProject.getFile(ANDROID_MK).getLocalTimeStamp();
}
public void delete() {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkScannerInfoCollector.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkScannerInfoCollector.java index 1538948..8ffea59 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkScannerInfoCollector.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/discovery/NdkScannerInfoCollector.java @@ -35,57 +35,70 @@ public class NdkScannerInfoCollector implements IScannerInfoCollector3, private NdkDiscoveredPathInfo mPathInfo;
+ @Override
public void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes")
Map scannerInfo) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public @SuppressWarnings("rawtypes")
List getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void setProject(IProject project) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException {
mPathInfo.update(monitor);
}
+ @Override
public IDiscoveredPathInfo createPathInfoObject() {
return mPathInfo;
}
+ @Override
public Map<String, String> getDefinedSymbols() {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public @SuppressWarnings("rawtypes")
List getIncludePaths() {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void setInfoContext(InfoContext context) {
mPathInfo = new NdkDiscoveredPathInfo(context.getProject());
}
+ @Override
public void deleteAllPaths(IResource resource) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void deleteAllSymbols(IResource resource) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void deletePath(IResource resource, String path) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void deleteSymbol(IResource resource, String symbol) {
throw new Error("Not implemented"); //$NON-NLS-1$
}
+ @Override
public void deleteAll(IResource resource) {
mPathInfo.delete();
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/preferences/NdkPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/preferences/NdkPreferencePage.java index 55989e7..6188907 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/preferences/NdkPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/preferences/NdkPreferencePage.java @@ -75,6 +75,7 @@ public class NdkPreferencePage extends FieldEditorPreferencePage implements } + @Override public void init(IWorkbench workbench) { // Nothing to do herea } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizard.java index 8f66336..2116eb4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizard.java @@ -70,9 +70,11 @@ public class AddNativeWizard extends Wizard { mAddNativeWizardPage.updateArgs(mTemplateArgs);
IRunnableWithProgress op = new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
IWorkspaceRunnable op1 = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor1) throws CoreException {
// Convert to CDT project
CCorePlugin.getDefault().convertProjectToCC(mProject, monitor1,
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizardPage.java b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizardPage.java index 4c00aef..8a715e3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizardPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt.ndk/src/com/android/ide/eclipse/adt/ndk/internal/wizards/AddNativeWizardPage.java @@ -51,6 +51,7 @@ public class AddNativeWizardPage extends WizardPage { return NdkManager.isNdkLocationValid();
}
+ @Override
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs index f4696e4..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Wed Mar 16 15:10:40 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -16,6 +25,7 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore @@ -24,6 +34,7 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning @@ -37,11 +48,15 @@ org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning @@ -55,6 +70,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled @@ -62,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Thu Jun 09 12:26:44 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java index 6f6fb87..526b8c2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java @@ -64,6 +64,7 @@ public class AbsoluteLayoutRule extends BaseLayoutRule { } DropFeedback df = new DropFeedback(null, new IFeedbackPainter() { + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { // Paint callback for the AbsoluteLayout. // This is called by the canvas when a draw is needed. @@ -156,6 +157,7 @@ public class AbsoluteLayoutRule extends BaseLayoutRule { feedback.isCopy || !feedback.sameCanvas); targetNode.editXml("Add elements to AbsoluteLayout", new INodeHandler() { + @Override public void handle(INode node) { boolean first = true; Point offset = null; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AdapterViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AdapterViewRule.java index 1de09b8..5b23e34 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AdapterViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AdapterViewRule.java @@ -31,6 +31,7 @@ public class AdapterViewRule extends BaseLayoutRule { // You are not allowed to insert children into AdapterViews; you must // use the dedicated addView methods etc dynamically DropFeedback dropFeedback = new DropFeedback(null, new IFeedbackPainter() { + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { Rect b = node.getBounds(); if (b.isValid()) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java index 55667fe..b9c2290 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java @@ -115,9 +115,11 @@ public class BaseLayoutRule extends BaseViewRule { final INode first = targets.get(0); IMenuCallback actionCallback = new IMenuCallback() { + @Override public void action(RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { parentNode.editXml("Change Margins", new INodeHandler() { + @Override public void handle(INode n) { String uri = ANDROID_URI; String all = first.getStringAttr(uri, ATTR_LAYOUT_MARGIN); @@ -153,6 +155,7 @@ public class BaseLayoutRule extends BaseViewRule { if (targets != null && targets.size() > 0) { final INode first = targets.get(0); ChoiceProvider provider = new ChoiceProvider() { + @Override public void addChoices(List<String> titles, List<URL> iconUrls, List<String> ids) { IAttributeInfo info = first.getAttributeInfo(ANDROID_URI, attributeName); @@ -190,6 +193,7 @@ public class BaseLayoutRule extends BaseViewRule { // Shared action callback IMenuCallback actionCallback = new IMenuCallback() { + @Override public void action(RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { final String actionId = action.getId(); @@ -202,6 +206,7 @@ public class BaseLayoutRule extends BaseViewRule { return; } parentNode.editXml(undoLabel, new INodeHandler() { + @Override public void handle(INode n) { String attribute = actionId.equals(ACTION_FILL_WIDTH) ? ATTR_LAYOUT_WIDTH : ATTR_LAYOUT_HEIGHT; @@ -490,6 +495,7 @@ public class BaseLayoutRule extends BaseViewRule { public static final AttributeFilter DEFAULT_ATTR_FILTER = new AttributeFilter() { Set<String> mExcludes; + @Override public String replace(String uri, String name, String value) { if (!ANDROID_URI.equals(uri)) { return value; @@ -600,6 +606,7 @@ public class BaseLayoutRule extends BaseViewRule { targetNode.editXml("Insert Elements", new INodeHandler() { + @Override public void handle(INode node) { // Now write the new elements. int insertPos = initialInsertPos; @@ -641,6 +648,7 @@ public class BaseLayoutRule extends BaseViewRule { // snap to the preferred size Map<INode, Rect> sizes = mRulesEngine.measureChildren(parent, new IClientRulesEngine.AttributeFilter() { + @Override public String getAttribute(INode node, String namespace, String localName) { // Change attributes to wrap_content if (ATTR_LAYOUT_WIDTH.equals(localName) @@ -660,6 +668,7 @@ public class BaseLayoutRule extends BaseViewRule { } return new DropFeedback(state, new IFeedbackPainter() { + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { ResizeState resizeState = (ResizeState) feedback.userData; if (resizeState != null && resizeState.bounds != null) { @@ -827,6 +836,7 @@ public class BaseLayoutRule extends BaseViewRule { if (oldBounds.w != newBounds.w || oldBounds.h != newBounds.h) { final ResizeState state = (ResizeState) feedback.userData; child.editXml("Resize", new INodeHandler() { + @Override public void handle(INode n) { setNewSizeBounds(state, n, parent, oldBounds, newBounds, state.horizontalEdgeType, state.verticalEdgeType); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java index e7facf5..320455d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java @@ -147,6 +147,7 @@ public class BaseViewRule extends AbstractViewRule { final String newHeight = height; final IMenuCallback onChange = new IMenuCallback() { + @Override public void action( final RuleAction action, final List<? extends INode> selectedNodes, @@ -416,12 +417,14 @@ public class BaseViewRule extends AbstractViewRule { RuleAction properties = RuleAction.createChoices("properties", "Other Properties", //$NON-NLS-1$ onChange /*callback*/, null /*icon*/, 50, true /*supportsMultipleNodes*/, new ActionProvider() { + @Override public List<RuleAction> getNestedActions(INode node) { List<RuleAction> propertyActionTypes = new ArrayList<RuleAction>(); propertyActionTypes.add(RuleAction.createChoices( "recent", "Recent", //$NON-NLS-1$ onChange /*callback*/, null /*icon*/, 10, true /*supportsMultipleNodes*/, new ActionProvider() { + @Override public List<RuleAction> getNestedActions(INode n) { List<RuleAction> propertyActions = new ArrayList<RuleAction>(); addRecentPropertyActions(propertyActions, n, onChange); @@ -438,6 +441,7 @@ public class BaseViewRule extends AbstractViewRule { "layoutparams", "Layout Parameters", //$NON-NLS-1$ onChange /*callback*/, null /*icon*/, 60, true /*supportsMultipleNodes*/, new ActionProvider() { + @Override public List<RuleAction> getNestedActions(INode n) { List<RuleAction> propertyActions = new ArrayList<RuleAction>(); addPropertyActions(propertyActions, n, onChange, null, true); @@ -451,6 +455,7 @@ public class BaseViewRule extends AbstractViewRule { "allprops", "All By Name", //$NON-NLS-1$ onChange /*callback*/, null /*icon*/, 80, true /*supportsMultipleNodes*/, new ActionProvider() { + @Override public List<RuleAction> getNestedActions(INode n) { List<RuleAction> propertyActions = new ArrayList<RuleAction>(); addPropertyActions(propertyActions, n, onChange, null, false); @@ -514,6 +519,7 @@ public class BaseViewRule extends AbstractViewRule { label, onChange /*callback*/, null /*icon*/, sortPriority++, true /*supportsMultipleNodes*/, new ActionProvider() { + @Override public List<RuleAction> getNestedActions(INode n) { List<RuleAction> propertyActions = new ArrayList<RuleAction>(); addPropertyActions(propertyActions, n, onChange, definedBy, false); @@ -624,6 +630,7 @@ public class BaseViewRule extends AbstractViewRule { // The properties are coming out of map key order which isn't right, so sort // alphabetically instead Collections.sort(actions, new Comparator<RuleAction>() { + @Override public int compare(RuleAction action1, RuleAction action2) { return action1.getTitle().compareTo(action2.getTitle()); } @@ -728,6 +735,7 @@ public class BaseViewRule extends AbstractViewRule { * values for a boolean property: true, false, or "default". */ private static ChoiceProvider BOOLEAN_CHOICE_PROVIDER = new ChoiceProvider() { + @Override public void addChoices(List<String> titles, List<URL> iconUrls, List<String> ids) { titles.add("True"); ids.add(TRUE_ID); @@ -755,6 +763,7 @@ public class BaseViewRule extends AbstractViewRule { this.mProperty = property; } + @Override public void addChoices(List<String> titles, List<URL> iconUrls, List<String> ids) { for (Entry<String, String> entry : mProperty.getChoices().entrySet()) { ids.add(entry.getKey()); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java index a87de29..4f76111 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/EditTextRule.java @@ -58,9 +58,11 @@ public class EditTextRule extends BaseViewRule { final String label = hasFocus ? "Clear Focus" : "Request Focus"; IMenuCallback onChange = new IMenuCallback() { + @Override public void action(RuleAction menuAction, List<? extends INode> selectedNodes, String valueId, Boolean newValue) { selectedNode.editXml(label, new INodeHandler() { + @Override public void handle(INode node) { INode focus = findFocus(findRoot(node)); if (focus != null && focus.getParent() != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FrameLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FrameLayoutRule.java index 090b9b3..4a8dfbb 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FrameLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FrameLayoutRule.java @@ -57,6 +57,7 @@ public class FrameLayoutRule extends BaseLayoutRule { } return new DropFeedback(null, new IFeedbackPainter() { + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { drawFeedback(gc, node, elements, feedback); } @@ -139,6 +140,7 @@ public class FrameLayoutRule extends BaseLayoutRule { targetNode.editXml("Add elements to FrameLayout", new INodeHandler() { + @Override public void handle(INode node) { // Now write the new elements. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java index 1eaa6f4..4fda13d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java @@ -170,9 +170,11 @@ public class GridLayoutRule extends BaseLayoutRule { } IMenuCallback actionCallback = new IMenuCallback() { + @Override public void action(final RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { parentNode.editXml("Add/Remove Row/Column", new INodeHandler() { + @Override public void handle(INode n) { String id = action.getId(); if (id.equals(ACTION_SHOW_STRUCTURE)) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java index 38b3db4..b89c0f8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java @@ -166,9 +166,11 @@ public class LinearLayoutRule extends BaseLayoutRule { // Weights IMenuCallback actionCallback = new IMenuCallback() { + @Override public void action(final RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { parentNode.editXml("Change Weight", new INodeHandler() { + @Override public void handle(INode n) { String id = action.getId(); if (id.equals(ACTION_WEIGHT)) { @@ -342,6 +344,7 @@ public class LinearLayoutRule extends BaseLayoutRule { return new DropFeedback(new LinearDropData(indexes, posCount, isVertical, selfPos), new IFeedbackPainter() { + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { // Paint callback for the LinearLayout. This is called // by the canvas when a draw is needed. @@ -771,6 +774,7 @@ public class LinearLayoutRule extends BaseLayoutRule { unweightedSizes = mRulesEngine.measureChildren(layout, new IClientRulesEngine.AttributeFilter() { + @Override public String getAttribute(INode n, String namespace, String localName) { // Clear out layout weights; we need to measure the unweighted sizes // of the children diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertyCallback.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertyCallback.java index 45cd2c5..ac1635c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertyCallback.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertyCallback.java @@ -53,6 +53,7 @@ public class PropertyCallback implements IMenuCallback { } // ---- Implements IMenuCallback ---- + @Override public void action(RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { if (mTargetNodes != null && mTargetNodes.size() > 0) { @@ -63,6 +64,7 @@ public class PropertyCallback implements IMenuCallback { } final List<? extends INode> nodes = selectedNodes; selectedNodes.get(0).editXml(mUndoLabel, new INodeHandler() { + @Override public void handle(INode n) { for (INode targetNode : nodes) { if (valueId != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertySettingNodeHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertySettingNodeHandler.java index 8c57da8..ad3ddad 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertySettingNodeHandler.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/PropertySettingNodeHandler.java @@ -34,6 +34,7 @@ class PropertySettingNodeHandler implements INodeHandler { mValue = value; } + @Override public void handle(INode node) { node.setAttribute(mNamespaceUri, mAttribute, mValue); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java index 841c590..6212cff 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java @@ -186,6 +186,7 @@ public class RelativeLayoutRule extends BaseLayoutRule { feedback.isCopy || !feedback.sameCanvas); targetNode.editXml("Dropped", new INodeHandler() { + @Override public void handle(INode n) { int index = -1; @@ -306,6 +307,7 @@ public class RelativeLayoutRule extends BaseLayoutRule { final ResizeHandler state = (ResizeHandler) feedback.userData; child.editXml("Resize", new INodeHandler() { + @Override public void handle(INode n) { state.removeCycles(); state.applyConstraints(n); @@ -326,11 +328,13 @@ public class RelativeLayoutRule extends BaseLayoutRule { actions.add(createMarginAction(parentNode, children)); IMenuCallback callback = new IMenuCallback() { + @Override public void action(RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { final String id = action.getId(); if (id.equals(ACTION_CENTER_VERTICAL)|| id.equals(ACTION_CENTER_HORIZONTAL)) { parentNode.editXml("Center", new INodeHandler() { + @Override public void handle(INode n) { if (id.equals(ACTION_CENTER_VERTICAL)) { for (INode child : children) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java index b5987c0..ceb562d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java @@ -73,6 +73,7 @@ public class TableLayoutRule extends LinearLayoutRule { super.addContextMenuActions(actions, selectedNode); IMenuCallback addTab = new IMenuCallback() { + @Override public void action(RuleAction action, List<? extends INode> selectedNodes, final String valueId, Boolean newValue) { final INode node = selectedNode; @@ -97,9 +98,11 @@ public class TableLayoutRule extends LinearLayoutRule { List<RuleAction> actions, final INode parentNode, final List<? extends INode> children) { IMenuCallback actionCallback = new IMenuCallback() { + @Override public void action(final RuleAction action, List<? extends INode> selectedNodes, final String valueId, final Boolean newValue) { parentNode.editXml("Add/Remove Table Row", new INodeHandler() { + @Override public void handle(INode n) { if (action.getId().equals(ACTION_ADD_ROW)) { // Determine the index of the selection, if any; if there is diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java index 70552ce..3a73558 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java @@ -126,6 +126,7 @@ public class GridLayoutPainter { } // Implements IFeedbackPainter + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { Rect b = node.getBounds(); if (!b.isValid()) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java index e146cea..aaca4bc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java @@ -68,6 +68,7 @@ class GridMatch implements Comparable<GridMatch> { } // Implements Comparable<GridMatch> + @Override public int compareTo(GridMatch o) { // Pick closest matches first if (distance != o.distance) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java index 45f3008..6a5ad23 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java @@ -727,6 +727,7 @@ public class GuidelineHandler { * </ul> */ private final class MatchComparator implements Comparator<Match> { + @Override public int compare(Match m1, Match m2) { // Always prefer matching parent bounds int parent1 = m1.edge.node == layout ? -1 : 1; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelinePainter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelinePainter.java index 7a6b07f..9c9ff78 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelinePainter.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelinePainter.java @@ -44,6 +44,7 @@ import java.util.Set; */ public final class GuidelinePainter implements IFeedbackPainter { // ---- Implements IFeedbackPainter ---- + @Override public void paint(IGraphics gc, INode node, DropFeedback feedback) { GuidelineHandler state = (GuidelineHandler) feedback.userData; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java index a761a0e..b8d381f 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java @@ -73,27 +73,33 @@ public class AttributeInfo implements IAttributeInfo { } /** Returns the XML Name of the attribute */ + @Override public String getName() { return mName; } /** Returns the formats of the attribute. Cannot be null. * Should have at least one format. */ + @Override public Format[] getFormats() { return mFormats; } /** Returns the values for enums. null for other types. */ + @Override public String[] getEnumValues() { return mEnumValues; } /** Returns the values for flags. null for other types. */ + @Override public String[] getFlagValues() { return mFlagValues; } /** Returns a short javadoc, .i.e. the first sentence. */ + @Override public String getJavaDoc() { return mJavaDoc; } /** Returns the documentation for deprecated attributes. Null if not deprecated. */ + @Override public String getDeprecatedDoc() { return mDeprecatedDoc; } @@ -138,6 +144,7 @@ public class AttributeInfo implements IAttributeInfo { * @return the name of the class (fully qualified class name) which defined * this attribute */ + @Override public String getDefinedBy() { return mDefinedBy; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index 6e6c798..8432663 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java @@ -211,6 +211,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { // changing the console properties update the ui, we need to make this change // in the ui thread. display.asyncExec(new Runnable() { + @Override public void run() { mAndroidConsoleErrorStream.setColor(mRed); } @@ -222,6 +223,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { // set the listener for the preference change eclipseStore.addPropertyChangeListener(new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { // load the new preferences AdtPrefs.getPrefs().loadValues(event); @@ -817,6 +819,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { // dialog box only run in ui thread.. display.asyncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); MessageDialog.openError(shell, title, message); @@ -836,6 +839,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { // dialog box only run in ui thread.. display.asyncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); MessageDialog.openWarning(shell, title, message); @@ -857,6 +861,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { // we need to ask the user what he wants to do. final boolean[] result = new boolean[1]; display.syncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); result[0] = MessageDialog.openQuestion(shell, title, message); @@ -1249,6 +1254,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { (List<ITargetChangeListener>)mTargetChangeListeners.clone(); final SubMonitor progress2 = progress; AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { for (ITargetChangeListener listener : listeners) { try { @@ -1378,6 +1384,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { * * @see IFileListener#fileChanged */ + @Override public void fileChanged(IFile file, IMarkerDelta[] markerDeltas, int kind) { if (AdtConstants.EXT_XML.equals(file.getFileExtension())) { // The resources files must have a file path similar to @@ -1524,6 +1531,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { (List<ITargetChangeListener>)mTargetChangeListeners.clone(); AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { for (ITargetChangeListener listener : listeners) { try { @@ -1546,6 +1554,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { (List<ITargetChangeListener>)mTargetChangeListeners.clone(); AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { for (ITargetChangeListener listener : listeners) { try { @@ -1640,6 +1649,7 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { // --------- ILogger methods ----------- + @Override public void error(Throwable t, String format, Object... args) { if (t != null) { log(t, format, args); @@ -1648,10 +1658,12 @@ public class AdtPlugin extends AbstractUIPlugin implements ILogger { } } + @Override public void printf(String format, Object... args) { log(IStatus.INFO, format, args); } + @Override public void warning(String format, Object... args) { log(IStatus.WARNING, format, args); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java index 677bc7f..b090a1a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java @@ -391,6 +391,7 @@ public class AdtUtils { */ public static IJavaProject[] getOpenAndroidProjects() { return BaseProjectHelper.getAndroidProjects(new IProjectFilter() { + @Override public boolean accept(IProject project) { return project.isAccessible(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/DebuggerConnector.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/DebuggerConnector.java index 06d3856..a6df152 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/DebuggerConnector.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/DebuggerConnector.java @@ -42,6 +42,7 @@ public class DebuggerConnector implements IDebuggerConnector { GlobalProjectMonitor.getMonitor().addProjectListener(mWorkspaceAppCache); } + @Override public boolean connectDebugger(String appName, int appPort, int selectedPort) { // search for an android project matching the process name IProject project = ProjectHelper.findAndroidProjectByAppName(appName); @@ -54,6 +55,7 @@ public class DebuggerConnector implements IDebuggerConnector { } /** {@inheritDoc} */ + @Override public boolean isWorkspaceApp(String appName) { return mWorkspaceAppCache.isWorkspaceApp(appName); } @@ -103,6 +105,7 @@ public class DebuggerConnector implements IDebuggerConnector { } /** {@inheritDoc} */ + @Override public void projectRenamed(IProject project, IPath from) { // when a project is renamed, ideally we should just update the current // known mapping of app name -> project name. However, the projectRenamed @@ -111,11 +114,13 @@ public class DebuggerConnector implements IDebuggerConnector { } /** {@inheritDoc} */ + @Override public void projectOpenedWithWorkspace(IProject project) { // don't do anything as the cache is lazily initialized } /** {@inheritDoc} */ + @Override public void projectOpened(IProject project) { // A newly opened project could contribute some Android application. // So we invalidate the set of apps that are known to be not in the workspace, as @@ -124,12 +129,14 @@ public class DebuggerConnector implements IDebuggerConnector { } /** {@inheritDoc} */ + @Override public void projectDeleted(IProject project) { // Deletion is effectively the same as closing projectClosed(project); } /** {@inheritDoc} */ + @Override public void projectClosed(IProject project) { // When a project is closed, remove all mappings contributed by the project. Map<String, String> updatedCache = new HashMap<String, String>(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/SourceRevealer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/SourceRevealer.java index 21c8052..0283b87 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/SourceRevealer.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/SourceRevealer.java @@ -41,6 +41,7 @@ import org.eclipse.ui.ide.IDE; * Note that this code is duplicated in the PDT plugin's SourceRevealer as well. */ public class SourceRevealer implements ISourceRevealer { + @Override public boolean reveal(String applicationName, String className, int line) { IProject project = ProjectHelper.findAndroidProjectByAppName(applicationName); if (project != null) { @@ -50,6 +51,7 @@ public class SourceRevealer implements ISourceRevealer { return false; } + @Override public boolean revealLine(String fileName, int lineNumber) { SearchEngine se = new SearchEngine(); SearchPattern searchPattern = SearchPattern.createPattern( @@ -72,6 +74,7 @@ public class SourceRevealer implements ISourceRevealer { return requestor.didMatch(); } + @Override public boolean revealMethod(String fqmn) { SearchEngine se = new SearchEngine(); SearchPattern searchPattern = SearchPattern.createPattern( diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/ToolsLocator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/ToolsLocator.java index 987acaf..ee9eea7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/ToolsLocator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/ToolsLocator.java @@ -24,14 +24,17 @@ import com.android.ide.eclipse.ddms.IToolsLocator; */ public class ToolsLocator implements IToolsLocator { + @Override public String getAdbLocation() { return AdtPlugin.getOsAbsoluteAdb(); } + @Override public String getHprofConvLocation() { return AdtPlugin.getOsAbsoluteHprofConv(); } + @Override public String getTraceViewLocation() { return AdtPlugin.getOsAbsoluteTraceview(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddCompatibilityJarAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddCompatibilityJarAction.java index 40ac271..370064e 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddCompatibilityJarAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddCompatibilityJarAction.java @@ -70,9 +70,11 @@ public class AddCompatibilityJarAction implements IObjectActionDelegate { /** * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } + @Override public void run(IAction action) { if (mSelection instanceof IStructuredSelection) { @@ -93,6 +95,7 @@ public class AddCompatibilityJarAction implements IObjectActionDelegate { } } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java index ad0548b..dd96078 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java @@ -35,14 +35,17 @@ import org.eclipse.ui.IWorkbenchWindowActionDelegate; */
public class AvdManagerAction implements IWorkbenchWindowActionDelegate, IObjectActionDelegate {
+ @Override
public void dispose() {
// nothing to dispose.
}
+ @Override
public void init(IWorkbenchWindow window) {
// no init
}
+ @Override
public void run(IAction action) {
final Sdk sdk = Sdk.getCurrent();
if (sdk != null) {
@@ -61,10 +64,12 @@ public class AvdManagerAction implements IWorkbenchWindowActionDelegate, IObject }
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
// nothing related to the current selection.
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
// nothing to do.
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java index 8a527d6..8322d86 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java @@ -58,10 +58,12 @@ public class DexDumpAction implements IObjectActionDelegate { private ISelection mSelection; + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { // pass } + @Override public void run(IAction action) { if (mSelection instanceof IStructuredSelection) { for (Iterator<?> it = ((IStructuredSelection)mSelection).iterator(); it.hasNext();) { @@ -79,6 +81,7 @@ public class DexDumpAction implements IObjectActionDelegate { } } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } @@ -178,6 +181,7 @@ public class DexDumpAction implements IObjectActionDelegate { final String dstPath = dstFile.getAbsolutePath(); AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(dstPath)); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/FixProjectAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/FixProjectAction.java index 8a2400b..c073022 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/FixProjectAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/FixProjectAction.java @@ -51,9 +51,11 @@ public class FixProjectAction implements IObjectActionDelegate { /** * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } + @Override public void run(IAction action) { if (mSelection instanceof IStructuredSelection) { @@ -74,6 +76,7 @@ public class FixProjectAction implements IObjectActionDelegate { } } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java index 9af4780..26a51d6 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java @@ -37,14 +37,17 @@ import org.eclipse.ui.IWorkbenchWindowActionDelegate; */
public class SdkManagerAction implements IWorkbenchWindowActionDelegate, IObjectActionDelegate {
+ @Override
public void dispose() {
// nothing to dispose.
}
+ @Override
public void init(IWorkbenchWindow window) {
// no init
}
+ @Override
public void run(IAction action) {
final Sdk sdk = Sdk.getCurrent();
if (sdk != null) {
@@ -58,6 +61,7 @@ public class SdkManagerAction implements IWorkbenchWindowActionDelegate, IObject SdkInvocationContext.IDE);
ISdkChangeListener listener = new ISdkChangeListener() {
+ @Override
public void onSdkLoaded() {
// Ignore initial load of the SDK.
}
@@ -69,6 +73,7 @@ public class SdkManagerAction implements IWorkbenchWindowActionDelegate, IObject * <p/>
* {@inheritDoc}
*/
+ @Override
public void preInstallHook() {
// TODO we need to unload as much of as SDK as possible. Otherwise
@@ -103,6 +108,7 @@ public class SdkManagerAction implements IWorkbenchWindowActionDelegate, IObject * <p/>
* {@inheritDoc}
*/
+ @Override
public void postInstallHook() {
}
@@ -111,6 +117,7 @@ public class SdkManagerAction implements IWorkbenchWindowActionDelegate, IObject * <p/>
* {@inheritDoc}
*/
+ @Override
public void onSdkReload() {
AdtPlugin.getDefault().reparseSdk();
}
@@ -124,10 +131,12 @@ public class SdkManagerAction implements IWorkbenchWindowActionDelegate, IObject }
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
// nothing related to the current selection.
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
// nothing to do.
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ChooseAssetTypePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ChooseAssetTypePage.java index a0b66fb..15b1f05 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ChooseAssetTypePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ChooseAssetTypePage.java @@ -69,6 +69,7 @@ public class ChooseAssetTypePage extends WizardPage implements SelectionListener * * @param parent the parent composite */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -123,6 +124,7 @@ public class ChooseAssetTypePage extends WizardPage implements SelectionListener updateAssetType(); validatePage(); parent.getDisplay().asyncExec(new Runnable() { + @Override public void run() { mNameText.setFocus(); } @@ -165,6 +167,7 @@ public class ChooseAssetTypePage extends WizardPage implements SelectionListener return mProject != null; } + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); if (source == mProjectButton) { @@ -187,9 +190,11 @@ public class ChooseAssetTypePage extends WizardPage implements SelectionListener } } + @Override public void widgetDefaultSelected(SelectionEvent e) { } + @Override public void modifyText(ModifyEvent e) { Object source = e.getSource(); if (source == mNameText) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java index f8fe262..3f479c4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java @@ -161,6 +161,7 @@ public class ConfigureAssetSetPage extends WizardPage implements SelectionListen * * @param parent the parent widget */ + @Override @SuppressWarnings("unused") // Don't warn about unassigned "new Label(.)": has side-effect public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -566,6 +567,7 @@ public class ConfigureAssetSetPage extends WizardPage implements SelectionListen // ---- Implements ModifyListener ---- + @Override public void modifyText(ModifyEvent e) { if (e.getSource() == mImagePathText) { requestUpdatePreview(false); @@ -578,10 +580,12 @@ public class ConfigureAssetSetPage extends WizardPage implements SelectionListen // ---- Implements SelectionListener ---- + @Override public void widgetDefaultSelected(SelectionEvent e) { // Nothing to do } + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); boolean updateQuickly = true; @@ -855,6 +859,7 @@ public class ConfigureAssetSetPage extends WizardPage implements SelectionListen mTimerPending = true; final Runnable timer = new Runnable() { + @Override public void run() { mTimerPending = false; updatePreview(); @@ -1037,6 +1042,7 @@ public class ConfigureAssetSetPage extends WizardPage implements SelectionListen } } + @Override public BufferedImage loadImageResource(String relativeName) { return getImage(relativeName, true); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/CreateAssetSetWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/CreateAssetSetWizard.java index b3d7348..f42960c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/CreateAssetSetWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/CreateAssetSetWizard.java @@ -17,9 +17,9 @@ package com.android.ide.eclipse.adt.internal.assetstudio; import com.android.ide.eclipse.adt.AdtConstants; import com.android.ide.eclipse.adt.AdtPlugin; +import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper; -import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.IProjectFilter; import com.android.ide.eclipse.adt.internal.wizards.newxmlfile.NewXmlFileWizard; import com.android.util.Pair; @@ -260,6 +260,7 @@ public class CreateAssetSetWizard extends Wizard implements INewWizard { return mChooseAssetPage.getAssetType(); } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { setHelpAvailable(false); @@ -314,12 +315,7 @@ public class CreateAssetSetWizard extends Wizard implements INewWizard { } } - IJavaProject[] projects = BaseProjectHelper.getAndroidProjects(new IProjectFilter() { - public boolean accept(IProject project) { - return project.isAccessible(); - } - }); - + IJavaProject[] projects = AdtUtils.getOpenAndroidProjects(); if (projects != null && projects.length == 1) { return projects[0].getProject(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java index c6928a9..425cb58 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java @@ -84,6 +84,7 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr // ---- Implements IMarkerResolution2 ---- + @Override public boolean hasResolutions(IMarker marker) { String message = null; try { @@ -97,6 +98,7 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr || message.contains(getUnboundErrorMessage())); } + @Override public IMarkerResolution[] getResolutions(IMarker marker) { IResource markerResource = marker.getResource(); IProject project = markerResource.getProject(); @@ -137,14 +139,17 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr // ---- Implements IQuickAssistProcessor ---- + @Override public boolean canAssist(IQuickAssistInvocationContext invocationContext) { return true; } + @Override public boolean canFix(Annotation annotation) { return true; } + @Override public ICompletionProposal[] computeQuickAssistProposals( IQuickAssistInvocationContext invocationContext) { @@ -195,6 +200,7 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr return null; } + @Override public String getErrorMessage() { return null; } @@ -258,26 +264,32 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr // ---- Implements ICompletionProposal ---- + @Override public void apply(IDocument document) { perform(document); } + @Override public String getAdditionalProposalInfo() { return "Adds an Android namespace declaratiopn to the root element."; } + @Override public IContextInformation getContextInformation() { return null; } + @Override public String getDisplayString() { return "Insert namespace binding"; } + @Override public Image getImage() { return AdtPlugin.getAndroidLogo(); } + @Override public Point getSelection(IDocument doc) { return null; } @@ -285,10 +297,12 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr // ---- Implements MarkerResolution2 ---- + @Override public String getLabel() { return getDisplayString(); } + @Override public void run(IMarker marker) { try { AdtPlugin.openFile(mFile, null); @@ -308,6 +322,7 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr } } + @Override public String getDescription() { return getAdditionalProposalInfo(); } @@ -357,41 +372,50 @@ public class AaptQuickFix implements IMarkerResolutionGenerator2, IQuickAssistPr // ---- Implements ICompletionProposal ---- + @Override public void apply(IDocument document) { perform(); } + @Override public String getAdditionalProposalInfo() { return "Creates an XML file entry for the given missing resource " + "and opens it in the editor."; } + @Override public IContextInformation getContextInformation() { return null; } + @Override public String getDisplayString() { return String.format("Create resource %1$s", mResource); } + @Override public Image getImage() { return AdtPlugin.getAndroidLogo(); } + @Override public Point getSelection(IDocument document) { return null; } // ---- Implements MarkerResolution2 ---- + @Override public String getLabel() { return getDisplayString(); } + @Override public void run(IMarker marker) { perform(); } + @Override public String getDescription() { return getAdditionalProposalInfo(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java index dad3c5c..b8e91c2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java @@ -26,18 +26,18 @@ import com.android.ide.eclipse.adt.internal.project.ProjectHelper; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.prefs.AndroidLocation.AndroidLocationException; import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkConstants; import com.android.sdklib.IAndroidTarget.IOptionalLibrary; +import com.android.sdklib.SdkConstants; import com.android.sdklib.build.ApkBuilder; +import com.android.sdklib.build.ApkBuilder.JarStatus; +import com.android.sdklib.build.ApkBuilder.SigningInfo; import com.android.sdklib.build.ApkCreationException; import com.android.sdklib.build.DuplicateFileException; import com.android.sdklib.build.IArchiveBuilder; import com.android.sdklib.build.SealedApkException; -import com.android.sdklib.build.ApkBuilder.JarStatus; -import com.android.sdklib.build.ApkBuilder.SigningInfo; import com.android.sdklib.internal.build.DebugKeyProvider; -import com.android.sdklib.internal.build.SignedJarBuilder; import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException; +import com.android.sdklib.internal.build.SignedJarBuilder; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; @@ -971,6 +971,7 @@ public class BuildHelper { ApkCreationException, SealedApkException, DuplicateFileException { final List<IPath> pathsToPackage = new ArrayList<IPath>(); root.accept(new IResourceProxyVisitor() { + @Override public boolean visit(IResourceProxy proxy) throws CoreException { if (proxy.getType() == IResource.FOLDER) { // If this folder isn't wanted, don't traverse into it. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchDialog.java index cc3f7bf..20bee5d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchDialog.java @@ -131,12 +131,14 @@ class ConvertSwitchDialog extends TitleAreaDialog implements SelectionListener { // ---- Implements SelectionListener ---- + @Override public void widgetSelected(SelectionEvent e) { if (e.getSource() == mLink) { showWebPage(); } } + @Override public void widgetDefaultSelected(SelectionEvent e) { } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java index c893faa..5a71edc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java @@ -52,10 +52,12 @@ public class ConvertSwitchQuickFixProcessor implements IQuickFixProcessor { public ConvertSwitchQuickFixProcessor() { } + @Override public boolean hasCorrections(ICompilationUnit cu, int problemId) { return problemId == IProblem.NonConstantExpression; } + @Override public IJavaCompletionProposal[] getCorrections(IInvocationContext context, IProblemLocation[] location) throws CoreException { if (location == null || location.length == 0) { @@ -181,33 +183,40 @@ public class ConvertSwitchQuickFixProcessor implements IQuickFixProcessor { mExpression = expression; } + @Override public void apply(IDocument document) { Shell shell = AdtPlugin.getDisplay().getActiveShell(); ConvertSwitchDialog dialog = new ConvertSwitchDialog(shell, mExpression); dialog.open(); } + @Override public Point getSelection(IDocument document) { return null; } + @Override public String getAdditionalProposalInfo() { return "As of ADT 14, resource fields cannot be used as switch cases. Invoke this " + "fix to get more information."; } + @Override public String getDisplayString() { return "Migrate Android Code"; } + @Override public Image getImage() { return AdtPlugin.getAndroidLogo(); } + @Override public IContextInformation getContextInformation() { return null; } + @Override public int getRelevance() { return 50; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java index fd13cb0..6f75665 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java @@ -122,6 +122,7 @@ public abstract class BaseBuilder extends IncrementalProjectBuilder { * Sent when an XML error is detected. * @see XmlErrorListener */ + @Override public void errorFound() { mXmlError = true; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/LibraryDeltaVisitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/LibraryDeltaVisitor.java index 8a4af0b..61fd383 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/LibraryDeltaVisitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/LibraryDeltaVisitor.java @@ -43,6 +43,7 @@ public class LibraryDeltaVisitor implements IResourceDeltaVisitor { return mLibChange; } + @Override public boolean visit(IResourceDelta delta) throws CoreException { // we are only going to look for changes in res/ // Since the delta visitor goes through the main diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java index 95cb528..5f39c99 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java @@ -135,6 +135,7 @@ public class PostCompilerBuilder extends BaseBuilder { * {@inheritDoc} * @throws CoreException */ + @Override public boolean visit(IResourceDelta delta) throws CoreException { // no need to keep looking if we already know we need to convert // to dex and make the final package. @@ -193,6 +194,7 @@ public class PostCompilerBuilder extends BaseBuilder { } private ResourceMarker mResourceMarker = new ResourceMarker() { + @Override public void setWarning(IResource resource, String message) { BaseProjectHelper.markResource(resource, AdtConstants.MARKER_PACKAGING, message, IMarker.SEVERITY_WARNING); @@ -812,6 +814,7 @@ public class PostCompilerBuilder extends BaseBuilder { } } + @Override public void addFile(File file, String archivePath) throws ApkCreationException, SealedApkException, DuplicateFileException { try { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerDeltaVisitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerDeltaVisitor.java index 7e426fd..abb072b 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerDeltaVisitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerDeltaVisitor.java @@ -135,6 +135,7 @@ public class PostCompilerDeltaVisitor extends BaseDeltaVisitor * @see org.eclipse.core.resources.IResourceDeltaVisitor * #visit(org.eclipse.core.resources.IResourceDelta) */ + @Override public boolean visit(IResourceDelta delta) throws CoreException { // if all flags are true, we can stop going through the resource delta. if (mConvertToDex && mPackageResources && mMakeFinalPackage) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java index e50e3eb..4a71e37 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java @@ -136,9 +136,11 @@ public class PreCompilerBuilder extends BaseBuilder { mDone = false; } + @Override public void beginTask(String name, int totalWork) { } + @Override public void done() { if (mDone == false) { mDone = true; @@ -171,23 +173,29 @@ public class PreCompilerBuilder extends BaseBuilder { } } + @Override public void internalWorked(double work) { } + @Override public boolean isCanceled() { return mCancelled; } + @Override public void setCanceled(boolean value) { mCancelled = value; } + @Override public void setTaskName(String name) { } + @Override public void subTask(String name) { } + @Override public void worked(int work) { } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerDeltaVisitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerDeltaVisitor.java index 5f08856..1c96924 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerDeltaVisitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerDeltaVisitor.java @@ -162,6 +162,7 @@ class PreCompilerDeltaVisitor extends BaseDeltaVisitor implements IResourceDelta * @see org.eclipse.core.resources.IResourceDeltaVisitor * #visit(org.eclipse.core.resources.IResourceDelta) */ + @Override public boolean visit(IResourceDelta delta) throws CoreException { // we are only going to look for changes in res/, source folders and in // AndroidManifest.xml since the delta visitor goes through the main diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java index 9b81090..2010e51 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java @@ -131,6 +131,7 @@ public abstract class AndroidContentAssist implements IContentAssistProcessor { * * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) */ + @Override public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { String wordPrefix = extractElementPrefix(viewer, offset); @@ -360,6 +361,7 @@ public abstract class AndroidContentAssist implements IContentAssistProcessor { System.arraycopy(elements, 0, copy, 0, elements.length); Arrays.sort(copy, new Comparator<ElementDescriptor>() { + @Override public int compare(ElementDescriptor e1, ElementDescriptor e2) { return e1.getXmlLocalName().compareTo(e2.getXmlLocalName()); } @@ -845,6 +847,7 @@ public abstract class AndroidContentAssist implements IContentAssistProcessor { return getRootDescriptor().findChildrenDescriptor(nodeName, true /* recursive */); } + @Override public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { return null; } @@ -858,18 +861,22 @@ public abstract class AndroidContentAssist implements IContentAssistProcessor { * @return the auto activation characters for completion proposal or <code>null</code> * if no auto activation is desired */ + @Override public char[] getCompletionProposalAutoActivationCharacters() { return new char[]{ '<', ':', '=' }; } + @Override public char[] getContextInformationAutoActivationCharacters() { return null; } + @Override public IContextInformationValidator getContextInformationValidator() { return null; } + @Override public String getErrorMessage() { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidSourceViewerConfig.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidSourceViewerConfig.java index 53789cd..e9801b2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidSourceViewerConfig.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidSourceViewerConfig.java @@ -169,6 +169,7 @@ public class AndroidSourceViewerConfig extends StructuredTextViewerConfiguration mDelegate = delegate; } + @Override public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { ICompletionProposal[] result = mDelegate.computeCompletionProposals(viewer, offset); if (result == null) { @@ -203,22 +204,27 @@ public class AndroidSourceViewerConfig extends StructuredTextViewerConfiguration } } + @Override public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { return mDelegate.computeContextInformation(viewer, offset); } + @Override public char[] getCompletionProposalAutoActivationCharacters() { return mDelegate.getCompletionProposalAutoActivationCharacters(); } + @Override public char[] getContextInformationAutoActivationCharacters() { return mDelegate.getContextInformationAutoActivationCharacters(); } + @Override public IContextInformationValidator getContextInformationValidator() { return mDelegate.getContextInformationValidator(); } + @Override public String getErrorMessage() { return mDelegate.getErrorMessage(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidTextEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidTextEditor.java index 2b11671..7150204 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidTextEditor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidTextEditor.java @@ -283,9 +283,11 @@ public abstract class AndroidTextEditor extends FormEditor implements IResourceC * Closes all project files on project close. * @see IResourceChangeListener */ + @Override public void resourceChanged(final IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_CLOSE) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { IWorkbenchPage[] pages = getSite().getWorkbenchWindow() .getPages(); @@ -502,10 +504,12 @@ public abstract class AndroidTextEditor extends FormEditor implements IResourceC mDocument = provider.getDocument(getEditorInput()); mDocument.addDocumentListener(new IDocumentListener() { + @Override public void documentChanged(DocumentEvent event) { onDocumentChanged(event); } + @Override public void documentAboutToBeChanged(DocumentEvent event) { // ignore } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java index 251083d..5cf46ea 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java @@ -74,6 +74,7 @@ import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList; @SuppressWarnings("restriction") // XML model public class AndroidXmlAutoEditStrategy implements IAutoEditStrategy { + @Override public void customizeDocumentCommand(IDocument document, DocumentCommand c) { if (!isSmartInsertMode()) { return; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java index 836fdb3..f8d53f4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java @@ -256,6 +256,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh if (result != null && adapter.equals(IGotoMarker.class) ) { final IGotoMarker gotoMarker = (IGotoMarker) result; return new IGotoMarker() { + @Override public void gotoMarker(IMarker marker) { gotoMarker.gotoMarker(marker); try { @@ -452,12 +453,14 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh * Closes all project files on project close. * @see IResourceChangeListener */ + @Override public void resourceChanged(final IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_CLOSE) { IFile file = getInputFile(); if (file != null && file.getProject().equals(event.getResource())) { final IEditorInput input = getEditorInput(); Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { // FIXME understand why this code is accessing the current window's pages, // if that's *this* instance, we have a local pages member from the super @@ -1493,6 +1496,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh * <p/> * This AndroidXmlEditor implementation of IModelChangedListener is empty. */ + @Override public void modelAboutToBeChanged(IStructuredModel model) { // pass } @@ -1504,6 +1508,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh * <p/> * This AndroidXmlEditor implementation calls the xmlModelChanged callback. */ + @Override public void modelChanged(IStructuredModel model) { if (mIgnoreXmlUpdate) { return; @@ -1518,6 +1523,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh * <p/> * This AndroidXmlEditor implementation of IModelChangedListener is empty. */ + @Override public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) { // pass } @@ -1530,6 +1536,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh * <p/> * This AndroidXmlEditor implementation of IModelChangedListener is empty. */ + @Override public void modelResourceDeleted(IStructuredModel model) { // pass } @@ -1541,6 +1548,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh * <p/> * This AndroidXmlEditor implementation of IModelChangedListener is empty. */ + @Override public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) { // pass } @@ -1548,6 +1556,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh /** * This AndroidXmlEditor implementation of IModelChangedListener is empty. */ + @Override public void modelAboutToBeReinitialized(IStructuredModel structuredModel) { // pass } @@ -1555,6 +1564,7 @@ public abstract class AndroidXmlEditor extends FormEditor implements IResourceCh /** * This AndroidXmlEditor implementation of IModelChangedListener is empty. */ + @Override public void modelReinitialized(IStructuredModel structuredModel) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimDescriptors.java index dabab87..cdfaa21 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimDescriptors.java @@ -37,6 +37,7 @@ public class AnimDescriptors implements IDescriptorProvider { private Map<String, ElementDescriptor> nameToDescriptor; /** @return the root descriptor. */ + @Override public ElementDescriptor getDescriptor() { if (mDescriptor == null) { mDescriptor = new ElementDescriptor("", getRootElementDescriptors()); //$NON-NLS-1$ @@ -45,6 +46,7 @@ public class AnimDescriptors implements IDescriptorProvider { return mDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mRootDescriptors; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimatorDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimatorDescriptors.java index 644aebb..d72ad66 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimatorDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimatorDescriptors.java @@ -41,6 +41,7 @@ public class AnimatorDescriptors implements IDescriptorProvider { private Map<String, ElementDescriptor> nameToDescriptor; /** @return the root descriptor. */ + @Override public ElementDescriptor getDescriptor() { if (mDescriptor == null) { mDescriptor = new ElementDescriptor("", getRootElementDescriptors()); //$NON-NLS-1$ @@ -49,6 +50,7 @@ public class AnimatorDescriptors implements IDescriptorProvider { return mDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mRootDescriptors; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/BinaryXMLDescriber.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/BinaryXMLDescriber.java index ba78565..cff2a6e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/BinaryXMLDescriber.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/BinaryXMLDescriber.java @@ -52,6 +52,7 @@ public class BinaryXMLDescriber implements IContentDescriber { * @see org.eclipse.core.runtime.content.IContentDescriber#describe(java.io. * InputStream, org.eclipse.core.runtime.content.IContentDescription) */ + @Override public int describe(InputStream contents, IContentDescription description) throws IOException { int status = INVALID; int length = 8; @@ -82,6 +83,7 @@ public class BinaryXMLDescriber implements IContentDescriber { * @see * org.eclipse.core.runtime.content.IContentDescriber#getSupportedOptions() */ + @Override public QualifiedName[] getSupportedOptions() { return new QualifiedName[0]; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/FileStorage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/FileStorage.java index 614ad0f..a8c9182 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/FileStorage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/FileStorage.java @@ -55,6 +55,7 @@ public class FileStorage implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#getContents() */ + @Override public InputStream getContents() throws CoreException { InputStream stream = null; try { @@ -69,6 +70,7 @@ public class FileStorage implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#getFullPath() */ + @Override public IPath getFullPath() { return new Path(mFile.getAbsolutePath()); } @@ -76,6 +78,7 @@ public class FileStorage implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#getName() */ + @Override public String getName() { return mFile.getName(); } @@ -83,6 +86,7 @@ public class FileStorage implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#isReadOnly() */ + @Override public boolean isReadOnly() { return true; } @@ -90,6 +94,7 @@ public class FileStorage implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) */ + @Override public Object getAdapter(Class adapter) { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/XmlStorageEditorInput.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/XmlStorageEditorInput.java index d1e821e..646c675 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/XmlStorageEditorInput.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/binaryxml/XmlStorageEditorInput.java @@ -19,7 +19,6 @@ package com.android.ide.eclipse.adt.internal.editors.binaryxml; import org.eclipse.core.resources.IStorage; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; import org.eclipse.ui.IStorageEditorInput; @@ -45,6 +44,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see IStorageEditorInput#getStorage() */ + @Override public IStorage getStorage() throws CoreException { return mStorage; } @@ -52,6 +52,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see IInput#getStorage() */ + @Override public boolean exists() { return mStorage != null; } @@ -59,6 +60,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see IEditorInput#getImageDescriptor() */ + @Override public ImageDescriptor getImageDescriptor() { return null; } @@ -66,6 +68,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see IEditorInput#getName() */ + @Override public String getName() { return mStorage.getName(); } @@ -73,6 +76,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see IEditorInput#getPersistable() */ + @Override public IPersistableElement getPersistable() { return null; } @@ -80,6 +84,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see IEditorInput#getToolTipText() */ + @Override public String getToolTipText() { return mStorage.getFullPath() != null ? mStorage.getFullPath().toString() : mStorage .getName(); @@ -88,6 +93,7 @@ public class XmlStorageEditorInput implements IStorageEditorInput { /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) */ + @Override public Object getAdapter(Class adapter) { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorDescriptors.java index 4147fdd..9afeb88 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorDescriptors.java @@ -50,6 +50,7 @@ public class ColorDescriptors implements IDescriptorProvider { null /*children: added later*/, true /*mandatory*/); /** @return the root descriptor. */ + @Override public ElementDescriptor getDescriptor() { if (mDescriptor == null) { mDescriptor = new ElementDescriptor("", getRootElementDescriptors()); //$NON-NLS-1$ @@ -58,6 +59,7 @@ public class ColorDescriptors implements IDescriptorProvider { return mDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return new ElementDescriptor[] { mDescriptor }; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptor.java index 3e4c6d0..b29e168 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptor.java @@ -114,6 +114,7 @@ public abstract class AttributeDescriptor implements Comparable<AttributeDescrip public abstract UiAttributeNode createUiNode(UiElementNode uiParent); // Implements Comparable<AttributeDescriptor> + @Override public int compareTo(AttributeDescriptor other) { return mXmlLocalName.compareTo(other.mXmlLocalName); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptorLabelProvider.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptorLabelProvider.java index da03441..32def64 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptorLabelProvider.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/AttributeDescriptorLabelProvider.java @@ -27,14 +27,15 @@ import org.eclipse.swt.graphics.Image; * Label provider for {@link UiAbstractTextAttributeNode}. */ public class AttributeDescriptorLabelProvider implements ILabelProvider { - + private final static AttributeDescriptorLabelProvider sThis = new AttributeDescriptorLabelProvider(); - + public static ILabelProvider getProvider() { return sThis; } + @Override public Image getImage(Object element) { if (element instanceof UiAbstractTextAttributeNode) { UiAbstractTextAttributeNode node = (UiAbstractTextAttributeNode) element; @@ -43,13 +44,14 @@ public class AttributeDescriptorLabelProvider implements ILabelProvider { if (v != null && v.length() > 0) { IconFactory factory = IconFactory.getInstance(); return factory.getIcon("warning"); //$NON-NLS-1$ - } + } } } return null; } + @Override public String getText(Object element) { if (element instanceof UiAbstractTextAttributeNode) { return ((UiAbstractTextAttributeNode)element).getCurrentValue(); @@ -58,21 +60,25 @@ public class AttributeDescriptorLabelProvider implements ILabelProvider { return null; } + @Override public void addListener(ILabelProviderListener listener) { // TODO Auto-generated method stub } + @Override public void dispose() { // TODO Auto-generated method stub } + @Override public boolean isLabelProperty(Object element, String property) { // TODO Auto-generated method stub return false; } + @Override public void removeListener(ILabelProviderListener listener) { // TODO Auto-generated method stub diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ElementDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ElementDescriptor.java index 7572120..86afdbc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ElementDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ElementDescriptor.java @@ -465,6 +465,7 @@ public class ElementDescriptor implements Comparable<ElementDescriptor> { } // Implements Comparable<ElementDescriptor>: + @Override public int compareTo(ElementDescriptor o) { return mUiName.compareToIgnoreCase(o.mUiName); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ListAttributeDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ListAttributeDescriptor.java index 721d8cb..63dee0d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ListAttributeDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ListAttributeDescriptor.java @@ -37,6 +37,7 @@ public class ListAttributeDescriptor extends TextAttributeDescriptor { * Used by {@link DescriptorsUtils} to create instances of this descriptor. */ public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { + @Override public TextAttributeDescriptor create(String xmlLocalName, String uiName, String nsUri, String tooltip, IAttributeInfo attrInfo) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ReferenceAttributeDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ReferenceAttributeDescriptor.java index f619450..347a284 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ReferenceAttributeDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/ReferenceAttributeDescriptor.java @@ -45,6 +45,7 @@ public final class ReferenceAttributeDescriptor extends TextAttributeDescriptor * Used by {@link DescriptorsUtils} to create instances of this descriptor. */ public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { + @Override public TextAttributeDescriptor create(String xmlLocalName, String uiName, String nsUri, String tooltip, IAttributeInfo attrInfo) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/TextAttributeDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/TextAttributeDescriptor.java index 2408954..88b474b 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/TextAttributeDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/TextAttributeDescriptor.java @@ -98,10 +98,12 @@ public class TextAttributeDescriptor extends AttributeDescriptor implements IPro // ------- IPropertyDescriptor Methods + @Override public CellEditor createPropertyEditor(Composite parent) { return new TextValueCellEditor(parent); } + @Override public String getCategory() { if (isDeprecated()) { return DEPRECATED_CATEGORY; @@ -115,30 +117,37 @@ public class TextAttributeDescriptor extends AttributeDescriptor implements IPro return null; } + @Override public String getDescription() { return mTooltip; } + @Override public String getDisplayName() { return mUiName; } + @Override public String[] getFilterFlags() { return null; } + @Override public Object getHelpContextIds() { return null; } + @Override public Object getId() { return this; } + @Override public ILabelProvider getLabelProvider() { return AttributeDescriptorLabelProvider.getProvider(); } + @Override public boolean isCompatibleWith(IPropertyDescriptor anotherProperty) { return anotherProperty == this; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableDescriptors.java index 1e71795..acb0cd5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableDescriptors.java @@ -47,6 +47,7 @@ public class DrawableDescriptors implements IDescriptorProvider { private Map<String, ElementDescriptor> nameToDescriptor; /** @return the root descriptor. */ + @Override public ElementDescriptor getDescriptor() { if (mDescriptor == null) { mDescriptor = new ElementDescriptor("", getRootElementDescriptors()); //$NON-NLS-1$ @@ -55,6 +56,7 @@ public class DrawableDescriptors implements IDescriptorProvider { return mDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mRootDescriptors; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java index 434c217..6ed1cf2 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java @@ -79,6 +79,7 @@ abstract class AbstractPropertiesFieldsPart extends ManifestSectionPart { */ protected void addModifyListenerToFields() { ModifyListener markDirtyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // Mark the part as dirty if a field has been changed. // This will force a commit() operation to store the data in the model. @@ -126,6 +127,7 @@ abstract class AbstractPropertiesFieldsPart extends ManifestSectionPart { if (isDirty()) { mEditor.wrapRewriteSession(new Runnable() { + @Override public void run() { saveFieldsToModel(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/ExportLinksPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/ExportLinksPart.java index d772897..85a2165 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/ExportLinksPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/ExportLinksPart.java @@ -77,14 +77,17 @@ final class ExportLinksPart extends ManifestSectionPart { mFormText.addHyperlinkListener(editor.createHyperlinkListener()); mFormText.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkExited(HyperlinkEvent e) { // pass } + @Override public void linkEntered(HyperlinkEvent e) { // pass } + @Override public void linkActivated(HyperlinkEvent e) { String link = e.data.toString(); if ("action_dosomething".equals(link)) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormatter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormatter.java index 2847b35..4030954 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormatter.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormatter.java @@ -35,6 +35,7 @@ import org.eclipse.wst.xml.core.text.IXMLPartitions; * off {@link AdtPrefs#getUseCustomXmlFormatter()} */ public class AndroidXmlFormatter implements IContentFormatter, IContentFormatterExtension { + @Override public final void format(IDocument document, IRegion region) { /** * This method is probably not going to be called. It is part of the @@ -51,10 +52,12 @@ public class AndroidXmlFormatter implements IContentFormatter, IContentFormatter format(document, context); } + @Override public IFormattingStrategy getFormattingStrategy(String contentType) { return new AndroidXmlFormattingStrategy(); } + @Override public void format(IDocument document, IFormattingContext context) { context.setProperty(FormattingContextProperties.CONTEXT_MEDIUM, document); formatMaster(context, document, 0, document.getLength()); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlQuickAssistManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlQuickAssistManager.java index 659bfe1..a979a80 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlQuickAssistManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlQuickAssistManager.java @@ -51,10 +51,12 @@ public class XmlQuickAssistManager implements IQuickAssistProcessor { }; } + @Override public String getErrorMessage() { return null; } + @Override public boolean canFix(Annotation annotation) { for (IQuickAssistProcessor processor : mProcessors) { if (processor.canFix(annotation)) { @@ -65,6 +67,7 @@ public class XmlQuickAssistManager implements IQuickAssistProcessor { return false; } + @Override public boolean canAssist(IQuickAssistInvocationContext invocationContext) { for (IQuickAssistProcessor processor : mProcessors) { if (processor.canAssist(invocationContext)) { @@ -75,6 +78,7 @@ public class XmlQuickAssistManager implements IQuickAssistProcessor { return false; } + @Override public ICompletionProposal[] computeQuickAssistProposals( IQuickAssistInvocationContext invocationContext) { List<ICompletionProposal> allProposals = null; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/BasePullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/BasePullParser.java index 387fed3..43fb1a5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/BasePullParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/BasePullParser.java @@ -44,6 +44,7 @@ public abstract class BasePullParser implements ILegacyPullParser { // --- basic implementation of IXmlPullParser --- + @Override public void setFeature(String name, boolean state) throws XmlPullParserException { if (FEATURE_PROCESS_NAMESPACES.equals(name) && state) { return; @@ -54,6 +55,7 @@ public abstract class BasePullParser implements ILegacyPullParser { throw new XmlPullParserException("Unsupported feature: " + name); } + @Override public boolean getFeature(String name) { if (FEATURE_PROCESS_NAMESPACES.equals(name)) { return true; @@ -64,80 +66,99 @@ public abstract class BasePullParser implements ILegacyPullParser { return false; } + @Override public void setProperty(String name, Object value) throws XmlPullParserException { throw new XmlPullParserException("setProperty() not supported"); } + @Override public Object getProperty(String name) { return null; } + @Override public void setInput(Reader in) throws XmlPullParserException { throw new XmlPullParserException("setInput() not supported"); } + @Override public void setInput(InputStream inputStream, String inputEncoding) throws XmlPullParserException { throw new XmlPullParserException("setInput() not supported"); } + @Override public void defineEntityReplacementText(String entityName, String replacementText) throws XmlPullParserException { throw new XmlPullParserException("defineEntityReplacementText() not supported"); } + @Override public String getNamespacePrefix(int pos) throws XmlPullParserException { throw new XmlPullParserException("getNamespacePrefix() not supported"); } + @Override public String getInputEncoding() { return null; } + @Override public String getNamespace(String prefix) { throw new RuntimeException("getNamespace() not supported"); } + @Override public int getNamespaceCount(int depth) throws XmlPullParserException { throw new XmlPullParserException("getNamespaceCount() not supported"); } + @Override public String getNamespaceUri(int pos) throws XmlPullParserException { throw new XmlPullParserException("getNamespaceUri() not supported"); } + @Override public int getColumnNumber() { return -1; } + @Override public int getLineNumber() { return -1; } + @Override public String getAttributeType(int arg0) { return "CDATA"; } + @Override public int getEventType() { return mParsingState; } + @Override public String getText() { return null; } + @Override public char[] getTextCharacters(int[] arg0) { return null; } + @Override public boolean isAttributeDefault(int arg0) { return false; } + @Override public boolean isWhitespace() { return false; } + @Override public int next() throws XmlPullParserException { switch (mParsingState) { case END_DOCUMENT: @@ -177,6 +198,7 @@ public abstract class BasePullParser implements ILegacyPullParser { return mParsingState; } + @Override public int nextTag() throws XmlPullParserException { int eventType = next(); if (eventType != START_TAG && eventType != END_TAG) { @@ -185,6 +207,7 @@ public abstract class BasePullParser implements ILegacyPullParser { return eventType; } + @Override public String nextText() throws XmlPullParserException { if (getEventType() != START_TAG) { throw new XmlPullParserException("parser must be on START_TAG to read next text", this, @@ -207,10 +230,12 @@ public abstract class BasePullParser implements ILegacyPullParser { } } + @Override public int nextToken() throws XmlPullParserException { return next(); } + @Override public void require(int type, String namespace, String name) throws XmlPullParserException { if (type != getEventType() || (namespace != null && !namespace.equals(getNamespace())) || (name != null && !name.equals(getName()))) diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java index bd1ac81..0befe8a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java @@ -63,6 +63,7 @@ public class ContextPullParser extends KXmlParser implements ILayoutPullParser { // --- Layout lib API methods + @Override /** * this is deprecated but must still be implemented for older layout libraries. * @deprecated use {@link IProjectCallback#getParser(String)}. @@ -72,6 +73,7 @@ public class ContextPullParser extends KXmlParser implements ILayoutPullParser { return mProjectCallback.getParser(layoutName); } + @Override public Object getViewCookie() { return null; // never any key to return } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditor.java index 45496df..c87bb84 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditor.java @@ -264,6 +264,7 @@ public class LayoutEditor extends AndroidXmlEditor implements IShowEditorInput, * <p/>This is used when {@link MatchingStrategy} returned <code>true</code> which means we're * opening a different configuration of the same layout. */ + @Override public void showEditorInput(IEditorInput editorInput) { if (getEditorInput().equals(editorInput)) { return; @@ -405,6 +406,7 @@ public class LayoutEditor extends AndroidXmlEditor implements IShowEditorInput, // ----- IPartListener Methods ---- + @Override public void partActivated(IWorkbenchPart part) { if (part == this) { if (mGraphicalEditor != null) { @@ -417,14 +419,17 @@ public class LayoutEditor extends AndroidXmlEditor implements IShowEditorInput, } } + @Override public void partBroughtToTop(IWorkbenchPart part) { partActivated(part); } + @Override public void partClosed(IWorkbenchPart part) { // pass } + @Override public void partDeactivated(IWorkbenchPart part) { if (part == this) { if (mGraphicalEditor != null && getActivePage() == mGraphicalEditorIndex) { @@ -433,6 +438,7 @@ public class LayoutEditor extends AndroidXmlEditor implements IShowEditorInput, } } + @Override public void partOpened(IWorkbenchPart part) { /* * We used to automatically bring the outline and the property sheet to view @@ -489,6 +495,7 @@ public class LayoutEditor extends AndroidXmlEditor implements IShowEditorInput, mUiRootNode.setUnknownDescriptorProvider(new IUnknownDescriptorProvider() { + @Override public ElementDescriptor getDescriptor(String xmlLocalName) { ElementDescriptor desc = mUnknownDescriptorMap.get(xmlLocalName); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java index abc389f..1ee497e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java @@ -21,9 +21,9 @@ import com.android.ide.common.resources.ResourceFolder; import com.android.ide.eclipse.adt.AdtConstants; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor; -import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager; import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor.IFileListener; import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor.IResourceEventListener; +import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager; import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager.IResourceListener; import com.android.ide.eclipse.adt.internal.sdk.ProjectState; import com.android.ide.eclipse.adt.internal.sdk.Sdk; @@ -42,8 +42,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; /** * Monitor for file changes that could trigger a layout redraw, or a UI update @@ -171,6 +171,7 @@ public final class LayoutReloadMonitor { * Callback for IFileListener. Called when a file changed. * This records the changes for each project, but does not notify listeners. */ + @Override public void fileChanged(IFile file, IMarkerDelta[] markerDeltas, int kind) { // get the file's project IProject project = file.getProject(); @@ -264,6 +265,7 @@ public final class LayoutReloadMonitor { * called several times. * */ + @Override public void resourceChangeEventStart() { // nothing to be done here, it all happens in the resourceChangeEventEnd } @@ -272,6 +274,7 @@ public final class LayoutReloadMonitor { * Callback for ResourceMonitor.IResourceEventListener. Called at the end of a resource * change event. This is where we notify the listeners. */ + @Override public void resourceChangeEventEnd() { // for each IProject that was changed, we notify all the listeners. for (Entry<IProject, ChangeFlags> entry : mProjectFlags.entrySet()) { @@ -327,6 +330,7 @@ public final class LayoutReloadMonitor { */ private IResourceListener mResourceListener = new IResourceListener() { + @Override public void folderChanged(IProject project, ResourceFolder folder, int eventType) { // if this project has already been marked as modified, we do nothing. ChangeFlags changeFlags = mProjectFlags.get(project); @@ -344,6 +348,7 @@ public final class LayoutReloadMonitor { changeFlags.localeList = true; } + @Override public void fileChanged(IProject project, ResourceFile file, int eventType) { // if this project has already been marked as modified, we do nothing. ChangeFlags changeFlags = mProjectFlags.get(project); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/MatchingStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/MatchingStrategy.java index 4ef249d..c91d60f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/MatchingStrategy.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/MatchingStrategy.java @@ -33,6 +33,7 @@ import org.eclipse.ui.part.FileEditorInput; */ public class MatchingStrategy implements IEditorMatchingStrategy { + @Override public boolean matches(IEditorReference editorRef, IEditorInput input) { // first check that the file being opened is a layout file. if (input instanceof FileEditorInput) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java index fec6162..d27f3d8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java @@ -131,6 +131,7 @@ public final class ProjectCallback extends LegacyCallback { * This implementation goes through the output directory of the Eclipse project and loads the * <code>.class</code> file directly. */ + @Override @SuppressWarnings("unchecked") public Object loadView(String className, Class[] constructorSignature, Object[] constructorParameters) @@ -254,6 +255,7 @@ public final class ProjectCallback extends LegacyCallback { * * @return The package namespace of the project or null in case of error. */ + @Override public String getNamespace() { if (mNamespace == null) { ManifestData manifestData = AndroidManifestHelper.parseForData(mProject); @@ -266,6 +268,7 @@ public final class ProjectCallback extends LegacyCallback { return mNamespace; } + @Override public Pair<ResourceType, String> resolveResourceId(int id) { if (mProjectRes != null) { return mProjectRes.resolveResourceId(id); @@ -274,6 +277,7 @@ public final class ProjectCallback extends LegacyCallback { return null; } + @Override public String resolveResourceId(int[] id) { if (mProjectRes != null) { return mProjectRes.resolveStyleable(id); @@ -282,6 +286,7 @@ public final class ProjectCallback extends LegacyCallback { return null; } + @Override public Integer getResourceId(ResourceType type, String name) { if (mProjectRes != null) { return mProjectRes.getResourceId(type, name); @@ -402,6 +407,7 @@ public final class ProjectCallback extends LegacyCallback { mLayoutEmbeddedParser = layoutParser; } + @Override public ILayoutPullParser getParser(String layoutName) { // Try to compute the ResourceValue for this layout since layoutlib // must be an older version which doesn't pass the value: @@ -416,6 +422,7 @@ public final class ProjectCallback extends LegacyCallback { return getParser(layoutName, null); } + @Override public ILayoutPullParser getParser(ResourceValue layoutResource) { return getParser(layoutResource.getName(), new File(layoutResource.getValue())); @@ -450,6 +457,7 @@ public final class ProjectCallback extends LegacyCallback { return null; } + @Override public Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie, ResourceReference itemRef, int fullPosition, int typePosition, int fullChildPosition, int typeChildPosition, @@ -542,8 +550,9 @@ public final class ProjectCallback extends LegacyCallback { return false; } - public AdapterBinding getAdapterBinding(ResourceReference adapterView, Object adapterCookie, - Object viewObject) { + @Override + public AdapterBinding getAdapterBinding(final ResourceReference adapterView, final Object adapterCookie, + final Object viewObject) { // Look for user-recorded preference for layout to be used for previews if (adapterCookie instanceof UiViewElementNode) { UiViewElementNode uiNode = (UiViewElementNode) adapterCookie; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java index a9126b7..f57d904 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java @@ -192,6 +192,7 @@ public class UiElementPullParser extends BasePullParser { * - private method GraphicalLayoutEditor#updateNodeWithBounds(ILayoutViewInfo). * - private constructor of LayoutCanvas.CanvasViewInfo. */ + @Override public Object getViewCookie() { return getCurrentNode(); } @@ -199,6 +200,7 @@ public class UiElementPullParser extends BasePullParser { /** * Legacy method required by {@link com.android.layoutlib.api.IXmlPullParser} */ + @Override public Object getViewKey() { return getViewCookie(); } @@ -207,12 +209,14 @@ public class UiElementPullParser extends BasePullParser { * This implementation does nothing for now as all the embedded XML will use a normal KXML * parser. */ + @Override public ILayoutPullParser getParser(String layoutName) { return null; } // ------------- XmlPullParser -------- + @Override public String getPositionDescription() { return "XML DOM element depth:" + mNodeStack.size(); } @@ -221,6 +225,7 @@ public class UiElementPullParser extends BasePullParser { * This does not seem to be called by the layoutlib, but we keep this (and maintain * it) just in case. */ + @Override public int getAttributeCount() { UiElementNode node = getCurrentNode(); @@ -238,6 +243,7 @@ public class UiElementPullParser extends BasePullParser { * This does not seem to be called by the layoutlib, but we keep this (and maintain * it) just in case. */ + @Override public String getAttributeName(int i) { if (mZeroAttributeIsPadding) { if (i == 0) { @@ -259,6 +265,7 @@ public class UiElementPullParser extends BasePullParser { * This does not seem to be called by the layoutlib, but we keep this (and maintain * it) just in case. */ + @Override public String getAttributeNamespace(int i) { if (mZeroAttributeIsPadding) { if (i == 0) { @@ -279,6 +286,7 @@ public class UiElementPullParser extends BasePullParser { * This does not seem to be called by the layoutlib, but we keep this (and maintain * it) just in case. */ + @Override public String getAttributePrefix(int i) { if (mZeroAttributeIsPadding) { if (i == 0) { @@ -301,6 +309,7 @@ public class UiElementPullParser extends BasePullParser { * This does not seem to be called by the layoutlib, but we keep this (and maintain * it) just in case. */ + @Override public String getAttributeValue(int i) { if (mZeroAttributeIsPadding) { if (i == 0) { @@ -327,6 +336,7 @@ public class UiElementPullParser extends BasePullParser { /* * This is the main method used by the LayoutInflater to query for attributes. */ + @Override public String getAttributeValue(String namespace, String localName) { if (mExplodeNodes != null && ATTR_PADDING.equals(localName) && SdkConstants.NS_RESOURCES.equals(namespace)) { @@ -380,10 +390,12 @@ public class UiElementPullParser extends BasePullParser { return null; } + @Override public int getDepth() { return mNodeStack.size(); } + @Override public String getName() { if (mParsingState == START_TAG || mParsingState == END_TAG) { String name = getCurrentNode().getDescriptor().getXmlLocalName(); @@ -404,6 +416,7 @@ public class UiElementPullParser extends BasePullParser { return null; } + @Override public String getNamespace() { if (mParsingState == START_TAG || mParsingState == END_TAG) { return getCurrentNode().getDescriptor().getNamespace(); @@ -412,6 +425,7 @@ public class UiElementPullParser extends BasePullParser { return null; } + @Override public String getPrefix() { if (mParsingState == START_TAG || mParsingState == END_TAG) { Document doc = mRoot.getXmlDocument(); @@ -421,6 +435,7 @@ public class UiElementPullParser extends BasePullParser { return null; } + @Override public boolean isEmptyElementTag() throws XmlPullParserException { if (mParsingState == START_TAG) { return getCurrentNode().getUiChildren().size() == 0; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/WidgetPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/WidgetPullParser.java index 07e6a91..0b09f79 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/WidgetPullParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/WidgetPullParser.java @@ -19,6 +19,7 @@ package com.android.ide.eclipse.adt.internal.editors.layout; import com.android.ide.common.rendering.api.ILayoutPullParser; import com.android.ide.eclipse.adt.AdtConstants; import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor; +import com.android.layoutlib.api.ILayoutResult.ILayoutViewInfo; import com.android.sdklib.SdkConstants; import org.xmlpull.v1.XmlPullParserException; @@ -47,6 +48,7 @@ public class WidgetPullParser extends BasePullParser { mAttributes[0][1] = segments[segments.length-1]; } + @Override public Object getViewCookie() { // we need a viewKey or the ILayoutResult will not contain any ILayoutViewInfo return mDescriptor; @@ -55,19 +57,23 @@ public class WidgetPullParser extends BasePullParser { /** * Legacy method required by {@link com.android.layoutlib.api.IXmlPullParser} */ + @Override public Object getViewKey() { return getViewCookie(); } + @Override public ILayoutPullParser getParser(String layoutName) { // there's no embedded layout for a single widget. return null; } + @Override public int getAttributeCount() { return mAttributes.length; // text attribute } + @Override public String getAttributeName(int index) { if (index < mAttributes.length) { return mAttributes[index][0]; @@ -76,15 +82,18 @@ public class WidgetPullParser extends BasePullParser { return null; } + @Override public String getAttributeNamespace(int index) { return SdkConstants.NS_RESOURCES; } + @Override public String getAttributePrefix(int index) { // pass return null; } + @Override public String getAttributeValue(int index) { if (index < mAttributes.length) { return mAttributes[index][1]; @@ -93,6 +102,7 @@ public class WidgetPullParser extends BasePullParser { return null; } + @Override public String getAttributeValue(String ns, String name) { if (SdkConstants.NS_RESOURCES.equals(ns)) { for (String[] attribute : mAttributes) { @@ -105,30 +115,36 @@ public class WidgetPullParser extends BasePullParser { return null; } + @Override public int getDepth() { // pass return 0; } + @Override public String getName() { return mDescriptor.getXmlLocalName(); } + @Override public String getNamespace() { // pass return null; } + @Override public String getPositionDescription() { // pass return null; } + @Override public String getPrefix() { // pass return null; } + @Override public boolean isEmptyElementTag() throws XmlPullParserException { if (mParsingState == START_TAG) { return true; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigEditDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigEditDialog.java index eba18e7..bd45400 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigEditDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigEditDialog.java @@ -152,6 +152,7 @@ public class ConfigEditDialog extends GridDialog { deviceNameText.setText(mDeviceName); } deviceNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mDeviceName = deviceNameText.getText().trim(); validateOk(); @@ -160,6 +161,7 @@ public class ConfigEditDialog extends GridDialog { VerifyListener floatVerifier = new VerifyListener() { + @Override public void verifyText(VerifyEvent event) { // combine the current content and the new text String text = ((Text)event.widget).getText(); @@ -180,6 +182,7 @@ public class ConfigEditDialog extends GridDialog { } deviceXDpiText.addVerifyListener(floatVerifier); deviceXDpiText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String value = deviceXDpiText.getText(); if (value.length() == 0) { @@ -204,6 +207,7 @@ public class ConfigEditDialog extends GridDialog { } deviceYDpiText.addVerifyListener(floatVerifier); deviceYDpiText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String value = deviceYDpiText.getText(); if (value.length() == 0) { @@ -232,6 +236,7 @@ public class ConfigEditDialog extends GridDialog { configNameText.setText(mConfigName); } configNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mConfigName = configNameText.getText().trim(); validateOk(); @@ -243,6 +248,7 @@ public class ConfigEditDialog extends GridDialog { // since those are selected from a different combo // FIXME: add version combo. mConfigSelector.setQualifierFilter(new IQualifierFilter() { + @Override public boolean accept(ResourceQualifier qualifier) { if (qualifier instanceof LanguageQualifier || qualifier instanceof RegionQualifier || @@ -265,6 +271,7 @@ public class ConfigEditDialog extends GridDialog { // add a listener to check on the validity of the FolderConfiguration as // they are built. mConfigSelector.setOnChangeListener(new Runnable() { + @Override public void run() { if (mConfigSelector.getState() == ConfigurationState.OK) { mConfigSelector.getConfiguration(mConfig); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigManagerDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigManagerDialog.java index 9812c2a..2adefa7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigManagerDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigManagerDialog.java @@ -20,9 +20,9 @@ import com.android.ddmuilib.TableHelper; import com.android.ide.common.resources.configuration.FolderConfiguration; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.sdk.LayoutDevice; +import com.android.ide.eclipse.adt.internal.sdk.LayoutDevice.DeviceConfig; import com.android.ide.eclipse.adt.internal.sdk.LayoutDeviceManager; import com.android.ide.eclipse.adt.internal.sdk.Sdk; -import com.android.ide.eclipse.adt.internal.sdk.LayoutDevice.DeviceConfig; import com.android.sdkuilib.ui.GridDialog; import org.eclipse.jface.dialogs.IDialogConstants; @@ -118,10 +118,12 @@ public class ConfigManagerDialog extends GridDialog { public DeviceContentProvider() { } + @Override public Object[] getElements(Object inputElement) { return sCategory; } + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof DeviceType) { if (DeviceType.DEFAULT.equals(parentElement)) { @@ -139,11 +141,13 @@ public class ConfigManagerDialog extends GridDialog { return null; } + @Override public Object getParent(Object element) { // parent cannot be computed. this is fine. return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof DeviceType) { if (DeviceType.DEFAULT.equals(element)) { @@ -162,10 +166,12 @@ public class ConfigManagerDialog extends GridDialog { } + @Override public void dispose() { // nothing to dispose } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput instanceof LayoutDeviceManager) { mLayoutDeviceManager = (LayoutDeviceManager)newInput; @@ -187,6 +193,7 @@ public class ConfigManagerDialog extends GridDialog { */ private final static class DeviceLabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof DeviceType) { if (columnIndex == 0) { @@ -206,23 +213,28 @@ public class ConfigManagerDialog extends GridDialog { return null; } + @Override public Image getColumnImage(Object element, int columnIndex) { // no image return null; } + @Override public void addListener(ILabelProviderListener listener) { // no listener } + @Override public void removeListener(ILabelProviderListener listener) { // no listener } + @Override public void dispose() { // nothing to dispose } + @Override public boolean isLabelProperty(Object element, String property) { return false; } @@ -265,6 +277,7 @@ public class ConfigManagerDialog extends GridDialog { mTreeViewer.setLabelProvider(new DeviceLabelProvider()); mTreeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS); mTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { setEnabled(getSelection()); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java index 5dc0fd3..2cdcbe5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java @@ -998,6 +998,7 @@ public class ConfigurationComposite extends Composite { * Note: this comparator imposes orderings that are inconsistent with equals. */ private static class TabletConfigComparator implements Comparator<ConfigMatch> { + @Override public int compare(ConfigMatch o1, ConfigMatch o2) { ScreenSize ss1 = o1.testConfig.getScreenSizeQualifier().getValue(); ScreenSize ss2 = o2.testConfig.getScreenSizeQualifier().getValue(); @@ -1049,6 +1050,7 @@ public class ConfigurationComposite extends Composite { mDensitySort.put(Density.LOW.getDpiValue(), 4); } + @Override public int compare(ConfigMatch o1, ConfigMatch o2) { int dpi1 = Density.DEFAULT_DENSITY; if (o1.testConfig.getDensityQualifier() != null) { @@ -1533,6 +1535,7 @@ public class ConfigurationComposite extends Composite { List<String> themeList = new ArrayList<String>(themeSet); final String first = preferred; Collections.sort(themeList, new Comparator<String>() { + @Override public int compare(String s1, String s2) { if (s1 == first) { return -1; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LayoutCreatorDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LayoutCreatorDialog.java index b63785c..82bd054 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LayoutCreatorDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LayoutCreatorDialog.java @@ -82,6 +82,7 @@ public final class LayoutCreatorDialog extends GridDialog { // add a listener to check on the validity of the FolderConfiguration as // they are built. mSelector.setOnChangeListener(new Runnable() { + @Override public void run() { ConfigurationState state = mSelector.getState(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java index 1ae463f..78f2d7f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java @@ -124,6 +124,7 @@ public final class LayoutDescriptors implements IDescriptorProvider { new HashMap<String, ViewElementDescriptor>(80); /** Returns the document descriptor. Contains all layouts and views linked together. */ + @Override public DocumentDescriptor getDescriptor() { return mRootDescriptor; } @@ -138,6 +139,7 @@ public final class LayoutDescriptors implements IDescriptorProvider { return mROViewDescriptors; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mRootDescriptor.getChildren(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/AccordionControl.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/AccordionControl.java index 3c18b16..a515640 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/AccordionControl.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/AccordionControl.java @@ -235,14 +235,17 @@ public abstract class AccordionControl extends Composite { } }); label.addMouseTrackListener(new MouseTrackListener() { + @Override public void mouseEnter(MouseEvent e) { updateBackground(label, true); } + @Override public void mouseExit(MouseEvent e) { updateBackground(label, false); } + @Override public void mouseHover(MouseEvent e) { } }); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfo.java index dbb8dac..792194e 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfo.java @@ -331,6 +331,7 @@ public class CanvasViewInfo implements IPropertySource { // ---- Implementation of IPropertySource + @Override public Object getEditableValue() { UiViewElementNode uiView = getUiViewNode(); if (uiView != null) { @@ -339,6 +340,7 @@ public class CanvasViewInfo implements IPropertySource { return null; } + @Override public IPropertyDescriptor[] getPropertyDescriptors() { UiViewElementNode uiView = getUiViewNode(); if (uiView != null) { @@ -347,6 +349,7 @@ public class CanvasViewInfo implements IPropertySource { return null; } + @Override public Object getPropertyValue(Object id) { UiViewElementNode uiView = getUiViewNode(); if (uiView != null) { @@ -355,6 +358,7 @@ public class CanvasViewInfo implements IPropertySource { return null; } + @Override public boolean isPropertySet(Object id) { UiViewElementNode uiView = getUiViewNode(); if (uiView != null) { @@ -363,6 +367,7 @@ public class CanvasViewInfo implements IPropertySource { return false; } + @Override public void resetPropertyValue(Object id) { UiViewElementNode uiView = getUiViewNode(); if (uiView != null) { @@ -370,6 +375,7 @@ public class CanvasViewInfo implements IPropertySource { } } + @Override public void setPropertyValue(Object id, Object value) { UiViewElementNode uiView = getUiViewNode(); if (uiView != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java index f138d45..0c686ac 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java @@ -203,6 +203,7 @@ public class ClipboardSupport { // which will trigger a recompute of the layout, thus reloading the model thus // resetting the selection. mCanvas.getLayoutEditor().wrapUndoEditXmlModel(title, new Runnable() { + @Override public void run() { // Segment the deleted nodes into clusters of siblings Map<NodeProxy, List<INode>> clusters = @@ -283,6 +284,7 @@ public class ClipboardSupport { final NodeProxy targetNode = mCanvas.getNodeFactory().create(target); mCanvas.getLayoutEditor().wrapUndoEditXmlModel("Paste", new Runnable() { + @Override public void run() { mCanvas.getRulesEngine().callOnPaste(targetNode, target.getViewObject(), pasted); targetNode.applyPendingChanges(); @@ -328,6 +330,7 @@ public class ClipboardSupport { title = String.format("Paste root %1$s in document", title); layoutEditor.wrapUndoEditXmlModel(title, new Runnable() { + @Override public void run() { UiElementNode uiNew = uiDoc.appendNewUiChild(viewDesc); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CustomViewFinder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CustomViewFinder.java index dda0627..b90b014 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CustomViewFinder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CustomViewFinder.java @@ -374,6 +374,7 @@ public class CustomViewFinder { // Notify listeners on SWT's UI thread Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { Collection<String> customViews = Collections.unmodifiableCollection(mCustomViews); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java index 47790de..0d0644f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java @@ -821,6 +821,7 @@ public class DomUtilities { /** Can be used to sort attributes by name */ private static final Comparator<Attr> ATTRIBUTE_COMPARATOR = new Comparator<Attr>() { + @Override public int compare(Attr a1, Attr a2) { return a1.getName().compareTo(a2.getName()); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DynamicContextMenu.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DynamicContextMenu.java index c641ed7..b4c77a8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DynamicContextMenu.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DynamicContextMenu.java @@ -113,6 +113,7 @@ class DynamicContextMenu { // them at the beginning of the menu. final int numStaticActions = mMenuManager.getSize(); mMenuManager.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { // Remove any previous dynamic contributions to keep only the @@ -379,6 +380,7 @@ class DynamicContextMenu { public void run() { String label = createActionLabel(action, nodes); mEditor.wrapUndoEditXmlModel(label, new Runnable() { + @Override public void run() { action.getCallback().action(action, nodes, null/* no valueId for a toggle */, !isChecked); @@ -398,6 +400,7 @@ class DynamicContextMenu { public void run() { String label = createActionLabel(action, nodes); mEditor.wrapUndoEditXmlModel(label, new Runnable() { + @Override public void run() { action.getCallback().action(action, nodes, null, Boolean.TRUE); @@ -566,6 +569,7 @@ class DynamicContextMenu { public void run() { String label = createActionLabel(mParentAction, mNodes); mEditor.wrapUndoEditXmlModel(label, new Runnable() { + @Override public void run() { mParentAction.getCallback().action(mParentAction, mNodes, id, Boolean.TRUE); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java index b1366a3..664d473 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java @@ -134,6 +134,7 @@ public class GCWrapper implements IGraphics { //------------- + @Override public IColor registerColor(int rgb) { checkGC(); @@ -151,6 +152,7 @@ public class GCWrapper implements IGraphics { } /** Returns the (cached) pixel height of the current font. */ + @Override public int getFontHeight() { if (mFontHeight < 1) { checkGC(); @@ -160,30 +162,36 @@ public class GCWrapper implements IGraphics { return mFontHeight; } + @Override public IColor getForeground() { Color c = getGc().getForeground(); return new ColorWrapper(c); } + @Override public IColor getBackground() { Color c = getGc().getBackground(); return new ColorWrapper(c); } + @Override public int getAlpha() { return getGc().getAlpha(); } + @Override public void setForeground(IColor color) { checkGC(); getGc().setForeground(((ColorWrapper) color).getColor()); } + @Override public void setBackground(IColor color) { checkGC(); getGc().setBackground(((ColorWrapper) color).getColor()); } + @Override public void setAlpha(int alpha) { checkGC(); try { @@ -194,6 +202,7 @@ public class GCWrapper implements IGraphics { } } + @Override public void setLineStyle(LineStyle style) { int swtStyle = 0; switch (style) { @@ -223,6 +232,7 @@ public class GCWrapper implements IGraphics { } } + @Override public void setLineWidth(int width) { checkGC(); if (width > 0) { @@ -232,6 +242,7 @@ public class GCWrapper implements IGraphics { // lines + @Override public void drawLine(int x1, int y1, int x2, int y2) { checkGC(); useStrokeAlpha(); @@ -242,12 +253,14 @@ public class GCWrapper implements IGraphics { getGc().drawLine(x1, y1, x2, y2); } + @Override public void drawLine(Point p1, Point p2) { drawLine(p1.x, p1.y, p2.x, p2.y); } // rectangles + @Override public void drawRect(int x1, int y1, int x2, int y2) { checkGC(); useStrokeAlpha(); @@ -258,10 +271,12 @@ public class GCWrapper implements IGraphics { getGc().drawRectangle(x, y, w, h); } + @Override public void drawRect(Point p1, Point p2) { drawRect(p1.x, p1.y, p2.x, p2.y); } + @Override public void drawRect(Rect r) { checkGC(); useStrokeAlpha(); @@ -272,6 +287,7 @@ public class GCWrapper implements IGraphics { getGc().drawRectangle(x, y, w, h); } + @Override public void fillRect(int x1, int y1, int x2, int y2) { checkGC(); useFillAlpha(); @@ -282,10 +298,12 @@ public class GCWrapper implements IGraphics { getGc().fillRectangle(x, y, w, h); } + @Override public void fillRect(Point p1, Point p2) { fillRect(p1.x, p1.y, p2.x, p2.y); } + @Override public void fillRect(Rect r) { checkGC(); useFillAlpha(); @@ -349,6 +367,7 @@ public class GCWrapper implements IGraphics { // strings + @Override public void drawString(String string, int x, int y) { checkGC(); useStrokeAlpha(); @@ -362,6 +381,7 @@ public class GCWrapper implements IGraphics { getGc().drawString(string, x, y, true /*isTransparent*/); } + @Override public void drawBoxedStrings(int x, int y, List<?> strings) { checkGC(); @@ -393,12 +413,14 @@ public class GCWrapper implements IGraphics { } } + @Override public void drawString(String string, Point topLeft) { drawString(string, topLeft.x, topLeft.y); } // Styles + @Override public void useStyle(DrawingStyle style) { checkGC(); @@ -490,6 +512,7 @@ public class GCWrapper implements IGraphics { // dots + @Override public void drawPoint(int x, int y) { checkGC(); useStrokeAlpha(); @@ -504,6 +527,7 @@ public class GCWrapper implements IGraphics { private static final int MIN_LENGTH = 10; + @Override public void drawArrow(int x1, int y1, int x2, int y2, int size) { int arrowWidth = size; int arrowHeight = size; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java index 6d878a7..5d3bee0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java @@ -437,6 +437,7 @@ public class GestureManager { // --- MouseMoveListener --- + @Override public void mouseMove(MouseEvent e) { mLastMouseX = e.x; mLastMouseY = e.y; @@ -456,6 +457,7 @@ public class GestureManager { // --- MouseListener --- + @Override public void mouseUp(MouseEvent e) { ControlPoint mousePos = ControlPoint.create(mCanvas, e); if (mCurrentGesture == null) { @@ -480,6 +482,7 @@ public class GestureManager { mCanvas.redraw(); } + @Override public void mouseDown(MouseEvent e) { mLastMouseX = e.x; mLastMouseY = e.y; @@ -488,6 +491,7 @@ public class GestureManager { // Not yet used. Should be, for Mac and Linux. } + @Override public void mouseDoubleClick(MouseEvent e) { // SWT delivers a double click event even if you click two different buttons // in rapid succession. In any case, we only want to let you double click the @@ -505,6 +509,7 @@ public class GestureManager { // --- KeyListener --- + @Override public void keyPressed(KeyEvent e) { mLastStateMask = e.stateMask; // Workaround for the fact that in keyPressed the current state @@ -541,6 +546,7 @@ public class GestureManager { mCanvas.handleKeyPressed(e); } + @Override public void keyReleased(KeyEvent e) { mLastStateMask = e.stateMask; // Workaround for the fact that in keyPressed the current state @@ -572,6 +578,7 @@ public class GestureManager { /** * The cursor has entered the drop target boundaries. {@inheritDoc} */ + @Override public void dragEnter(DropTargetEvent event) { mCanvas.showInvisibleViews(true); @@ -594,6 +601,7 @@ public class GestureManager { /** * The cursor is moving over the drop target. {@inheritDoc} */ + @Override public void dragOver(DropTargetEvent event) { if (mCurrentGesture instanceof DropGesture) { ((DropGesture) mCurrentGesture).dragOver(event); @@ -604,6 +612,7 @@ public class GestureManager { * The cursor has left the drop target boundaries OR data is about to be * dropped. {@inheritDoc} */ + @Override public void dragLeave(DropTargetEvent event) { if (mCurrentGesture instanceof DropGesture) { DropGesture dropGesture = (DropGesture) mCurrentGesture; @@ -619,6 +628,7 @@ public class GestureManager { * The drop is about to be performed. The drop target is given a last * chance to change the nature of the drop. {@inheritDoc} */ + @Override public void dropAccept(DropTargetEvent event) { Gesture gesture = mCurrentGesture != null ? mCurrentGesture : mZombieGesture; if (gesture instanceof DropGesture) { @@ -629,6 +639,7 @@ public class GestureManager { /** * The data is being dropped. {@inheritDoc} */ + @Override public void drop(final DropTargetEvent event) { // See if we had a gesture just prior to the drop (we receive a dragLeave // right before the drop which we don't know whether means the cursor has @@ -647,6 +658,7 @@ public class GestureManager { * The operation being performed has changed (e.g. modifier key). * {@inheritDoc} */ + @Override public void dragOperationChanged(DropTargetEvent event) { if (mCurrentGesture instanceof DropGesture) { ((DropGesture) mCurrentGesture).dragOperationChanged(event); @@ -676,6 +688,7 @@ public class GestureManager { * there's none, try to auto-select the one under the cursor. * {@inheritDoc} */ + @Override public void dragStart(DragSourceEvent e) { LayoutPoint p = LayoutPoint.create(mCanvas, e); ControlPoint controlPoint = ControlPoint.create(mCanvas, e); @@ -763,6 +776,7 @@ public class GestureManager { GlobalCanvasDragInfo.getInstance().startDrag(mDragElements, mDragSelection.toArray(new SelectionItem[imageCount]), mCanvas, new Runnable() { + @Override public void run() { mCanvas.getClipboardSupport().deleteSelection("Remove", mDragSelection); @@ -848,6 +862,7 @@ public class GestureManager { * before drop. The drop side decides what type of transfer to use and * this side must now provide the adequate data. {@inheritDoc} */ + @Override public void dragSetData(DragSourceEvent e) { if (TextTransfer.getInstance().isSupportedType(e.dataType)) { e.data = SelectionItem.getAsText(mCanvas, mDragSelection); @@ -868,6 +883,7 @@ public class GestureManager { * Callback invoked when the drop has been finished either way. On a * successful move, remove the originating elements. */ + @Override public void dragFinished(DragSourceEvent e) { // Clear the selection mDragSelection.clear(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureToolTip.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureToolTip.java index b75f4d1..a49e79c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureToolTip.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureToolTip.java @@ -185,6 +185,7 @@ public class GestureToolTip { if (!mTimerPending) { mTimerPending = true; final Runnable timer = new Runnable() { + @Override public void run() { mTimerPending = false; // Check whether the alignment is still different than the target diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java index 931eac1..9d8fb6a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java @@ -282,6 +282,7 @@ public class GraphicalEditorPart extends EditorPart } } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon("editor_page_design"); //$NON-NLS-1$ } @@ -375,6 +376,7 @@ public class GraphicalEditorPart extends EditorPart * Selection can be null, as indicated by this class implementing * {@link INullSelectionListener}. */ + @Override public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (!(part instanceof LayoutEditor)) { if (part instanceof PageBookView) { @@ -434,6 +436,7 @@ public class GraphicalEditorPart extends EditorPart * Looks for a file matching the new {@link FolderConfiguration} and attempts to open it. * <p/>If there is no match, notify the user. */ + @Override public void onConfigurationChange() { mConfiguredFrameworkRes = mConfiguredProjectRes = null; mResourceResolver = null; @@ -509,6 +512,7 @@ public class GraphicalEditorPart extends EditorPart reloadPalette(); } + @Override public void onThemeChange() { // Store the state in the current file mConfigComposite.storeState(); @@ -519,6 +523,7 @@ public class GraphicalEditorPart extends EditorPart reloadPalette(); } + @Override public void onCreate() { LayoutCreatorDialog dialog = new LayoutCreatorDialog(mConfigComposite.getShell(), mEditedFile.getName(), mConfigComposite.getCurrentConfig()); @@ -530,10 +535,12 @@ public class GraphicalEditorPart extends EditorPart } } + @Override public void onRenderingTargetPreChange(IAndroidTarget oldTarget) { preRenderingTargetChangeCleanUp(oldTarget); } + @Override public void onRenderingTargetPostChange(IAndroidTarget target) { AndroidTargetData targetData = Sdk.getCurrent().getTargetData(target); updateCapabilities(targetData); @@ -541,6 +548,7 @@ public class GraphicalEditorPart extends EditorPart mPalette.reloadPalette(target); } + @Override public Map<ResourceType, Map<String, ResourceValue>> getConfiguredFrameworkResources() { if (mConfiguredFrameworkRes == null && mConfigComposite != null) { ResourceRepository frameworkRes = getFrameworkResources(); @@ -557,6 +565,7 @@ public class GraphicalEditorPart extends EditorPart return mConfiguredFrameworkRes; } + @Override public Map<ResourceType, Map<String, ResourceValue>> getConfiguredProjectResources() { if (mConfiguredProjectRes == null && mConfigComposite != null) { ProjectResources project = getProjectResources(); @@ -574,6 +583,7 @@ public class GraphicalEditorPart extends EditorPart * configuration selection. * @return the framework resources or null if not found. */ + @Override public ResourceRepository getFrameworkResources() { return getFrameworkResources(getRenderingTarget()); } @@ -584,6 +594,7 @@ public class GraphicalEditorPart extends EditorPart * @param target the target for which to return the framework resources. * @return the framework resources or null if not found. */ + @Override public ResourceRepository getFrameworkResources(IAndroidTarget target) { if (target != null) { AndroidTargetData data = Sdk.getCurrent().getTargetData(target); @@ -596,6 +607,7 @@ public class GraphicalEditorPart extends EditorPart return null; } + @Override public ProjectResources getProjectResources() { if (mEditedFile != null) { ResourceManager manager = ResourceManager.getInstance(); @@ -661,39 +673,48 @@ public class GraphicalEditorPart extends EditorPart // We use a progress monitor to catch the end of the refresh // to trigger the edit of the new file. res.refreshLocal(IResource.DEPTH_INFINITE, new IProgressMonitor() { + @Override public void done() { mConfigComposite.getDisplay().asyncExec(new Runnable() { + @Override public void run() { onConfigurationChange(); } }); } + @Override public void beginTask(String name, int totalWork) { // pass } + @Override public void internalWorked(double work) { // pass } + @Override public boolean isCanceled() { // pass return false; } + @Override public void setCanceled(boolean value) { // pass } + @Override public void setTaskName(String name) { // pass } + @Override public void subTask(String name) { // pass } + @Override public void worked(int work) { // pass } @@ -728,12 +749,14 @@ public class GraphicalEditorPart extends EditorPart * out to fit the content, or zoom back in if we were zoomed out more from the * previous view, but only up to 100% such that we never blow up pixels */ + @Override public void onDevicePostChange() { if (mActionBar.isZoomingAllowed()) { getCanvasControl().setFitScale(true); } } + @Override public String getIncludedWithin() { return mIncludedWithin != null ? mIncludedWithin.getName() : null; } @@ -744,12 +767,14 @@ public class GraphicalEditorPart extends EditorPart */ private class TargetListener implements ITargetChangeListener { + @Override public void onProjectTargetChange(IProject changedProject) { if (changedProject != null && changedProject.equals(getProject())) { updateEditor(); } } + @Override public void onTargetLoaded(IAndroidTarget loadedTarget) { IAndroidTarget target = getRenderingTarget(); if (target != null && target.equals(loadedTarget)) { @@ -757,6 +782,7 @@ public class GraphicalEditorPart extends EditorPart } } + @Override public void onSdkLoaded() { // get the current rendering target to unload it IAndroidTarget oldTarget = getRenderingTarget(); @@ -1461,12 +1487,14 @@ public class GraphicalEditorPart extends EditorPart /** * Called when the file changes triggered a redraw of the layout */ + @Override public void reloadLayout(final ChangeFlags flags, final boolean libraryChanged) { if (mConfigComposite.isDisposed()) { return; } Display display = mConfigComposite.getDisplay(); display.asyncExec(new Runnable() { + @Override public void run() { reloadLayoutSwt(flags, libraryChanged); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageControl.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageControl.java index d04e3d6..23ddaa1 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageControl.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageControl.java @@ -65,6 +65,7 @@ public class ImageControl extends Canvas implements MouseTrackListener { this.mImage = image; addPaintListener(new PaintListener() { + @Override public void paintControl(PaintEvent event) { onPaint(event); } @@ -190,6 +191,7 @@ public class ImageControl extends Canvas implements MouseTrackListener { // ---- Implements MouseTrackListener ---- + @Override public void mouseEnter(MouseEvent e) { mMouseIn = true; if (mHoverColor != null) { @@ -197,6 +199,7 @@ public class ImageControl extends Canvas implements MouseTrackListener { } } + @Override public void mouseExit(MouseEvent e) { mMouseIn = false; if (mHoverColor != null) { @@ -204,6 +207,7 @@ public class ImageControl extends Canvas implements MouseTrackListener { } } + @Override public void mouseHover(MouseEvent e) { } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageOverlay.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageOverlay.java index 1611351..cc52407 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageOverlay.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageOverlay.java @@ -325,6 +325,7 @@ public class ImageOverlay extends Overlay implements IImageFactory { /** * Implementation of {@link IImageFactory#getImage(int, int)}. */ + @Override public BufferedImage getImage(int w, int h) { if (mAwtImage == null || mAwtImage.getWidth() != w || diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java index fbeecb9..aa8f0e4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java @@ -126,6 +126,7 @@ public class ImageUtils { */ public static BufferedImage cropBlank(BufferedImage image, Rect initialCrop) { CropFilter filter = new CropFilter() { + @Override public boolean crop(BufferedImage bufferedImage, int x, int y) { int rgb = bufferedImage.getRGB(x, y); return (rgb & 0xFF000000) == 0x00000000; @@ -152,6 +153,7 @@ public class ImageUtils { public static BufferedImage cropColor(BufferedImage image, final int blankArgb, Rect initialCrop) { CropFilter filter = new CropFilter() { + @Override public boolean crop(BufferedImage bufferedImage, int x, int y) { return blankArgb == bufferedImage.getRGB(x, y); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java index 1dc9b90..f2b6b9f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java @@ -682,6 +682,7 @@ public class IncludeFinder { /** Listener of resource file saves, used to update layout inclusion data structures */ private static class ResourceListener implements IResourceListener { + @Override public void fileChanged(IProject project, ResourceFile file, int eventType) { if (sRefreshing) { return; @@ -699,6 +700,7 @@ public class IncludeFinder { } } + @Override public void folderChanged(IProject project, ResourceFolder folder, int eventType) { // We only care about layout resource files } @@ -758,6 +760,7 @@ public class IncludeFinder { if (tmpMsg == null || tmpMsg.startsWith(MESSAGE)) { // Remove runLater(new Runnable() { + @Override public void run() { try { sRefreshing = true; @@ -823,6 +826,7 @@ public class IncludeFinder { if (!markerAlreadyExists) { runLater(new Runnable() { + @Override public void run() { try { sRefreshing = true; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java index 1c6c92a..0836907 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java @@ -328,6 +328,7 @@ public class LayoutActionBar extends Composite { } Listener menuListener = new Listener() { + @Override public void handleEvent(Event event) { // if (event.detail == SWT.ARROW) { Point point = new Point(event.x, event.y); @@ -483,6 +484,7 @@ public class LayoutActionBar extends Composite { Display display = getDisplay(); if (display.getThread() != Thread.currentThread()) { display.asyncExec(new Runnable() { + @Override public void run() { if (!isDisposed()) { updateErrorIndicator(hasLintWarnings); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java index 17b3f33..36719ba 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java @@ -272,6 +272,7 @@ public class LayoutCanvas extends Canvas { // --- Set up listeners addPaintListener(new PaintListener() { + @Override public void paintControl(PaintEvent e) { onPaint(e); } @@ -576,6 +577,7 @@ public class LayoutCanvas extends Canvas { // Must be run asynchronously because getClientArea() returns 0 bounds // when the editor is being initialized getDisplay().asyncExec(new Runnable() { + @Override public void run() { setFitScale(true); } @@ -1238,6 +1240,7 @@ public class LayoutCanvas extends Canvas { // in the canvas which is NOT selected, and the context menu will show items related // to the selection, NOT the item you clicked on!! addMenuDetectListener(new MenuDetectListener() { + @Override public void menuDetected(MenuDetectEvent e) { mSelectionManager.menuClick(e); } @@ -1329,6 +1332,7 @@ public class LayoutCanvas extends Canvas { title = String.format("Create root %1$s in document", title); mLayoutEditor.wrapUndoEditXmlModel(title, new Runnable() { + @Override public void run() { UiElementNode uiNew = uiDoc.appendNewUiChild(viewDesc); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvasViewer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvasViewer.java index c5c8bce..2830eb3 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvasViewer.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvasViewer.java @@ -59,6 +59,7 @@ class LayoutCanvasViewer extends Viewer implements IPostSelectionProvider { } private ISelectionChangedListener mSelectionListener = new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { fireSelectionChanged(event); firePostSelectionChanged(event); @@ -136,10 +137,12 @@ class LayoutCanvasViewer extends Viewer implements IPostSelectionProvider { private ListenerList mPostChangedListeners = new ListenerList(); + @Override public void addPostSelectionChangedListener(ISelectionChangedListener listener) { mPostChangedListeners.add(listener); } + @Override public void removePostSelectionChangedListener(ISelectionChangedListener listener) { mPostChangedListeners.remove(listener); } @@ -149,6 +152,7 @@ class LayoutCanvasViewer extends Viewer implements IPostSelectionProvider { for (int i = 0; i < listeners.length; i++) { final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i]; SafeRunnable.run(new SafeRunnable() { + @Override public void run() { l.selectionChanged(event); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java index 59486de..1fadc25 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java @@ -354,6 +354,7 @@ public class MoveGesture extends DropGesture { // List of "index within parent" for each node final List<Integer> indices = new ArrayList<Integer>(); NodeCreationListener listener = new NodeCreationListener() { + @Override public void nodeCreated(UiElementNode parent, UiElementNode child, int index) { if (parent == mTargetNode.getNode()) { added.add(child); @@ -370,6 +371,7 @@ public class MoveGesture extends DropGesture { } } + @Override public void nodeDeleted(UiElementNode parent, UiElementNode child, int previousIndex) { if (parent == mTargetNode.getNode()) { // Adjust existing indices @@ -389,6 +391,7 @@ public class MoveGesture extends DropGesture { try { UiElementNode.addNodeCreationListener(listener); mCanvas.getLayoutEditor().wrapUndoEditXmlModel(label, new Runnable() { + @Override public void run() { InsertType insertType = getInsertType(event, mTargetNode); mCanvas.getRulesEngine().callOnDropped(mTargetNode, @@ -432,6 +435,7 @@ public class MoveGesture extends DropGesture { // defer selection briefly until the view hierarchy etc is up to // date. Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { selectionManager.selectDropped(nodes, indices); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDragListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDragListener.java index cf46533..1af3053 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDragListener.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDragListener.java @@ -39,6 +39,7 @@ import java.util.ArrayList; mTreeViewer = treeViewer; } + @Override public void dragStart(DragSourceEvent e) { Tree tree = mTreeViewer.getTree(); @@ -78,6 +79,7 @@ import java.util.ArrayList; GlobalCanvasDragInfo.getInstance().startDrag(mDragElements, mDragSelection.toArray(new SelectionItem[imageCount]), canvas, new Runnable() { + @Override public void run() { canvas.getClipboardSupport().deleteSelection("Remove", mDragSelection); @@ -89,6 +91,7 @@ import java.util.ArrayList; e.detail = DND.DROP_NONE; } + @Override public void dragSetData(DragSourceEvent e) { if (TextTransfer.getInstance().isSupportedType(e.dataType)) { LayoutCanvas canvas = mOutlinePage.getEditor().getCanvasControl(); @@ -106,6 +109,7 @@ import java.util.ArrayList; e.doit = false; } + @Override public void dragFinished(DragSourceEvent e) { // Unregister the dragged data. // Clear the selection diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDropListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDropListener.java index cf09160..42833eb 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDropListener.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlineDropListener.java @@ -123,6 +123,7 @@ import java.util.Set; String label = MoveGesture.computeUndoLabel(targetNode, elements, event.detail); final int indexFinal = index; canvas.getLayoutEditor().wrapUndoEditXmlModel(label, new Runnable() { + @Override public void run() { InsertType insertType = MoveGesture.getInsertType(event, targetNode); canvas.getRulesEngine().setInsertType(insertType); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java index 7c0a365..376083f 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java @@ -217,6 +217,7 @@ public class OutlinePage extends ContentOutlinePage // change each time the canvas is reloaded. OTOH layoutlib gives us // constant UiView keys which we can use to perform tree item comparisons. tv.setComparer(new IElementComparer() { + @Override public int hashCode(Object element) { if (element instanceof CanvasViewInfo) { UiViewElementNode key = ((CanvasViewInfo) element).getUiViewNode(); @@ -230,6 +231,7 @@ public class OutlinePage extends ContentOutlinePage return 0; } + @Override public boolean equals(Object a, Object b) { if (a instanceof CanvasViewInfo && b instanceof CanvasViewInfo) { UiViewElementNode keyA = ((CanvasViewInfo) a).getUiViewNode(); @@ -245,6 +247,7 @@ public class OutlinePage extends ContentOutlinePage } }); tv.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { // Front properties panel; its selection is already linked IWorkbenchPage page = getSite().getPage(); @@ -262,6 +265,7 @@ public class OutlinePage extends ContentOutlinePage getSite().getPage().addSelectionListener(this); getControl().addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { dispose(); } @@ -270,6 +274,7 @@ public class OutlinePage extends ContentOutlinePage Tree tree = tv.getTree(); tree.addKeyListener(new KeyListener() { + @Override public void keyPressed(KeyEvent e) { if (e.character == '-') { if (mMoveUpAction.isEnabled()) { @@ -282,6 +287,7 @@ public class OutlinePage extends ContentOutlinePage } } + @Override public void keyReleased(KeyEvent e) { } }); @@ -354,6 +360,7 @@ public class OutlinePage extends ContentOutlinePage * Only listen on selection coming from {@link LayoutEditor}, which avoid * picking up our own selections. */ + @Override public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (part instanceof LayoutEditor) { setSelection(selection); @@ -406,6 +413,7 @@ public class OutlinePage extends ContentOutlinePage */ private static class ContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object element) { if (element instanceof RootWrapper) { CanvasViewInfo root = ((RootWrapper)element).getRoot(); @@ -422,6 +430,7 @@ public class OutlinePage extends ContentOutlinePage return new Object[0]; } + @Override public Object getParent(Object element) { if (element instanceof CanvasViewInfo) { return ((CanvasViewInfo) element).getParent(); @@ -429,6 +438,7 @@ public class OutlinePage extends ContentOutlinePage return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof CanvasViewInfo) { List<CanvasViewInfo> children = ((CanvasViewInfo) element).getChildren(); @@ -443,14 +453,17 @@ public class OutlinePage extends ContentOutlinePage * Returns the root element. * Semantically, the root element is the single top-level XML element of the XML layout. */ + @Override public Object[] getElements(Object inputElement) { return getChildren(inputElement); } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } @@ -657,6 +670,7 @@ public class OutlinePage extends ContentOutlinePage mMenuManager.add(new DelegateAction(prefix + ActionFactory.DELETE.getId())); mMenuManager.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { // Update all actions to match their LayoutCanvas counterparts for (IContributionItem contrib : manager.getItems()) { @@ -679,6 +693,7 @@ public class OutlinePage extends ContentOutlinePage // Update Move Up/Move Down state only when the menu is opened getControl().addMenuDetectListener(new MenuDetectListener() { + @Override public void menuDetected(MenuDetectEvent e) { mMenuManager.update(IAction.ENABLED); } @@ -830,6 +845,7 @@ public class OutlinePage extends ContentOutlinePage String label = MoveGesture.computeUndoLabel(targetNode, elements, DND.DROP_MOVE); canvas.getLayoutEditor().wrapUndoEditXmlModel(label, new Runnable() { + @Override public void run() { InsertType insertType = InsertType.MOVE_INTO; if (dragSelection.get(0).getNode().getParent() == targetNode) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java index 36fdda4..73a6dfc 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java @@ -137,22 +137,27 @@ public class PaletteControl extends Composite { mEditorPart = editor; } + @Override public String getTitle() { return "Palette"; } + @Override public Image getImage() { return IconFactory.getInstance().getIcon("editor_palette"); //$NON-NLS-1$ } + @Override public void createControl(Composite parent) { mControl = new PaletteControl(parent, mEditorPart); } + @Override public Control getControl() { return mControl; } + @Override public void createToolbarItems(final ToolBar toolbar) { final ToolItem popupMenuItem = new ToolItem(toolbar, SWT.PUSH); popupMenuItem.setToolTipText("View Menu"); @@ -659,6 +664,7 @@ public class PaletteControl extends Composite { source.setTransfer(new Transfer[] { SimpleXmlTransfer.getInstance() }); source.addDragListener(new DescDragSourceListener(desc)); item.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { source.dispose(); } @@ -695,6 +701,7 @@ public class PaletteControl extends Composite { return style; } + @Override public void mouseEnter(MouseEvent e) { if (!mMouseIn) { mMouseIn = true; @@ -702,6 +709,7 @@ public class PaletteControl extends Composite { } } + @Override public void mouseExit(MouseEvent e) { if (mMouseIn) { mMouseIn = false; @@ -709,6 +717,7 @@ public class PaletteControl extends Composite { } } + @Override public void mouseHover(MouseEvent e) { // pass } @@ -726,6 +735,7 @@ public class PaletteControl extends Composite { mDesc = desc; } + @Override public void dragStart(DragSourceEvent e) { // See if we can find out the bounds of this element from a preview image. // Preview images are created before the drag source listener is notified @@ -773,6 +783,7 @@ public class PaletteControl extends Composite { e.doit = true; } + @Override public void dragSetData(DragSourceEvent e) { // Provide the data for the drop when requested by the other side. if (SimpleXmlTransfer.getInstance().isSupportedType(e.dataType)) { @@ -780,6 +791,7 @@ public class PaletteControl extends Composite { } } + @Override public void dragFinished(DragSourceEvent e) { // Unregister the dragged data. GlobalCanvasDragInfo.getInstance().stopDrag(); @@ -1179,6 +1191,7 @@ public class PaletteControl extends Composite { private void addMenu(Control control) { control.addMenuDetectListener(new MenuDetectListener() { + @Override public void menuDetected(MenuDetectEvent e) { showMenu(e.x, e.y); } @@ -1233,6 +1246,7 @@ public class PaletteControl extends Composite { this.mParent = parent; } + @Override public void viewsUpdated(Collection<String> customViews, Collection<String> thirdPartyViews) { addCustomItems(mParent); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PlayAnimationMenu.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PlayAnimationMenu.java index 812ece4..d4f12d9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PlayAnimationMenu.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PlayAnimationMenu.java @@ -154,6 +154,7 @@ public class PlayAnimationMenu extends SubmenuAction { new IAnimationListener() { private boolean mPendingDrawing = false; + @Override public void onNewFrame(RenderSession s) { SelectionOverlay selectionOverlay = mCanvas.getSelectionOverlay(); if (!selectionOverlay.isHiding()) { @@ -169,6 +170,7 @@ public class PlayAnimationMenu extends SubmenuAction { synchronized (this) { if (mPendingDrawing == false) { mCanvas.getDisplay().asyncExec(new Runnable() { + @Override public void run() { synchronized (this) { mPendingDrawing = false; @@ -181,10 +183,12 @@ public class PlayAnimationMenu extends SubmenuAction { } } + @Override public boolean isCanceled() { return false; } + @Override public void done(Result result) { SelectionOverlay selectionOverlay = mCanvas.getSelectionOverlay(); selectionOverlay.setHiding(false); @@ -195,6 +199,7 @@ public class PlayAnimationMenu extends SubmenuAction { // their original positions in case animations have left // them elsewhere mCanvas.getDisplay().asyncExec(new Runnable() { + @Override public void run() { GraphicalEditorPart graphicalEditor = mCanvas .getLayoutEditor().getGraphicalEditor(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PropertySheetPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PropertySheetPage.java index b67e606..d785faf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PropertySheetPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PropertySheetPage.java @@ -124,6 +124,7 @@ public class PropertySheetPage extends org.eclipse.ui.views.properties.PropertyS // for earlier releases. This just paints a solid color under the current line in // the left column. tree.addListener(SWT.EraseItem, new Listener() { + @Override public void handleEvent(Event event) { if ((event.detail & SWT.SELECTED) != 0 && event.index == 0) { GC gc = event.gc; @@ -155,6 +156,7 @@ public class PropertySheetPage extends org.eclipse.ui.views.properties.PropertyS Shell tip = null; Label label = null; + @Override public void handleEvent(Event event) { switch(event.type) { case SWT.Dispose: diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionHandles.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionHandles.java index 07285ea..6d7f34a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionHandles.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionHandles.java @@ -133,6 +133,7 @@ public class SelectionHandles implements Iterable<SelectionHandle> { } // Implements Iterable<SelectionHandle> + @Override public Iterator<SelectionHandle> iterator() { return mHandles.iterator(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java index 872b635..01122df 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java @@ -106,10 +106,12 @@ public class SelectionManager implements ISelectionProvider { this.mCanvas = layoutCanvas; } + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { mSelectionListeners.add(listener); } + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { mSelectionListeners.remove(listener); } @@ -137,6 +139,7 @@ public class SelectionManager implements ISelectionProvider { * Returns a {@link TreeSelection} where each {@link TreePath} item is * actually a {@link CanvasViewInfo}. */ + @Override public ISelection getSelection() { if (mSelections.isEmpty()) { return TreeSelection.EMPTY; @@ -180,6 +183,7 @@ public class SelectionManager implements ISelectionProvider { * changed. Typically it means the outline selection has changed and we're * synchronizing ours to match. */ + @Override public void setSelection(ISelection selection) { if (mInsideUpdateSelection) { return; @@ -732,6 +736,7 @@ public class SelectionManager implements ISelectionProvider { final SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection()); SafeRunnable.run(new SafeRunnable() { + @Override public void run() { for (Object listener : mSelectionListeners.getListeners()) { ((ISelectionChangedListener) listener).selectionChanged(event); @@ -888,6 +893,7 @@ public class SelectionManager implements ISelectionProvider { */ public void setOutlineSelection(final List<INode> nodes) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { selectDropped(nodes, null /* indices */); syncOutlineSelection(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttribute.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttribute.java index 4233208..b4a4772 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttribute.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttribute.java @@ -57,16 +57,19 @@ public class SimpleAttribute implements IAttribute { * Returns the namespace URI of the attribute. * Can be empty for an attribute without a namespace but is never null. */ + @Override public String getUri() { return mUri; } /** Returns the XML local name of the attribute. Cannot be null nor empty. */ + @Override public String getName() { return mName; } /** Returns the value of the attribute. Cannot be null. Can be empty. */ + @Override public String getValue() { return mValue; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElement.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElement.java index cf42077..e9abb06 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElement.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElement.java @@ -68,6 +68,7 @@ public class SimpleElement implements IDragElement { * Returns the element name, which must match a fully qualified class name of * a View to inflate. */ + @Override public String getFqcn() { return mFqcn; } @@ -77,6 +78,7 @@ public class SimpleElement implements IDragElement { * canvas. The rectangle is invalid and non-null when the element originated * from the object palette (unless it successfully rendered a preview) */ + @Override public Rect getBounds() { return mBounds; } @@ -86,6 +88,7 @@ public class SimpleElement implements IDragElement { * from an existing canvas. Returns null if the element has no parent, such as a top * level element or an element originating from the object palette. */ + @Override public String getParentFqcn() { return mParentFqcn; } @@ -94,10 +97,12 @@ public class SimpleElement implements IDragElement { * Returns the bounds of the element's parent, absolute for the canvas, or null if there * is no suitable parent. This is null when {@link #getParentFqcn()} is null. */ + @Override public Rect getParentBounds() { return mParentBounds; } + @Override public IDragAttribute[] getAttributes() { if (mCachedAttributes == null) { mCachedAttributes = mAttributes.toArray(new IDragAttribute[mAttributes.size()]); @@ -105,6 +110,7 @@ public class SimpleElement implements IDragElement { return mCachedAttributes; } + @Override public IDragAttribute getAttribute(String uri, String localName) { for (IDragAttribute attr : mAttributes) { if (attr.getUri().equals(uri) && attr.getName().equals(localName)) { @@ -115,6 +121,7 @@ public class SimpleElement implements IDragElement { return null; } + @Override public IDragElement[] getInnerElements() { if (mCachedElements == null) { mCachedElements = mElements.toArray(new IDragElement[mElements.size()]); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SubmenuAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SubmenuAction.java index 04325ef..f031028 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SubmenuAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SubmenuAction.java @@ -26,6 +26,7 @@ abstract class SubmenuAction extends Action implements MenuListener, IMenuCreato return this; } + @Override public void dispose() { if (mMenu != null) { mMenu.dispose(); @@ -33,21 +34,25 @@ abstract class SubmenuAction extends Action implements MenuListener, IMenuCreato } } + @Override public Menu getMenu(Control parent) { return null; } + @Override public Menu getMenu(Menu parent) { mMenu = new Menu(parent); mMenu.addMenuListener(this); return mMenu; } + @Override public void menuHidden(MenuEvent e) { } protected abstract void addMenuItems(Menu menu); + @Override public void menuShown(MenuEvent e) { // TODO: Replace this stuff with manager.setRemoveAllWhenShown(true); MenuItem[] menuItems = mMenu.getItems(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java index ae66dbf..f636e34 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java @@ -105,10 +105,12 @@ class ClientRulesEngine implements IClientRulesEngine { mFqcn = fqcn; } + @Override public String getFqcn() { return mFqcn; } + @Override public void debugPrintf(String msg, Object... params) { AdtPlugin.printToConsole( mFqcn == null ? "<unknown>" : mFqcn, @@ -116,10 +118,12 @@ class ClientRulesEngine implements IClientRulesEngine { ); } + @Override public IViewRule loadRule(String fqcn) { return mRulesEngine.loadRule(fqcn, fqcn); } + @Override public void displayAlert(String message) { MessageDialog.openInformation( AdtPlugin.getDisplay().getActiveShell(), @@ -127,10 +131,12 @@ class ClientRulesEngine implements IClientRulesEngine { message); } + @Override public String displayInput(String message, String value, final IValidator filter) { IInputValidator validator = null; if (filter != null) { validator = new IInputValidator() { + @Override public String isValid(String newText) { // IValidator has the same interface as SWT's IInputValidator try { @@ -155,27 +161,33 @@ class ClientRulesEngine implements IClientRulesEngine { return null; } + @Override public IViewMetadata getMetadata(final String fqcn) { return new IViewMetadata() { + @Override public String getDisplayName() { // This also works when there is no "." return fqcn.substring(fqcn.lastIndexOf('.') + 1); } + @Override public FillPreference getFillPreference() { return ViewMetadataRepository.get().getFillPreference(fqcn); } + @Override public Margins getInsets() { return mRulesEngine.getEditor().getCanvasControl().getInsets(fqcn); } + @Override public List<String> getTopAttributes() { return ViewMetadataRepository.get().getTopAttributes(fqcn); } }; } + @Override public int getMinApiLevel() { Sdk currentSdk = Sdk.getCurrent(); if (currentSdk != null) { @@ -186,6 +198,7 @@ class ClientRulesEngine implements IClientRulesEngine { return -1; } + @Override public IValidator getResourceValidator() { // When https://review.source.android.com/#change,20168 is integrated, // change this to @@ -193,6 +206,7 @@ class ClientRulesEngine implements IClientRulesEngine { return null; } + @Override public String displayReferenceInput(String currentValue) { GraphicalEditorPart graphicalEditor = mRulesEngine.getEditor(); AndroidXmlEditor editor = graphicalEditor.getLayoutEditor(); @@ -221,6 +235,7 @@ class ClientRulesEngine implements IClientRulesEngine { return null; } + @Override public String displayResourceInput(String resourceTypeName, String currentValue) { return displayResourceInput(resourceTypeName, currentValue, null); } @@ -267,6 +282,7 @@ class ClientRulesEngine implements IClientRulesEngine { return null; } + @Override public String[] displayMarginInput(String all, String left, String right, String top, String bottom) { AndroidXmlEditor editor = mRulesEngine.getEditor().getLayoutEditor(); @@ -287,12 +303,14 @@ class ClientRulesEngine implements IClientRulesEngine { return null; } + @Override public String displayIncludeSourceInput() { AndroidXmlEditor editor = mRulesEngine.getEditor().getLayoutEditor(); IInputValidator validator = CyclicDependencyValidator.create(editor.getInputFile()); return displayResourceInput(ResourceType.LAYOUT.getName(), null, validator); } + @Override public void select(final Collection<INode> nodes) { LayoutCanvas layoutCanvas = mRulesEngine.getEditor().getCanvasControl(); final SelectionManager selectionManager = layoutCanvas.getSelectionManager(); @@ -301,12 +319,14 @@ class ClientRulesEngine implements IClientRulesEngine { // may not be selectable. We can't ONLY run an async exec since // code may depend on operating on the selection. layoutCanvas.getDisplay().asyncExec(new Runnable() { + @Override public void run() { selectionManager.select(nodes); } }); } + @Override public String displayFragmentSourceInput() { try { // Compute a search scope: We need to merge all the subclasses @@ -402,6 +422,7 @@ class ClientRulesEngine implements IClientRulesEngine { @Override public ITypeInfoFilterExtension getFilterExtension() { return new ITypeInfoFilterExtension() { + @Override public boolean select(ITypeInfoRequestor typeInfoRequestor) { int modifiers = typeInfoRequestor.getModifiers(); if (!Flags.isPublic(modifiers) @@ -437,14 +458,17 @@ class ClientRulesEngine implements IClientRulesEngine { return null; } + @Override public void redraw() { mRulesEngine.getEditor().getCanvasControl().redraw(); } + @Override public void layout() { mRulesEngine.getEditor().recomputeLayout(); } + @Override public Map<INode, Rect> measureChildren(INode parent, IClientRulesEngine.AttributeFilter filter) { RenderService renderService = RenderService.create(mRulesEngine.getEditor()); @@ -455,18 +479,21 @@ class ClientRulesEngine implements IClientRulesEngine { return map; } + @Override public int pxToDp(int px) { ConfigurationComposite config = mRulesEngine.getEditor().getConfigurationComposite(); float dpi = config.getDensity().getDpiValue(); return (int) (px * 160 / dpi); } + @Override public int dpToPx(int dp) { ConfigurationComposite config = mRulesEngine.getEditor().getConfigurationComposite(); float dpi = config.getDensity().getDpiValue(); return (int) (dp * dpi / 160); } + @Override public int screenToLayout(int pixels) { return (int) (pixels / mRulesEngine.getEditor().getCanvasControl().getScale()); } @@ -503,6 +530,7 @@ class ClientRulesEngine implements IClientRulesEngine { } } + @Override public String getUniqueId(String fqcn) { UiDocumentNode root = mRulesEngine.getEditor().getModel(); String prefix = fqcn.substring(fqcn.lastIndexOf('.') + 1); @@ -510,6 +538,7 @@ class ClientRulesEngine implements IClientRulesEngine { return DescriptorsUtils.getFreeWidgetId(root, prefix); } + @Override public String getAppNameSpace() { ManifestInfo info = ManifestInfo.get(mRulesEngine.getEditor().getProject()); return info.getPackage(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java index f29283e..94fe134 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeProxy.java @@ -84,10 +84,12 @@ public class NodeProxy implements INode { } } + @Override public Rect getBounds() { return mBounds; } + @Override public Margins getMargins() { ViewHierarchy viewHierarchy = mFactory.getCanvas().getViewHierarchy(); CanvasViewInfo view = viewHierarchy.findViewInfoFor(this); @@ -99,6 +101,7 @@ public class NodeProxy implements INode { } + @Override public int getBaseline() { ViewHierarchy viewHierarchy = mFactory.getCanvas().getViewHierarchy(); CanvasViewInfo view = viewHierarchy.findViewInfoFor(this); @@ -128,6 +131,7 @@ public class NodeProxy implements INode { return mNode; } + @Override public String getFqcn() { if (mNode != null) { ElementDescriptor desc = mNode.getDescriptor(); @@ -142,6 +146,7 @@ public class NodeProxy implements INode { // ---- Hierarchy handling ---- + @Override public INode getRoot() { if (mNode != null) { UiElementNode p = mNode.getUiRoot(); @@ -170,6 +175,7 @@ public class NodeProxy implements INode { return null; } + @Override public INode getParent() { if (mNode != null) { UiElementNode p = mNode.getUiParent(); @@ -181,6 +187,7 @@ public class NodeProxy implements INode { return null; } + @Override public INode[] getChildren() { if (mNode != null) { ArrayList<INode> nodes = new ArrayList<INode>(); @@ -199,6 +206,7 @@ public class NodeProxy implements INode { // ---- XML Editing --- + @Override public void editXml(String undoName, final INodeHandler c) { final AndroidXmlEditor editor = mNode.getEditor(); @@ -207,6 +215,7 @@ public class NodeProxy implements INode { ((LayoutEditor) editor).wrapUndoEditXmlModel( undoName, new Runnable() { + @Override public void run() { // Here editor.isEditXmlModelPending returns true and it // is safe to edit the model using any method from INode. @@ -226,14 +235,17 @@ public class NodeProxy implements INode { } } + @Override public INode appendChild(String viewFqcn) { return insertOrAppend(viewFqcn, -1); } + @Override public INode insertChildAt(String viewFqcn, int index) { return insertOrAppend(viewFqcn, index); } + @Override public void removeChild(INode node) { checkEditOK(); @@ -299,6 +311,7 @@ public class NodeProxy implements INode { return newNode; } + @Override public boolean setAttribute(String uri, String name, String value) { checkEditOK(); UiAttributeNode attr = mNode.setAttributeValue(name, uri, value, true /* override */); @@ -323,6 +336,7 @@ public class NodeProxy implements INode { return attr != null; } + @Override public String getStringAttr(String uri, String attrName) { UiElementNode uiNode = mNode; @@ -355,6 +369,7 @@ public class NodeProxy implements INode { return null; } + @Override public IAttributeInfo getAttributeInfo(String uri, String attrName) { UiElementNode uiNode = mNode; @@ -375,6 +390,7 @@ public class NodeProxy implements INode { return null; } + @Override public IAttributeInfo[] getDeclaredAttributes() { AttributeDescriptor[] descs = mNode.getAttributeDescriptors(); @@ -388,6 +404,7 @@ public class NodeProxy implements INode { return infos; } + @Override public List<String> getAttributeSources() { ElementDescriptor descriptor = mNode.getDescriptor(); if (descriptor instanceof ViewElementDescriptor) { @@ -397,6 +414,7 @@ public class NodeProxy implements INode { } } + @Override public IAttribute[] getLiveAttributes() { UiElementNode uiNode = mNode; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java index 8ece903..7c3cc39 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java @@ -482,6 +482,7 @@ public class RulesEngine { // fill the parent.) if (!editor.isEditXmlModelPending()) { editor.wrapEditXmlModel(new Runnable() { + @Override public void run() { callCreateHooks(editor, insertType, parentRule, parentNode, childRule, newNode); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java index 5b4b734..665a923 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java @@ -440,11 +440,13 @@ public class ViewMetadataRepository { // Implements Iterable<ViewData> such that we can use for-each on the category to // enumerate its views + @Override public Iterator<ViewData> iterator() { return mViews.iterator(); } // Implements Comparable<CategoryData> such that categories can be naturally sorted + @Override public int compareTo(CategoryData other) { return mOrdinal - other.mOrdinal; } @@ -514,6 +516,7 @@ public class ViewMetadataRepository { } // Implements Comparable<ViewData> such that views can be sorted naturally + @Override public int compareTo(ViewData other) { return mOrdinal - other.mOrdinal; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutWizard.java index d9a869e..daeeeba 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutWizard.java @@ -72,6 +72,7 @@ class ChangeLayoutWizard extends VisualRefactoringWizard { mOldType = oldType; } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewWizard.java index f235cf6..84e1c8a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewWizard.java @@ -79,6 +79,7 @@ class ChangeViewWizard extends VisualRefactoringWizard { mOldType = oldType; } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java index a9b0a8f..2e69501 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java @@ -447,6 +447,7 @@ public class ExtractIncludeRefactoring extends VisualRefactoring { public Change perform(IProgressMonitor pm) throws CoreException { Display display = AdtPlugin.getDisplay(); display.asyncExec(new Runnable() { + @Override public void run() { openFile(file); mEditor.getGraphicalEditor().refreshProjectResources(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeWizard.java index 102390f..113a7c0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeWizard.java @@ -59,6 +59,7 @@ class ExtractIncludeWizard extends VisualRefactoringWizard { mSuggestedName = suggestedName; } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); 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 7acfe98..be5223d 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 @@ -98,6 +98,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { mSuggestedName = suggestedName; } + @Override public void createControl(Composite parent) { initialize(); @@ -160,6 +161,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { mCheckedView.setCheckedElements(initialSelection); mCheckedView.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { // Try to disable other elements that conflict with this boolean isChecked = event.getChecked(); @@ -238,6 +240,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { // Sort the items by attribute name -- the attribute name is the key // in the entry set above. Collections.sort(mRoot, new Comparator<Map.Entry<String, List<Attr>>>() { + @Override public int compare(Map.Entry<String, List<Attr>> e1, Map.Entry<String, List<Attr>> e2) { return e1.getKey().compareTo(e2.getKey()); @@ -267,6 +270,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { // wizard. List<Attr> attrList = entry.getValue(); Collections.sort(attrList, new Comparator<Attr>() { + @Override public int compare(Attr a1, Attr a2) { return a1.getValue().compareTo(a2.getValue()); } @@ -299,6 +303,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { // Sort the values by frequency (and for equal frequencies, alphabetically // by value) Collections.sort(uniqueValueAttrs, new Comparator<Attr>() { + @Override public int compare(Attr a1, Attr a2) { Integer f1 = mFrequencyCount.get(a1); Integer f2 = mFrequencyCount.get(a2); @@ -406,6 +411,7 @@ class ExtractStyleWizard extends VisualRefactoringWizard { public ArgumentContentProvider() { } + @Override public Object[] getElements(Object inputElement) { if (inputElement == mRoot) { return mAllAttributes.toArray(); @@ -414,9 +420,11 @@ class ExtractStyleWizard extends VisualRefactoringWizard { return new Object[0]; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/JavaQuickAssistant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/JavaQuickAssistant.java index ba6c614..df5d9ea 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/JavaQuickAssistant.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/JavaQuickAssistant.java @@ -33,10 +33,12 @@ public class JavaQuickAssistant implements org.eclipse.jdt.ui.text.java.IQuickAs public JavaQuickAssistant() { } + @Override public boolean hasAssists(IInvocationContext context) throws CoreException { return true; } + @Override public IJavaCompletionProposal[] getAssists(IInvocationContext context, IProblemLocation[] locations) throws CoreException { // We should only offer Android quick assists within Android projects. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java index c2425fc..22976f8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java @@ -66,14 +66,17 @@ public class RefactoringAssistant implements IQuickAssistProcessor { public RefactoringAssistant() { } + @Override public boolean canAssist(IQuickAssistInvocationContext invocationContext) { return true; } + @Override public boolean canFix(Annotation annotation) { return true; } + @Override public ICompletionProposal[] computeQuickAssistProposals( IQuickAssistInvocationContext invocationContext) { @@ -214,6 +217,7 @@ public class RefactoringAssistant implements IQuickAssistProcessor { } } + @Override public String getErrorMessage() { return null; } @@ -229,6 +233,7 @@ public class RefactoringAssistant implements IQuickAssistProcessor { mRefactoring = refactoring; } + @Override public void apply(IDocument document) { RefactoringWizard wizard = null; if (mRefactoring instanceof VisualRefactoring) { @@ -248,22 +253,27 @@ public class RefactoringAssistant implements IQuickAssistProcessor { } } + @Override public String getAdditionalProposalInfo() { return String.format("Initiates the \"%1$s\" refactoring", mRefactoring.getName()); } + @Override public IContextInformation getContextInformation() { return null; } + @Override public String getDisplayString() { return mRefactoring.getName(); } + @Override public Image getImage() { return AdtPlugin.getAndroidLogo(); } + @Override public Point getSelection(IDocument document) { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java index e3895d3..b53eb9d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java @@ -1401,6 +1401,7 @@ class RelativeLayoutConversionHelper { mRowSort = rowSort; } + @Override public int compare(View view1, View view2) { if (mRowSort) { return view1.mRow - view2.mRow; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java index 7d2ca58..24140ef 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java @@ -548,6 +548,7 @@ public abstract class VisualRefactoring extends Refactoring { if (skip.size() > 0) { Collections.sort(skip, new Comparator<IndexedRegion>() { // Sort in start order + @Override public int compare(IndexedRegion r1, IndexedRegion r2) { return r1.getStartOffset() - r2.getStartOffset(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringAction.java index 151ff0a..39a56c5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringAction.java @@ -45,10 +45,12 @@ abstract class VisualRefactoringAction implements IWorkbenchWindowActionDelegate /** * Keep track of the current workbench window. */ + @Override public void init(IWorkbenchWindow window) { mWindow = window; } + @Override public void dispose() { } @@ -57,6 +59,7 @@ abstract class VisualRefactoringAction implements IWorkbenchWindowActionDelegate * <p/> * Keep a link to the relevant selection structure */ + @Override public void selectionChanged(IAction action, ISelection selection) { // Look for selections in XML and in the layout UI editor @@ -98,6 +101,7 @@ abstract class VisualRefactoringAction implements IWorkbenchWindowActionDelegate /** * Create a new instance of our refactoring and a wizard to configure it. */ + @Override public abstract void run(IAction action); /** diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringWizard.java index 2b6f25e..d55453f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoringWizard.java @@ -54,6 +54,7 @@ public abstract class VisualRefactoringWizard extends RefactoringWizard { * modifications of the associated widget to validate the page again */ protected ModifyListener mModifyValidateListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInWizard.java index 11022a2..84979d7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInWizard.java @@ -79,6 +79,7 @@ public class WrapInWizard extends VisualRefactoringWizard { mOldType = oldType; } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java index 6a50689..cda079d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java @@ -235,6 +235,7 @@ public final class ManifestEditor extends AndroidXmlEditor { updateFromExistingMarkers(inputFile); mMarkerMonitor = new IFileListener() { + @Override public void fileChanged(IFile file, IMarkerDelta[] markerDeltas, int kind) { if (file.equals(inputFile)) { processMarkerChanges(markerDeltas); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/AndroidManifestDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/AndroidManifestDescriptors.java index bb35c01..65cf50a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/AndroidManifestDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/AndroidManifestDescriptors.java @@ -121,10 +121,12 @@ public final class AndroidManifestDescriptors implements IDescriptorProvider { new AttributeInfo(PACKAGE_ATTR, new Format[] { Format.REFERENCE }) ); } + @Override public ElementDescriptor[] getRootElementDescriptors() { return new ElementDescriptor[] { MANIFEST_ELEMENT }; } + @Override public ElementDescriptor getDescriptor() { return getManifestElement(); } @@ -245,6 +247,7 @@ public final class AndroidManifestDescriptors implements IDescriptorProvider { final String className) { overrides.put(elementName + "/" + ANDROID_NAME_ATTR, new ITextAttributeCreator() { + @Override public TextAttributeDescriptor create(String xmlName, String uiName, String nsUri, String tooltip, IAttributeInfo attrInfo) { uiName += "*"; //$NON-NLS-1$ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ApplicationAttributeDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ApplicationAttributeDescriptor.java index 38fc2de..840f673 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ApplicationAttributeDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ApplicationAttributeDescriptor.java @@ -37,6 +37,7 @@ public class ApplicationAttributeDescriptor extends TextAttributeDescriptor { * Used by {@link DescriptorsUtils} to create instances of this descriptor. */ public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { + @Override public TextAttributeDescriptor create(String xmlLocalName, String uiName, String nsUri, String tooltip, IAttributeInfo attrInfo) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ManifestPkgAttrDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ManifestPkgAttrDescriptor.java index 5edb39b..4d6941f 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ManifestPkgAttrDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ManifestPkgAttrDescriptor.java @@ -35,6 +35,7 @@ public class ManifestPkgAttrDescriptor extends TextAttributeDescriptor { * Used by {@link DescriptorsUtils} to create instances of this descriptor. */ public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { + @Override public TextAttributeDescriptor create(String xmlLocalName, String uiName, String nsUri, String tooltip, IAttributeInfo attrInfo) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostActivityCreationAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostActivityCreationAction.java index 6338a2f..ee88ab6 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostActivityCreationAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostActivityCreationAction.java @@ -48,6 +48,7 @@ class PostActivityCreationAction implements IPostTypeCreationAction { * Processes a newly created Activity. * */ + @Override public void processNewType(IType newType) { try { String methodContent = diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostReceiverCreationAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostReceiverCreationAction.java index 834cd41..eb766db 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostReceiverCreationAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PostReceiverCreationAction.java @@ -47,6 +47,7 @@ class PostReceiverCreationAction implements IPostTypeCreationAction { * Processes a newly created Activity. * */ + @Override public void processNewType(IType newType) { try { String methodContent = diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ThemeAttributeDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ThemeAttributeDescriptor.java index c078562..f016e61 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ThemeAttributeDescriptor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/ThemeAttributeDescriptor.java @@ -36,6 +36,7 @@ public final class ThemeAttributeDescriptor extends TextAttributeDescriptor { * Used by {@link DescriptorsUtils} to create instances of this descriptor. */ public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { + @Override public TextAttributeDescriptor create(String xmlLocalName, String uiName, String nsUri, String tooltip, IAttributeInfo attrInfo) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java index 7b1f4fa..8387f97 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java @@ -16,8 +16,8 @@ package com.android.ide.eclipse.adt.internal.editors.manifest.model; -import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtConstants; +import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor; import com.android.ide.eclipse.adt.internal.editors.descriptors.TextAttributeDescriptor; @@ -112,6 +112,7 @@ public class UiClassAttributeNode extends UiTextAttributeNode { @Override public ITypeInfoFilterExtension getFilterExtension() { return new ITypeInfoFilterExtension() { + @Override public boolean select(ITypeInfoRequestor typeInfoRequestor) { boolean projectOnly = mUseProjectOnly; @@ -291,6 +292,7 @@ public class UiClassAttributeNode extends UiTextAttributeNode { @Override protected void onAddValidators(final Text text) { ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { try { String textValue = text.getText().trim(); @@ -327,6 +329,7 @@ public class UiClassAttributeNode extends UiTextAttributeNode { // Make sure the validator removes its message(s) when the widget is disposed text.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { // we don't want to use setErrorMessage, because we don't want to reset // the error flag in the UiAttributeNode diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiManifestPkgAttrNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiManifestPkgAttrNode.java index cd6e9bb..0b6ae5d 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiManifestPkgAttrNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiManifestPkgAttrNode.java @@ -144,6 +144,7 @@ public class UiManifestPkgAttrNode extends UiTextAttributeNode { @Override protected void onAddValidators(final Text text) { ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String package_name = text.getText(); if (package_name.indexOf('.') < 1) { @@ -160,6 +161,7 @@ public class UiManifestPkgAttrNode extends UiTextAttributeNode { // Make sure the validator removes its message(s) when the widget is disposed text.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { getManagedForm().getMessageManager().removeMessage(text, text); } @@ -178,24 +180,30 @@ public class UiManifestPkgAttrNode extends UiTextAttributeNode { ElementListSelectionDialog dialog = new ElementListSelectionDialog( getTextWidget().getShell(), new ILabelProvider() { + @Override public Image getImage(Object element) { return null; } + @Override public String getText(Object element) { return element.toString(); } + @Override public void addListener(ILabelProviderListener listener) { } + @Override public void dispose() { } + @Override public boolean isLabelProperty(Object element, String property) { return false; } + @Override public void removeListener(ILabelProviderListener listener) { } }); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiPackageAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiPackageAttributeNode.java index c7a5e28..e6a2007 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiPackageAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiPackageAttributeNode.java @@ -109,7 +109,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { }); formText.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE)); SectionHelper.addControlTooltip(formText, desc.getTooltip()); - + Composite composite = toolkit.createComposite(parent); composite.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.MIDDLE)); GridLayout gl = new GridLayout(2, false); @@ -118,7 +118,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { // Fixes missing text borders under GTK... also requires adding a 1-pixel margin // for the text field below toolkit.paintBordersFor(composite); - + final Text text = toolkit.createText(composite, getCurrentValue()); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalIndent = 1; // Needed by the fixed composite borders under GTK @@ -127,7 +127,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { setTextWidget(text); Button browseButton = toolkit.createButton(composite, "Browse...", SWT.PUSH); - + browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -135,15 +135,16 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { doBrowseClick(); } }); - + } - + /* (non-java doc) * Adds a validator to the text field that calls managedForm.getMessageManager(). */ @Override protected void onAddValidators(final Text text) { ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String package_name = text.getText(); if (package_name.indexOf('.') < 1) { @@ -160,6 +161,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { // Make sure the validator removes its message(s) when the widget is disposed text.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { getManagedForm().getMessageManager().removeMessage(text, text); } @@ -174,11 +176,11 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { * */ private void doBrowseClick() { Text text = getTextWidget(); - + // we need to get the project of the manifest. IProject project = getProject(); if (project != null) { - + try { SelectionDialog dlg = JavaUI.createPackageDialog(text.getShell(), JavaCore.create(project), 0); @@ -203,7 +205,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { private void doLabelClick() { // get the current package name String package_name = getTextWidget().getText().trim(); - + if (package_name.length() == 0) { createNewPackage(); } else { @@ -237,7 +239,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { /** * Utility method that returns the project for the current file being edited. - * + * * @return The IProject for the current file being edited or null. */ private IProject getProject() { @@ -249,14 +251,14 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { IFile file = ((IFileEditorInput)input).getFile(); return file.getProject(); } - + return null; } /** * Utility method that computes and returns the list of {@link IPackageFragmentRoot} * corresponding to the source folder of the specified project. - * + * * @param project the project * @return an array of IPackageFragmentRoot. Can be empty but not null. */ @@ -276,7 +278,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { return result.toArray(new IPackageFragmentRoot[result.size()]); } - + /** * Utility method that sets the package's text field to the package fragment's name. * */ @@ -284,16 +286,16 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { Text text = getTextWidget(); String name = type.getElementName(); - + text.setText(name); } - + /** * Displays and handles a "Create Package Wizard". - * + * * This is invoked by doLabelClick() when clicking on the hyperlink label with an - * empty package text field. + * empty package text field. */ private void createNewPackage() { OpenNewPackageWizardAction action = new OpenNewPackageWizardAction(); @@ -309,7 +311,7 @@ public class UiPackageAttributeNode extends UiTextAttributeNode { setPackageTextField((IPackageFragment) element); } } - + @Override public String[] getPossibleValues(String prefix) { // TODO: compute a list of existing packages for content assist completion diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationAttributesPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationAttributesPart.java index c9f82dd..7d3f6a8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationAttributesPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationAttributesPart.java @@ -42,7 +42,7 @@ final class ApplicationAttributesPart extends UiElementPart { /** Listen to changes to the UI node for <application> and updates the UI */ private AppNodeUpdateListener mAppNodeUpdateListener; - /** ManagedForm needed to create the UI controls */ + /** ManagedForm needed to create the UI controls */ private IManagedForm mManagedForm; public ApplicationAttributesPart(Composite body, FormToolkit toolkit, ManifestEditor editor, @@ -52,7 +52,7 @@ final class ApplicationAttributesPart extends UiElementPart { "Defines the attributes specific to the application.", // section description Section.TWISTIE | Section.EXPANDED); } - + /** * Changes and refreshes the Application UI node handle by the this part. */ @@ -70,12 +70,12 @@ final class ApplicationAttributesPart extends UiElementPart { * <code>initialize</code> (i.e. right after the form part is added to the managed form.) * <p/> * Derived classes can override this if necessary. - * + * * @param managedForm The owner managed form */ @Override protected void createFormControls(final IManagedForm managedForm) { - mManagedForm = managedForm; + mManagedForm = managedForm; setTable(createTableLayout(managedForm.getToolkit(), 4 /* numColumns */)); mAppNodeUpdateListener = new AppNodeUpdateListener(); @@ -83,7 +83,7 @@ final class ApplicationAttributesPart extends UiElementPart { createUiAttributes(mManagedForm); } - + @Override public void dispose() { super.dispose(); @@ -99,17 +99,17 @@ final class ApplicationAttributesPart extends UiElementPart { if (table == null || managedForm == null) { return; } - - // Remove any old UI controls + + // Remove any old UI controls for (Control c : table.getChildren()) { c.dispose(); } - - UiElementNode uiElementNode = getUiElementNode(); + + UiElementNode uiElementNode = getUiElementNode(); AttributeDescriptor[] attr_desc_list = uiElementNode.getAttributeDescriptors(); // Display the attributes in 2 columns: - // attr 0 | attr 4 + // attr 0 | attr 4 // attr 1 | attr 5 // attr 2 | attr 6 // attr 3 | attr 7 @@ -136,7 +136,7 @@ final class ApplicationAttributesPart extends UiElementPart { uiElementNode.getDescriptor().getXmlName()); } } - + if (n == 0) { createLabel(table, managedForm.getToolkit(), "No attributes to display, waiting for SDK to finish loading...", @@ -147,7 +147,7 @@ final class ApplicationAttributesPart extends UiElementPart { if (mAppNodeUpdateListener != null) { mAppNodeUpdateListener.uiElementNodeUpdated(uiElementNode, null /* state, not used */); } - + // Tell the section that the layout has changed. layoutChanged(); } @@ -155,7 +155,8 @@ final class ApplicationAttributesPart extends UiElementPart { /** * This listener synchronizes the UI with the actual presence of the application XML node. */ - private class AppNodeUpdateListener implements IUiUpdateListener { + private class AppNodeUpdateListener implements IUiUpdateListener { + @Override public void uiElementNodeUpdated(UiElementNode ui_node, UiUpdateState state) { // The UiElementNode for the application XML node always exists, even // if there is no corresponding XML node in the XML file. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationPage.java index 96cb0a6..06a3d3f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationPage.java @@ -60,6 +60,7 @@ public final class ApplicationPage extends FormPage implements IPageImageProvide mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon(getTitle(), IconFactory.COLOR_BLUE, diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java index 8b20cd1..d4bb476 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java @@ -21,8 +21,8 @@ import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestEditor; import com.android.ide.eclipse.adt.internal.editors.ui.UiElementPart; import com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener; -import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; import com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState; +import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import org.eclipse.swt.SWT; @@ -161,6 +161,7 @@ final class ApplicationToggle extends UiElementPart { ? "Create or restore Application node" : "Remove Application node", new Runnable() { + @Override public void run() { if (mCheckbox.getSelection()) { // The user wants an <application> node. @@ -288,6 +289,7 @@ final class ApplicationToggle extends UiElementPart { * actual presence of the application XML node. */ private class AppNodeUpdateListener implements IUiUpdateListener { + @Override public void uiElementNodeUpdated(UiElementNode ui_node, UiUpdateState state) { // The UiElementNode for the application XML node always exists, even // if there is no corresponding XML node in the XML file. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/InstrumentationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/InstrumentationPage.java index e630862..a8bb346 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/InstrumentationPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/InstrumentationPage.java @@ -47,6 +47,7 @@ public final class InstrumentationPage extends FormPage implements IPageImagePro mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon(getTitle(), IconFactory.COLOR_GREEN, diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/OverviewPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/OverviewPage.java index 84ba67f..7464f6a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/OverviewPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/OverviewPage.java @@ -64,6 +64,7 @@ public final class OverviewPage extends FormPage implements IPageImageProvider { mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon("editor_page_design"); //$NON-NLS-1$ } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/PermissionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/PermissionPage.java index 863db03..2f65577 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/PermissionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/PermissionPage.java @@ -51,6 +51,7 @@ public final class PermissionPage extends FormPage implements IPageImageProvider mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon(getTitle(), IconFactory.COLOR_RED, diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuTreePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuTreePage.java index f7e6322..d23fc93 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuTreePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuTreePage.java @@ -42,6 +42,7 @@ public final class MenuTreePage extends FormPage implements IPageImageProvider { mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon("editor_page_design"); //$NON-NLS-1$ } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/descriptors/MenuDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/descriptors/MenuDescriptors.java index e80333d..d9e9ac5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/descriptors/MenuDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/descriptors/MenuDescriptors.java @@ -42,10 +42,12 @@ public final class MenuDescriptors implements IDescriptorProvider { private ElementDescriptor mDescriptor = null; /** @return the root descriptor. */ + @Override public ElementDescriptor getDescriptor() { return mDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mDescriptor.getChildren(); } @@ -98,7 +100,7 @@ public final class MenuDescriptors implements IDescriptorProvider { false /* mandatory */); ElementDescriptor sub_menu = createElement(styleMap, - MENU_ROOT_ELEMENT, // xmlName //$NON-NLS-1$ + MENU_ROOT_ELEMENT, // xmlName "Sub-Menu", // uiName, null, // TODO SDK URL null, // extraAttribute diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/ResourcesTreePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/ResourcesTreePage.java index f352cfa..55e2503 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/ResourcesTreePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/ResourcesTreePage.java @@ -47,6 +47,7 @@ public final class ResourcesTreePage extends FormPage implements IPageImageProvi mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon("editor_page_design"); //$NON-NLS-1$ } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/descriptors/ResourcesDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/descriptors/ResourcesDescriptors.java index 166b6c9..72d7a73 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/descriptors/ResourcesDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/descriptors/ResourcesDescriptors.java @@ -61,10 +61,12 @@ public final class ResourcesDescriptors implements IDescriptorProvider { /* * @see com.android.ide.eclipse.editors.descriptors.IDescriptorProvider#getRootElementDescriptors() */ + @Override public ElementDescriptor[] getRootElementDescriptors() { return new ElementDescriptor[] { mResourcesElement }; } + @Override public ElementDescriptor getDescriptor() { return mResourcesElement; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/uimodel/UiColorValueNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/uimodel/UiColorValueNode.java index e788e0b..fafcb63 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/uimodel/UiColorValueNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/resources/uimodel/UiColorValueNode.java @@ -40,19 +40,20 @@ public class UiColorValueNode extends UiTextValueNode { /** Accepted RGBA formats are one of #RGB, #ARGB, #RRGGBB or #AARRGGBB. */ private static final Pattern RGBA_REGEXP = Pattern.compile( "#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})"); //$NON-NLS-1$ - + public UiColorValueNode(TextValueDescriptor attributeDescriptor, UiElementNode uiParent) { super(attributeDescriptor, uiParent); } /* (non-java doc) - * + * * Add a modify listener that will check colors have the proper format, * that is one of #RGB, #ARGB, #RRGGBB or #AARRGGBB. */ @Override protected void onAddValidators(final Text text) { ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String color = text.getText(); if (RGBA_REGEXP.matcher(color).matches()) { @@ -69,6 +70,7 @@ public class UiColorValueNode extends UiTextValueNode { // Make sure the validator removes its message(s) when the widget is disposed text.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { getManagedForm().getMessageManager().removeMessage(text, text); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/EditableDialogCellEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/EditableDialogCellEditor.java index 85b66a7..28a9154 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/EditableDialogCellEditor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/EditableDialogCellEditor.java @@ -102,6 +102,7 @@ public abstract class EditableDialogCellEditor extends DialogCellEditor { } }); text.addTraverseListener(new TraverseListener() { + @Override public void keyTraversed(TraverseEvent e) { if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN) { @@ -245,6 +246,7 @@ public abstract class EditableDialogCellEditor extends DialogCellEditor { private ModifyListener getModifyListener() { if (modifyListener == null) { modifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { editOccured(e); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/SectionHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/SectionHelper.java index 9e90c5b..fc82b22 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/SectionHelper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/SectionHelper.java @@ -303,19 +303,23 @@ public final class SectionHelper { ic.setVisible(false); // initially hidden control.addMouseTrackListener(new MouseTrackListener() { + @Override public void mouseEnter(MouseEvent e) { } + @Override public void mouseExit(MouseEvent e) { ic.setVisible(false); } + @Override public void mouseHover(MouseEvent e) { ic.setLocation(control.toDisplay(10, 25)); // same offset as in PDETextHover ic.setVisible(true); } }); control.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { ic.dispose(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/UiElementPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/UiElementPart.java index c2e4f0f..db9fa06 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/UiElementPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/UiElementPart.java @@ -71,7 +71,7 @@ public class UiElementPart extends ManifestSectionPart { public ManifestEditor getEditor() { return mEditor; } - + /** * Returns the {@link UiElementNode} associated with this part. */ @@ -81,13 +81,13 @@ public class UiElementPart extends ManifestSectionPart { /** * Changes the element node handled by this part. - * - * @param uiElementNode The new element node for the part. + * + * @param uiElementNode The new element node for the part. */ public void setUiElementNode(UiElementNode uiElementNode) { mUiElementNode = uiElementNode; } - + /** * Initializes the form part. * <p/> @@ -108,7 +108,7 @@ public class UiElementPart extends ManifestSectionPart { * <br/> * Derived class override this if needed, however in most cases the default * implementation should be enough. - * + * * @param sectionTitle The section part's title * @param sectionDescription The section part's description */ @@ -125,7 +125,7 @@ public class UiElementPart extends ManifestSectionPart { * <code>initialize</code> (i.e. right after the form part is added to the managed form.) * <p/> * Derived classes can override this if necessary. - * + * * @param managedForm The owner managed form */ protected void createFormControls(IManagedForm managedForm) { @@ -150,7 +150,7 @@ public class UiElementPart extends ManifestSectionPart { /** * Add all the attribute UI widgets into the underlying table layout. - * + * * @param managedForm The owner managed form */ protected void createUiAttributes(IManagedForm managedForm) { @@ -159,7 +159,7 @@ public class UiElementPart extends ManifestSectionPart { return; } - // Remove any old UI controls + // Remove any old UI controls for (Control c : table.getChildren()) { c.dispose(); } @@ -171,20 +171,20 @@ public class UiElementPart extends ManifestSectionPart { } /** - * Actually fills the table. + * Actually fills the table. * This is called by {@link #createUiAttributes(IManagedForm)} to populate the new * table. The default implementation is to use * {@link #insertUiAttributes(UiElementNode, Composite, IManagedForm)} to actually * place the attributes of the default {@link UiElementNode} in the table. * <p/> * Derived classes can override this to add controls in the table before or after. - * + * * @param table The table to fill. It must have 2 columns. * @param managedForm The managed form for new controls. */ protected void fillTable(Composite table, IManagedForm managedForm) { int inserted = insertUiAttributes(mUiElementNode, table, managedForm); - + if (inserted == 0) { createLabel(table, managedForm.getToolkit(), "No attributes to display, waiting for SDK to finish loading...", @@ -194,7 +194,7 @@ public class UiElementPart extends ManifestSectionPart { /** * Insert the UI attributes of the given {@link UiElementNode} in the given table. - * + * * @param uiNode The {@link UiElementNode} that contains the attributes to display. * Must not be null. * @param table The table to fill. It must have 2 columns. @@ -237,7 +237,7 @@ public class UiElementPart extends ManifestSectionPart { * <p/> * This is done by iterating over all attributes and updating the super's * internal dirty flag. Stop once at least one attribute is dirty. - * + * * @return <code>true</code> if the part is dirty, <code>false</code> * otherwise. */ @@ -253,11 +253,11 @@ public class UiElementPart extends ManifestSectionPart { } return super.isDirty(); } - + /** * If part is displaying information loaded from a model, this method * instructs it to commit the new (modified) data back into the model. - * + * * @param onSave * indicates if commit is called during 'save' operation or for * some other reason (for example, if form is contained in a @@ -268,6 +268,7 @@ public class UiElementPart extends ManifestSectionPart { public void commit(boolean onSave) { if (mUiElementNode != null) { mEditor.wrapEditXmlModel(new Runnable() { + @Override public void run() { for (UiAttributeNode ui_attr : mUiElementNode.getAllUiAttributes()) { ui_attr.commit(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/NewItemSelectionDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/NewItemSelectionDialog.java index 287f5a6..1187f5c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/NewItemSelectionDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/NewItemSelectionDialog.java @@ -41,8 +41,8 @@ import org.eclipse.ui.part.FileEditorInput; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.TreeMap; import java.util.Map.Entry; +import java.util.TreeMap; /** * A selection dialog to select the type of the new element node to @@ -105,6 +105,7 @@ public class NewItemSelectionDialog extends AbstractElementListSelectionDialog { setMultipleSelection(false); setValidator(new ISelectionStatusValidator() { + @Override public IStatus validate(Object[] selection) { if (selection.length == 1 && selection[0] instanceof ViewElementDescriptor) { return new Status(IStatus.OK, // severity diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/PasteAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/PasteAction.java index ea41e3e..6674ba9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/PasteAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/PasteAction.java @@ -67,6 +67,7 @@ public class PasteAction extends Action { final String data = (String) mClipboard.getContents(TextTransfer.getInstance()); if (data != null) { mEditor.wrapEditXmlModel(new Runnable() { + @Override public void run() { try { IStructuredDocument sse_doc = mEditor.getStructuredDocument(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiActions.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiActions.java index 7b3f378..92ccf2e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiActions.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiActions.java @@ -46,6 +46,7 @@ public abstract class UiActions implements ICommitXml { abstract protected UiElementNode getRootNode(); /** Commits pending data before the XML model is modified. */ + @Override abstract public void commitPendingXmlChanges(); /** @@ -157,6 +158,7 @@ public abstract class UiActions implements ICommitXml { String.format("Do you really want to remove %1$s?", sb.toString()))) { commitPendingXmlChanges(); getRootNode().getEditor().wrapEditXmlModel(new Runnable() { + @Override public void run() { UiElementNode previous = null; UiElementNode parent = null; @@ -200,6 +202,7 @@ public abstract class UiActions implements ICommitXml { commitPendingXmlChanges(); getRootNode().getEditor().wrapEditXmlModel(new Runnable() { + @Override public void run() { for (int i = 0; i < uiNodes.size(); i++) { UiElementNode uiNode = uiLastNode[0] = uiNodes.get(i); @@ -380,6 +383,7 @@ public abstract class UiActions implements ICommitXml { commitPendingXmlChanges(); getRootNode().getEditor().wrapEditXmlModel(new Runnable() { + @Override public void run() { for (int i = nodes.size() - 1; i >= 0; i--) { final UiElementNode node = uiLastNode[0] = nodes.get(i); @@ -583,6 +587,7 @@ public abstract class UiActions implements ICommitXml { UiElementNode rootNode = getRootNode(); rootNode.getEditor().wrapEditXmlModel(new Runnable() { + @Override public void run() { DescriptorsUtils.setDefaultLayoutAttributes(uiNew, updateLayout); uiNew.createXmlNode(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiElementDetail.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiElementDetail.java index 2eca501..972af93 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiElementDetail.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiElementDetail.java @@ -81,6 +81,7 @@ class UiElementDetail implements IDetailsPage { /* (non-java doc) * Initializes the part. */ + @Override public void initialize(IManagedForm form) { mManagedForm = form; } @@ -88,6 +89,7 @@ class UiElementDetail implements IDetailsPage { /* (non-java doc) * Creates the contents of the page in the provided parent. */ + @Override public void createContents(Composite parent) { mMasterSection = createMasterSection(parent); } @@ -97,6 +99,7 @@ class UiElementDetail implements IDetailsPage { * <p/> * Only reply when our master part originates the selection. */ + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (part == mMasterPart && !selection.isEmpty() && @@ -114,9 +117,11 @@ class UiElementDetail implements IDetailsPage { /* (non-java doc) * Instructs it to commit the new (modified) data back into the model. */ + @Override public void commit(boolean onSave) { mTree.getEditor().wrapEditXmlModel(new Runnable() { + @Override public void run() { try { if (mCurrentUiElementNode != null) { @@ -132,6 +137,7 @@ class UiElementDetail implements IDetailsPage { }); } + @Override public void dispose() { // pass } @@ -141,6 +147,7 @@ class UiElementDetail implements IDetailsPage { * Returns true if the part has been modified with respect to the data * loaded from the model. */ + @Override public boolean isDirty() { if (mCurrentUiElementNode != null && mCurrentUiElementNode.isDirty()) { markDirty(); @@ -148,6 +155,7 @@ class UiElementDetail implements IDetailsPage { return mIsDirty; } + @Override public boolean isStale() { // pass return false; @@ -157,6 +165,7 @@ class UiElementDetail implements IDetailsPage { * Called by the master part when the tree is refreshed after the framework resources * have been reloaded. */ + @Override public void refresh() { if (mCurrentTable != null) { mCurrentTable.dispose(); @@ -166,10 +175,12 @@ class UiElementDetail implements IDetailsPage { mMasterSection.getParent().pack(true /* changed */); } + @Override public void setFocus() { // pass } + @Override public boolean setFormInput(Object input) { // pass return false; @@ -334,6 +345,7 @@ class UiElementDetail implements IDetailsPage { final HashSet<UiAttributeNode> reference = new HashSet<UiAttributeNode>(); final IUiUpdateListener updateListener = new IUiUpdateListener() { + @Override public void uiElementNodeUpdated(UiElementNode ui_node, UiUpdateState state) { if (state == UiUpdateState.ATTR_UPDATED) { updateUnknownAttributesSection(ui_node, unknownTable, managedForm, @@ -345,6 +357,7 @@ class UiElementDetail implements IDetailsPage { // remove the listener when the UI is disposed unknownTable.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { ui_node.removeUpdateListener(updateListener); } @@ -383,10 +396,12 @@ class UiElementDetail implements IDetailsPage { // ScrolledPageBook (which is actually a SharedScrolledComposite). This will // recompute the correct size and adjust the scrollbar as needed. section.addExpansionListener(new IExpansionListener() { + @Override public void expansionStateChanged(ExpansionEvent e) { reflowMasterSection(); } + @Override public void expansionStateChanging(ExpansionEvent e) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeContentProvider.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeContentProvider.java index 59260ed..14049cf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeContentProvider.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeContentProvider.java @@ -45,6 +45,7 @@ class UiModelTreeContentProvider implements ITreeContentProvider { /* (non-java doc) * Returns all the UI node children of the given element or null if not the right kind * of object. */ + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof UiElementNode) { UiElementNode node = (UiElementNode) parentElement; @@ -56,6 +57,7 @@ class UiModelTreeContentProvider implements ITreeContentProvider { /* (non-java doc) * Returns the parent of a given UI node or null if it's a root node or it's not the * right kind of node. */ + @Override public Object getParent(Object element) { if (element instanceof UiElementNode) { UiElementNode node = (UiElementNode) element; @@ -66,6 +68,7 @@ class UiModelTreeContentProvider implements ITreeContentProvider { /* (non-java doc) * Returns true if the UI node has any UI children nodes. */ + @Override public boolean hasChildren(Object element) { if (element instanceof UiElementNode) { UiElementNode node = (UiElementNode) element; @@ -84,6 +87,7 @@ class UiModelTreeContentProvider implements ITreeContentProvider { * inputElement is not currently used. The root node and the filter are given * by the enclosing class. */ + @Override public Object[] getElements(Object inputElement) { ArrayList<UiElementNode> roots = new ArrayList<UiElementNode>(); if (mUiRootNode != null) { @@ -103,10 +107,12 @@ class UiModelTreeContentProvider implements ITreeContentProvider { return roots.toArray(); } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeLabelProvider.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeLabelProvider.java index 451a6eb..f2ab512 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeLabelProvider.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiModelTreeLabelProvider.java @@ -40,6 +40,7 @@ public class UiModelTreeLabelProvider implements ILabelProvider { /** * Returns the element's logo with a fallback on the android logo. */ + @Override public Image getImage(Object element) { ElementDescriptor desc = null; UiElementNode node = null; @@ -69,6 +70,7 @@ public class UiModelTreeLabelProvider implements ILabelProvider { /** * Uses UiElementNode.shortDescription for the label for this tree item. */ + @Override public String getText(Object element) { if (element instanceof ElementDescriptor) { ElementDescriptor desc = (ElementDescriptor) element; @@ -80,19 +82,23 @@ public class UiModelTreeLabelProvider implements ILabelProvider { return element.toString(); } + @Override public void addListener(ILabelProviderListener listener) { // pass } + @Override public void dispose() { // pass } + @Override public boolean isLabelProperty(Object element, String property) { // pass return false; } + @Override public void removeListener(ILabelProviderListener listener) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiTreeBlock.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiTreeBlock.java index dd8cbd3..42fd32a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiTreeBlock.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/ui/tree/UiTreeBlock.java @@ -261,6 +261,7 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml // all parts in the managed form. // This is picked up by UiElementDetail.selectionChanged(). mTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { managedForm.fireSelectionChanged(mMasterPart, event.getSelection()); adjustTreeButtons(event.getSelection()); @@ -272,12 +273,14 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml // - One to refresh the tree viewer when the framework resources have changed // - One to enable/disable the UI based on the application node's presence. mUiRefreshListener = new IUiUpdateListener() { + @Override public void uiElementNodeUpdated(UiElementNode ui_node, UiUpdateState state) { mTreeViewer.refresh(); } }; mUiEnableListener = new IUiUpdateListener() { + @Override public void uiElementNodeUpdated(UiElementNode ui_node, UiUpdateState state) { // The UiElementNode for the application XML node always exists, even // if there is no corresponding XML node in the XML file. @@ -336,6 +339,7 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml // Remove listeners when the tree widget gets disposed. tree.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { if (mUiRootNode != null) { UiElementNode node = mUiRootNode.getUiParent() != null ? @@ -486,7 +490,8 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml * tree selection and if it is of the appropriate type it re-creates * the necessary actions. */ - public void menuAboutToShow(IMenuManager manager) { + @Override + public void menuAboutToShow(IMenuManager manager) { ISelection selection = mTreeViewer.getSelection(); if (!selection.isEmpty() && selection instanceof ITreeSelection) { ArrayList<UiElementNode> selected = filterSelection((ITreeSelection) selection); @@ -760,6 +765,7 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml } /* Implements ICommitXml for CopyCutAction */ + @Override public void commitPendingXmlChanges() { commitManagedForm(); } @@ -785,6 +791,7 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml final UiTreeBlock tree = this; inDetailsPart.setPageProvider(new IDetailsPageProvider() { + @Override public IDetailsPage getPage(Object key) { if (key instanceof UiElementNode) { return new UiElementDetail(tree); @@ -792,6 +799,7 @@ public final class UiTreeBlock extends MasterDetailsBlock implements ICommitXml return null; } + @Override public Object getPageKey(Object object) { return object; // use node object as key } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAbstractTextAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAbstractTextAttributeNode.java index 8910839..4f79590 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAbstractTextAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAbstractTextAttributeNode.java @@ -26,7 +26,7 @@ import org.w3c.dom.Node; * <p/> * The XML attribute has no default value. When unset, the text field is blank. * When updating the XML, if the field is empty, the attribute will be removed - * from the XML element. + * from the XML element. * <p/> * See {@link UiAttributeNode} for more information. */ @@ -44,27 +44,28 @@ public abstract class UiAbstractTextAttributeNode extends UiAttributeNode UiElementNode uiParent) { super(attributeDescriptor, uiParent); } - + /** Returns the current value of the node. */ @Override public final String getCurrentValue() { return mCurrentValue; } - + /** Sets the current value of the node. Cannot be null (use an empty string). */ + @Override public final void setCurrentValue(String value) { mCurrentValue = value; } - + /** Returns if the attribute node is valid, and its UI has been created. */ public abstract boolean isValid(); /** Returns the text value present in the UI. */ public abstract String getTextWidgetValue(); - + /** Sets the text value to be displayed in the UI. */ public abstract void setTextWidgetValue(String value); - + /** * Updates the current text field's value when the XML has changed. @@ -108,11 +109,11 @@ public abstract class UiAbstractTextAttributeNode extends UiAttributeNode } } } - + protected final boolean isInInternalTextModification() { return mInternalTextModification; } - + protected final void setInInternalTextModification(boolean internalTextModification) { mInternalTextModification = internalTextModification; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java index 444d90f..d60d286 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java @@ -174,6 +174,7 @@ public abstract class UiAttributeNode implements Comparable<UiAttributeNode> { public abstract void commit(); // ---- Implements Comparable ---- + @Override public int compareTo(UiAttributeNode o) { return compareAttributes(mDescriptor.getXmlLocalName(), o.mDescriptor.getXmlLocalName()); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java index 63a501e..cab6601 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java @@ -691,6 +691,7 @@ public class UiElementNode implements IPropertySource { * The default is to create a new ElementDescriptor wrapping * the unknown XML local name and reuse previously created descriptors. */ + @Override public ElementDescriptor getDescriptor(String xmlLocalName) { ElementDescriptor desc = mMap.get(xmlLocalName); @@ -1924,6 +1925,7 @@ public class UiElementNode implements IPropertySource { // ------ IPropertySource methods + @Override public Object getEditableValue() { return null; } @@ -1935,6 +1937,7 @@ public class UiElementNode implements IPropertySource { * Returns the property descriptor for this node. Since the descriptors are not linked to the * data, the AttributeDescriptor are used directly. */ + @Override public IPropertyDescriptor[] getPropertyDescriptors() { List<IPropertyDescriptor> propDescs = new ArrayList<IPropertyDescriptor>(); @@ -1968,6 +1971,7 @@ public class UiElementNode implements IPropertySource { * Returns the value of a given property. The id is the result of IPropertyDescriptor.getId(), * which return the AttributeDescriptor itself. */ + @Override public Object getPropertyValue(Object id) { HashMap<AttributeDescriptor, UiAttributeNode> attributeMap = getInternalUiAttributes(); @@ -1991,6 +1995,7 @@ public class UiElementNode implements IPropertySource { * * Returns whether the property is set. In our case this is if the string is non empty. */ + @Override public boolean isPropertySet(Object id) { HashMap<AttributeDescriptor, UiAttributeNode> attributeMap = getInternalUiAttributes(); @@ -2016,6 +2021,7 @@ public class UiElementNode implements IPropertySource { * * Reset the property to its default value. For now we simply empty it. */ + @Override public void resetPropertyValue(Object id) { HashMap<AttributeDescriptor, UiAttributeNode> attributeMap = getInternalUiAttributes(); @@ -2043,6 +2049,7 @@ public class UiElementNode implements IPropertySource { * Set the property value. id is the result of IPropertyDescriptor.getId(), which is the * AttributeDescriptor itself. Value should be a String. */ + @Override public void setPropertyValue(Object id, Object value) { HashMap<AttributeDescriptor, UiAttributeNode> attributeMap = getInternalUiAttributes(); @@ -2071,6 +2078,7 @@ public class UiElementNode implements IPropertySource { final UiAttributeNode fAttribute = attribute; AndroidXmlEditor editor = getEditor(); editor.wrapEditXmlModel(new Runnable() { + @Override public void run() { commitAttributeToXml(fAttribute, newValue); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiListAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiListAttributeNode.java index c8e5720..b5b2f71 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiListAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiListAttributeNode.java @@ -88,6 +88,7 @@ public class UiListAttributeNode extends UiAbstractTextAttributeNode { * Sent when the text is modified, whether by the user via manual * input or programmatic input via setText(). */ + @Override public void modifyText(ModifyEvent e) { onComboChange(); } @@ -103,6 +104,7 @@ public class UiListAttributeNode extends UiAbstractTextAttributeNode { // Remove self-reference when the widget is disposed mCombo.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { mCombo = null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java index 4e3e60b..055d432 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java @@ -314,6 +314,7 @@ public class UiResourceAttributeNode extends UiTextAttributeNode { List<String> choices) { final IAttributeInfo attributeInfo = descriptor.getAttributeInfo(); Collections.sort(choices, new Comparator<String>() { + @Override public int compare(String s1, String s2) { int compare = score(attributeInfo, s1) - score(attributeInfo, s2); if (compare == 0) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiTextAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiTextAttributeNode.java index fe0f858..504ac31 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiTextAttributeNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiTextAttributeNode.java @@ -38,7 +38,7 @@ import org.eclipse.ui.forms.widgets.TableWrapData; * <p/> * The XML attribute has no default value. When unset, the text field is blank. * When updating the XML, if the field is empty, the attribute will be removed - * from the XML element. + * from the XML element. * <p/> * See {@link UiAttributeNode} for more information. */ @@ -52,7 +52,7 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { public UiTextAttributeNode(AttributeDescriptor attributeDescriptor, UiElementNode uiParent) { super(attributeDescriptor, uiParent); } - + /* (non-java doc) * Creates a label widget and an associated text field. * <p/> @@ -72,14 +72,14 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { /** * No completion values for this UI attribute. - * + * * {@inheritDoc} */ @Override public String[] getPossibleValues(String prefix) { return null; } - + /** * Sets the internal managed form. * This is usually set by createUiControl. @@ -87,14 +87,14 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { protected void setManagedForm(IManagedForm managedForm) { mManagedForm = managedForm; } - + /** * @return The managed form, set only once createUiControl has been called. */ protected IManagedForm getManagedForm() { return mManagedForm; } - + /* (non-java doc) * Returns if the attribute node is valid, and its UI has been created. */ @@ -108,7 +108,7 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { if (mText != null) { return mText.getText(); } - + return null; } @@ -126,7 +126,7 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { */ protected final void setTextWidget(Text textWidget) { mText = textWidget; - + if (textWidget != null) { // Sets the with hint for the text field. Derived classes can always override it. // This helps the grid layout to resize correctly on smaller screen sizes. @@ -137,7 +137,7 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { } else if (data instanceof TableWrapData) { ((TableWrapData)data).maxWidth = 100; } - + mText.addModifyListener(new ModifyListener() { /** * Sent when the text is modified, whether by the user via manual @@ -146,6 +146,7 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { * Simply mark the attribute as dirty if it really changed. * The container SectionPart will collect these flag and manage them. */ + @Override public void modifyText(ModifyEvent e) { if (!isInInternalTextModification() && !isDirty() && @@ -154,17 +155,18 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { !mText.getText().equals(getCurrentValue())) { setDirty(true); } - } + } }); - + // Remove self-reference when the widget is disposed mText.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { mText = null; } }); } - + onAddValidators(mText); } @@ -179,7 +181,7 @@ public class UiTextAttributeNode extends UiAbstractTextAttributeNode { * <li> Call the validator once to setup the initial messages as needed. * <p/> * The base implementation does nothing. - * + * * @param text The {@link Text} widget to validate. */ protected void onAddValidators(Text text) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/Hyperlinks.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/Hyperlinks.java index c434712..4de6b44 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/Hyperlinks.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/Hyperlinks.java @@ -1104,6 +1104,7 @@ public class Hyperlinks { if (matches.size() > 0) { final ResourceFile fBest = best; Collections.sort(matches, new Comparator<ResourceFile>() { + @Override public int compare(ResourceFile rf1, ResourceFile rf2) { // Sort best item to the front if (rf1 == fBest) { @@ -1155,6 +1156,7 @@ public class Hyperlinks { /** Detector for finding Android references in XML files */ public static class XmlResolver extends AbstractHyperlinkDetector { + @Override public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { @@ -1269,6 +1271,7 @@ public class Hyperlinks { /** Detector for finding Android references in Java files */ public static class JavaResolver extends AbstractHyperlinkDetector { + @Override public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { // Most of this is identical to the builtin JavaElementHyperlinkDetector -- @@ -1385,18 +1388,22 @@ public class Hyperlinks { this.mRegion = mRegion; } + @Override public IRegion getHyperlinkRegion() { return mRegion; } + @Override public String getHyperlinkText() { return "Open XML Declaration"; } + @Override public String getTypeLabel() { return null; } + @Override public void open() { // Lazily compute the location to open if (mXmlContext != null && !Hyperlinks.open(mXmlContext)) { @@ -1438,19 +1445,23 @@ public class Hyperlinks { mFile = file; } + @Override public IRegion getHyperlinkRegion() { return mLinkRegion; } + @Override public String getHyperlinkText() { // return "Open XML Declaration"; return mLinkText; } + @Override public String getTypeLabel() { return null; } + @Override public void open() { // We have to defer computation of ids until the link is clicked since we // don't have a fast map lookup for these diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/XmlTreePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/XmlTreePage.java index 9284796..fb8c899 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/XmlTreePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/XmlTreePage.java @@ -42,6 +42,7 @@ public final class XmlTreePage extends FormPage implements IPageImageProvider { mEditor = editor; } + @Override public Image getPageImage() { return IconFactory.getInstance().getIcon("editor_page_design"); //$NON-NLS-1$ } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/descriptors/XmlDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/descriptors/XmlDescriptors.java index bc74d57..aa6289e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/descriptors/XmlDescriptors.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/descriptors/XmlDescriptors.java @@ -58,10 +58,12 @@ public final class XmlDescriptors implements IDescriptorProvider { private DocumentDescriptor mAppWidgetDescriptor = new DocumentDescriptor("xml_doc", null /* children */); //$NON-NLS-1$ /** @return the root descriptor for both searchable and preferences. */ + @Override public DocumentDescriptor getDescriptor() { return mDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mDescriptor.getChildren(); } @@ -83,10 +85,12 @@ public final class XmlDescriptors implements IDescriptorProvider { public IDescriptorProvider getSearchableProvider() { return new IDescriptorProvider() { + @Override public ElementDescriptor getDescriptor() { return mSearchDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mSearchDescriptor.getChildren(); } @@ -95,10 +99,12 @@ public final class XmlDescriptors implements IDescriptorProvider { public IDescriptorProvider getPreferencesProvider() { return new IDescriptorProvider() { + @Override public ElementDescriptor getDescriptor() { return mPrefDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mPrefDescriptor.getChildren(); } @@ -107,10 +113,12 @@ public final class XmlDescriptors implements IDescriptorProvider { public IDescriptorProvider getAppWidgetProvider() { return new IDescriptorProvider() { + @Override public ElementDescriptor getDescriptor() { return mAppWidgetDescriptor; } + @Override public ElementDescriptor[] getRootElementDescriptors() { return mAppWidgetDescriptor.getChildren(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AMReceiver.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AMReceiver.java index c79a25b..ea61945 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AMReceiver.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AMReceiver.java @@ -26,8 +26,8 @@ import java.util.regex.Pattern; /** * Output receiver for am process (Activity Manager) - * - * Monitors adb output for am errors, and retries launch as appropriate. + * + * Monitors adb output for am errors, and retries launch as appropriate. */ public class AMReceiver extends MultiLineReceiver { @@ -40,12 +40,12 @@ public class AMReceiver extends MultiLineReceiver { /** * Basic constructor. - * + * * @param launchInfo the {@link DelayedLaunchInfo} associated with the am process. * @param device the Android device on which the launch is done. * @param launchController the {@link ILaunchController} that is managing the launch */ - public AMReceiver(DelayedLaunchInfo launchInfo, IDevice device, + public AMReceiver(DelayedLaunchInfo launchInfo, IDevice device, ILaunchController launchController) { mLaunchInfo = launchInfo; mDevice = device; @@ -55,9 +55,9 @@ public class AMReceiver extends MultiLineReceiver { /** * Monitors the am process for error messages. If an error occurs, will reattempt launch up to * <code>MAX_ATTEMPT_COUNT</code> times. - * + * * @param lines a portion of the am output - * + * * @see MultiLineReceiver#processNewLines(String[]) */ @Override @@ -154,6 +154,7 @@ public class AMReceiver extends MultiLineReceiver { /** * Returns true if launch has been cancelled */ + @Override public boolean isCancelled() { return mLaunchInfo.isCancelled(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/ActivityLaunchAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/ActivityLaunchAction.java index 0a6257f..0dcc185 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/ActivityLaunchAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/ActivityLaunchAction.java @@ -51,6 +51,7 @@ public class ActivityLaunchAction implements IAndroidLaunchAction { * * @see IAndroidLaunchAction#doLaunchAction(DelayedLaunchInfo, IDevice) */ + @Override public boolean doLaunchAction(DelayedLaunchInfo info, IDevice device) { String command = "am start" //$NON-NLS-1$ + (info.isDebugMode() ? " -D" //$NON-NLS-1$ @@ -106,6 +107,7 @@ public class ActivityLaunchAction implements IAndroidLaunchAction { * * @see IAndroidLaunchAction#getLaunchDescription() */ + @Override public String getLaunchDescription() { return String.format("%1$s activity launch", mActivity); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java index 25980f1..eb66cce 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java @@ -18,17 +18,17 @@ package com.android.ide.eclipse.adt.internal.launch; import com.android.ddmlib.AdbCommandRejectedException; import com.android.ddmlib.AndroidDebugBridge; +import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; +import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener; +import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import com.android.ddmlib.CanceledException; import com.android.ddmlib.Client; import com.android.ddmlib.ClientData; +import com.android.ddmlib.ClientData.DebuggerStatus; import com.android.ddmlib.IDevice; import com.android.ddmlib.InstallException; import com.android.ddmlib.Log; import com.android.ddmlib.TimeoutException; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; -import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener; -import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; -import com.android.ddmlib.ClientData.DebuggerStatus; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.actions.AvdManagerAction; import com.android.ide.eclipse.adt.internal.launch.AndroidLaunchConfiguration.TargetMode; @@ -509,6 +509,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener final boolean[] searchAgain = new boolean[] { false }; // ask the user to create a new one. display.syncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); if (MessageDialog.openQuestion(shell, "Android AVD Error", @@ -572,6 +573,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener // bring up the device chooser. final IAndroidTarget desiredProjectTarget = projectTarget; AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { try { // open the chooser dialog. It'll fill 'response' with the device to use @@ -1187,6 +1189,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * @param info the {@link DelayedLaunchInfo} that indicates the launch action * @param device the device or emulator to launch the application on */ + @Override public void launchApp(final DelayedLaunchInfo info, IDevice device) { if (info.isDebugMode()) { synchronized (sListLock) { @@ -1388,6 +1391,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * * @see IDebugBridgeChangeListener#bridgeChanged(AndroidDebugBridge) */ + @Override public void bridgeChanged(AndroidDebugBridge bridge) { // The adb server has changed. We cancel any pending launches. String message = "adb server change: cancelling '%1$s'!"; @@ -1417,6 +1421,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * * @see IDeviceChangeListener#deviceConnected(IDevice) */ + @Override public void deviceConnected(IDevice device) { synchronized (sListLock) { // look if there's an app waiting for a device @@ -1451,6 +1456,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * * @see IDeviceChangeListener#deviceDisconnected(IDevice) */ + @Override @SuppressWarnings("unchecked") public void deviceDisconnected(IDevice device) { // any pending launch on this device must be canceled. @@ -1487,6 +1493,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * * @see IDeviceChangeListener#deviceChanged(IDevice, int) */ + @Override public void deviceChanged(IDevice device, int changeMask) { // We could check if any starting device we care about is now ready, but we can wait for // its home app to show up, so... @@ -1505,6 +1512,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, int changeMask) { boolean connectDebugger = false; if ((changeMask & Client.CHANGE_NAME) == Client.CHANGE_NAME) { @@ -1712,6 +1720,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener /* (non-Javadoc) * @see com.android.ide.eclipse.adt.launch.ILaunchController#stopLaunch(com.android.ide.eclipse.adt.launch.AndroidLaunchController.DelayedLaunchInfo) */ + @Override public void stopLaunch(DelayedLaunchInfo launchInfo) { launchInfo.getLaunch().stopLaunch(); synchronized (sListLock) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java index 2c6c2f6..22c9470 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java @@ -93,6 +93,7 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener * a {@link AndroidDebugBridge}. */ private static class ContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof AndroidDebugBridge) { return ((AndroidDebugBridge)inputElement).getDevices(); @@ -101,10 +102,12 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } @@ -117,6 +120,7 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener */ private class LabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { if (element instanceof IDevice) { IDevice device = (IDevice)element; @@ -157,6 +161,7 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof IDevice) { IDevice device = (IDevice)element; @@ -199,19 +204,23 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener return null; } + @Override public void addListener(ILabelProviderListener listener) { // pass } + @Override public void dispose() { // pass } + @Override public boolean isLabelProperty(Object element, String property) { // pass return false; } + @Override public void removeListener(ILabelProviderListener listener) { // pass } @@ -536,9 +545,11 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener * * @see IDeviceChangeListener#deviceConnected(IDevice) */ + @Override public void deviceConnected(IDevice device) { final DeviceChooserDialog dialog = this; exec(new Runnable() { + @Override public void run() { if (mDeviceTable.isDisposed() == false) { // refresh all @@ -568,6 +579,7 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener * * @see IDeviceChangeListener#deviceDisconnected(IDevice) */ + @Override public void deviceDisconnected(IDevice device) { deviceConnected(device); } @@ -581,10 +593,12 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener * * @see IDeviceChangeListener#deviceChanged(IDevice, int) */ + @Override public void deviceChanged(final IDevice device, int changeMask) { if ((changeMask & (IDevice.CHANGE_STATE | IDevice.CHANGE_BUILD_INFO)) != 0) { final DeviceChooserDialog dialog = this; exec(new Runnable() { + @Override public void run() { if (mDeviceTable.isDisposed() == false) { // refresh the device @@ -714,10 +728,12 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener private IDevice[] mDevices; + @Override public void prepare() { mDevices = AndroidDebugBridge.getBridge().getDevices(); } + @Override public boolean accept(AvdInfo avd) { if (mDevices != null) { for (IDevice d : mDevices) { @@ -731,6 +747,7 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener return true; } + @Override public void cleanup() { mDevices = null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmptyLaunchAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmptyLaunchAction.java index 096d72a..053a798 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmptyLaunchAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmptyLaunchAction.java @@ -23,6 +23,7 @@ import com.android.ide.eclipse.adt.AdtPlugin; */ public class EmptyLaunchAction implements IAndroidLaunchAction { + @Override public boolean doLaunchAction(DelayedLaunchInfo info, IDevice device) { // we're not supposed to do anything, just return; String msg = String.format("%1$s installed on device", @@ -32,6 +33,7 @@ public class EmptyLaunchAction implements IAndroidLaunchAction { return false; } + @Override public String getLaunchDescription() { return "sync"; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java index 1fc72fb..99f582c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java @@ -131,6 +131,7 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Font font = parent.getFont(); @@ -291,6 +292,7 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab { gd.horizontalSpan = 2; mEmulatorCLOptions.setLayoutData(gd); mEmulatorCLOptions.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateLaunchConfigurationDialog(); } @@ -300,6 +302,7 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return "Target"; } @@ -322,6 +325,7 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration configuration) { AvdManager avdManager = Sdk.getCurrent().getAvdManager(); @@ -440,6 +444,7 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(LaunchConfigDelegate.ATTR_TARGET_MODE, mAutoTargetButton.getSelection()); @@ -464,6 +469,7 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(LaunchConfigDelegate.ATTR_TARGET_MODE, LaunchConfigDelegate.DEFAULT_TARGET_MODE.getValue()); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigDelegate.java index 04167e3..bc5dcb5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigDelegate.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigDelegate.java @@ -106,6 +106,7 @@ public class LaunchConfigDelegate extends LaunchConfigurationDelegate { public static final String ATTR_DEBUG_PORT = AdtPlugin.PLUGIN_ID + ".debugPort"; //$NON-NLS-1$ + @Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { // We need to check if it's a standard launch or if it's a launch diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigTabGroup.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigTabGroup.java index e1496eb..a68e500 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigTabGroup.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchConfigTabGroup.java @@ -29,6 +29,7 @@ public class LaunchConfigTabGroup extends AbstractLaunchConfigurationTabGroup { public LaunchConfigTabGroup() { } + @Override public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new MainLaunchConfigTab(), diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchShortcut.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchShortcut.java index 3c72d01..3be6027 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchShortcut.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/LaunchShortcut.java @@ -41,6 +41,7 @@ public class LaunchShortcut implements ILaunchShortcut { * @see org.eclipse.debug.ui.ILaunchShortcut#launch( * org.eclipse.jface.viewers.ISelection, java.lang.String) */ + @Override public void launch(ISelection selection, String mode) { if (selection instanceof IStructuredSelection) { @@ -78,6 +79,7 @@ public class LaunchShortcut implements ILaunchShortcut { * @see org.eclipse.debug.ui.ILaunchShortcut#launch( * org.eclipse.ui.IEditorPart, java.lang.String) */ + @Override public void launch(IEditorPart editor, String mode) { // since we force the shortcut to only work on selection in the // package explorer, this will never be called. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java index 7f49bc6..4829c02 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java @@ -87,15 +87,18 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab { */ private class WidgetListener implements ModifyListener, SelectionListener { + @Override public void modifyText(ModifyEvent e) { IProject project = checkParameters(); loadActivities(project); setDirty(true); } + @Override public void widgetDefaultSelected(SelectionEvent e) {/* do nothing */ } + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); if (source == mProjButton) { @@ -109,6 +112,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab { public MainLaunchConfigTab() { } + @Override public void createControl(Composite parent) { mProjectChooserHelper = new ProjectChooserHelper(parent.getShell(), new NonLibraryProjectOnlyFilter()); @@ -198,6 +202,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab { } + @Override public String getName() { return "Android"; } @@ -207,6 +212,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab { return IconFactory.getInstance().getIcon(LAUNCH_TAB_IMAGE); } + @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, mProjText.getText()); @@ -227,6 +233,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab { mapResources(configuration); } + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(LaunchConfigDelegate.ATTR_LAUNCH_ACTION, LaunchConfigDelegate.DEFAULT_LAUNCH_ACTION); @@ -311,6 +318,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab { * * @see ILaunchConfigurationTab */ + @Override public void initializeFrom(ILaunchConfiguration config) { String projectName = EMPTY_STRING; try { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchAction.java index b398a05..efd05f3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchAction.java @@ -42,35 +42,36 @@ import org.eclipse.swt.widgets.Display; class AndroidJUnitLaunchAction implements IAndroidLaunchAction { private final AndroidJUnitLaunchInfo mLaunchInfo; - + /** * Creates a AndroidJUnitLaunchAction. - * - * @param launchInfo the {@link AndroidJUnitLaunchInfo} for the JUnit run + * + * @param launchInfo the {@link AndroidJUnitLaunchInfo} for the JUnit run */ public AndroidJUnitLaunchAction(AndroidJUnitLaunchInfo launchInfo) { mLaunchInfo = launchInfo; } - + /** - * Launch a instrumentation test run on given Android device. + * Launch a instrumentation test run on given Android device. * Reuses JDT JUnit launch delegate so results can be communicated back to JDT JUnit UI. * <p/> * Note: Must be executed on non-UI thread. - * + * * @see IAndroidLaunchAction#doLaunchAction(DelayedLaunchInfo, IDevice) */ + @Override public boolean doLaunchAction(DelayedLaunchInfo info, IDevice device) { String msg = String.format(LaunchMessages.AndroidJUnitLaunchAction_LaunchInstr_2s, mLaunchInfo.getRunner(), device.getSerialNumber()); AdtPlugin.printToConsole(info.getProject(), msg); - + try { mLaunchInfo.setDebugMode(info.isDebugMode()); mLaunchInfo.setDevice(info.getDevice()); JUnitLaunchDelegate junitDelegate = new JUnitLaunchDelegate(mLaunchInfo); - final String mode = info.isDebugMode() ? ILaunchManager.DEBUG_MODE : - ILaunchManager.RUN_MODE; + final String mode = info.isDebugMode() ? ILaunchManager.DEBUG_MODE : + ILaunchManager.RUN_MODE; junitDelegate.launch(info.getLaunch().getLaunchConfiguration(), mode, info.getLaunch(), info.getMonitor()); @@ -86,16 +87,17 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { /** * {@inheritDoc} */ + @Override public String getLaunchDescription() { return String.format(LaunchMessages.AndroidJUnitLaunchAction_LaunchDesc_s, mLaunchInfo.getRunner()); } /** - * Extends the JDT JUnit launch delegate to allow for JUnit UI reuse. + * Extends the JDT JUnit launch delegate to allow for JUnit UI reuse. */ private static class JUnitLaunchDelegate extends JUnitLaunchConfigurationDelegate { - + private AndroidJUnitLaunchInfo mLaunchInfo; public JUnitLaunchDelegate(AndroidJUnitLaunchInfo launchInfo) { @@ -137,16 +139,16 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { @Override public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) { return mLaunchInfo.getLaunch(); - } + } } /** * Provides a VM runner implementation which starts a inline implementation of a launch process */ private static class VMTestRunner implements IVMRunner { - + private final AndroidJUnitLaunchInfo mJUnitInfo; - + VMTestRunner(AndroidJUnitLaunchInfo info) { mJUnitInfo = info; } @@ -155,10 +157,11 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { * {@inheritDoc} * @throws CoreException */ + @Override public void run(final VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException { - - TestRunnerProcess runnerProcess = + + TestRunnerProcess runnerProcess = new TestRunnerProcess(config, mJUnitInfo); launch.addProcess(runnerProcess); runnerProcess.run(); @@ -174,15 +177,16 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { private final AndroidJUnitLaunchInfo mJUnitInfo; private RemoteAdtTestRunner mTestRunner = null; private boolean mIsTerminated = false; - + TestRunnerProcess(VMRunnerConfiguration runConfig, AndroidJUnitLaunchInfo info) { mRunConfig = runConfig; mJUnitInfo = info; } - + /* (non-Javadoc) * @see org.eclipse.debug.core.model.IProcess#getAttribute(java.lang.String) */ + @Override public String getAttribute(String key) { return null; } @@ -191,6 +195,7 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { * {@inheritDoc} * @see org.eclipse.debug.core.model.IProcess#getExitValue() */ + @Override public int getExitValue() { return 0; } @@ -198,6 +203,7 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { /* (non-Javadoc) * @see org.eclipse.debug.core.model.IProcess#getLabel() */ + @Override public String getLabel() { return mJUnitInfo.getLaunch().getLaunchMode(); } @@ -205,6 +211,7 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { /* (non-Javadoc) * @see org.eclipse.debug.core.model.IProcess#getLaunch() */ + @Override public ILaunch getLaunch() { return mJUnitInfo.getLaunch(); } @@ -212,21 +219,24 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { /* (non-Javadoc) * @see org.eclipse.debug.core.model.IProcess#getStreamsProxy() */ + @Override public IStreamsProxy getStreamsProxy() { return null; } /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IProcess#setAttribute(java.lang.String, + * @see org.eclipse.debug.core.model.IProcess#setAttribute(java.lang.String, * java.lang.String) */ + @Override public void setAttribute(String key, String value) { - // ignore + // ignore } /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ + @Override @SuppressWarnings("unchecked") public Object getAdapter(Class adapter) { return null; @@ -235,6 +245,7 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { /* (non-Javadoc) * @see org.eclipse.debug.core.model.ITerminate#canTerminate() */ + @Override public boolean canTerminate() { return true; } @@ -242,6 +253,7 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { /* (non-Javadoc) * @see org.eclipse.debug.core.model.ITerminate#isTerminated() */ + @Override public boolean isTerminated() { return mIsTerminated; } @@ -250,12 +262,13 @@ class AndroidJUnitLaunchAction implements IAndroidLaunchAction { * {@inheritDoc} * @see org.eclipse.debug.core.model.ITerminate#terminate() */ + @Override public void terminate() { if (mTestRunner != null) { mTestRunner.terminate(); - } + } mIsTerminated = true; - } + } /** * Launches a test runner that will communicate results back to JDT JUnit UI. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java index 51db066..f31eeac 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java @@ -15,8 +15,8 @@ */ package com.android.ide.eclipse.adt.internal.launch.junit; -import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtConstants; +import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.editors.IconFactory; import com.android.ide.eclipse.adt.internal.launch.LaunchMessages; import com.android.ide.eclipse.adt.internal.launch.MainLaunchConfigTab; @@ -129,6 +129,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { mProjectChooserHelper = new ProjectChooserHelper(parent.getShell(), null /*filter*/); @@ -187,6 +188,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat mProjText = new Text(comp, SWT.SINGLE | SWT.BORDER); mProjText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mProjText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent evt) { validatePage(); updateLaunchConfigurationDialog(); @@ -215,6 +217,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat mTestText = new Text(comp, SWT.SINGLE | SWT.BORDER); mTestText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mTestText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent evt) { validatePage(); updateLaunchConfigurationDialog(); @@ -263,6 +266,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat gd.horizontalSpan = 2; mContainerText.setLayoutData(gd); mContainerText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent evt) { updateLaunchConfigurationDialog(); } @@ -315,6 +319,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration config) { String projectName = updateProjectFromConfig(config); String containerHandle = EMPTY_STRING; @@ -432,6 +437,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy config) { if (mTestContainerRadioButton.getSelection() && mContainerElement != null) { config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, @@ -729,6 +735,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { IJavaElement javaElement = getContext(); if (javaElement != null) { @@ -814,6 +821,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return JUnitMessages.JUnitLaunchConfigurationTab_tab_label; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitPropertyTester.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitPropertyTester.java index b45cc41..5172e09 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitPropertyTester.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitPropertyTester.java @@ -39,12 +39,13 @@ import org.eclipse.jdt.internal.junit.util.TestSearchEngine; @SuppressWarnings("restriction") public class AndroidJUnitPropertyTester extends PropertyTester { private static final String PROPERTY_IS_TEST = "isTest"; //$NON-NLS-1$ - + private static final String PROPERTY_CAN_LAUNCH_AS_JUNIT_TEST = "canLaunchAsJUnit"; //$NON-NLS-1$ /* (non-Javadoc) * @see org.eclipse.jdt.internal.corext.refactoring.participants.properties.IPropertyEvaluator#test(java.lang.Object, java.lang.String, java.lang.String) */ + @Override public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (!(receiver instanceof IAdaptable)) { final String elementName = (receiver == null ? "null" : //$NON-NLS-1$ @@ -73,7 +74,7 @@ public class AndroidJUnitPropertyTester extends PropertyTester { } } } - if (PROPERTY_IS_TEST.equals(property)) { + if (PROPERTY_IS_TEST.equals(property)) { return isJUnitTest(element); } else if (PROPERTY_CAN_LAUNCH_AS_JUNIT_TEST.equals(property)) { return canLaunchAsJUnitTest(element); @@ -81,7 +82,7 @@ public class AndroidJUnitPropertyTester extends PropertyTester { throw new IllegalArgumentException( String.format("Unknown test property '%s'", property)); //$NON-NLS-1$ } - + private boolean canLaunchAsJUnitTest(IJavaElement element) { try { switch (element.getElementType()) { @@ -90,7 +91,7 @@ public class AndroidJUnitPropertyTester extends PropertyTester { case IJavaElement.PACKAGE_FRAGMENT_ROOT: return false; // not supported by Android test runner case IJavaElement.PACKAGE_FRAGMENT: - return ((IPackageFragment) element).hasChildren(); + return ((IPackageFragment) element).hasChildren(); case IJavaElement.COMPILATION_UNIT: case IJavaElement.CLASS_FILE: case IJavaElement.TYPE: diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitTabGroup.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitTabGroup.java index 0555dea..d9a44ed 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitTabGroup.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitTabGroup.java @@ -16,13 +16,13 @@ package com.android.ide.eclipse.adt.internal.launch.junit; +import com.android.ide.eclipse.adt.internal.launch.EmulatorConfigTab; + import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; import org.eclipse.debug.ui.CommonTab; import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchConfigurationTab; -import com.android.ide.eclipse.adt.internal.launch.EmulatorConfigTab; - /** * Tab group object for Android JUnit launch configuration type. */ @@ -31,6 +31,7 @@ public class AndroidJUnitTabGroup extends AbstractLaunchConfigurationTabGroup { /** * Creates the UI tabs for the Android JUnit configuration */ + @Override public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new AndroidJUnitLaunchConfigurationTab(), diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/AndroidTestReference.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/AndroidTestReference.java index 8477ca8..ec3104d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/AndroidTestReference.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/AndroidTestReference.java @@ -26,12 +26,13 @@ import org.eclipse.jdt.internal.junit.runner.TestExecution; * <p/> * Provides generic equality/hashcode services */ -@SuppressWarnings("restriction") //$NON-NLS-1$ +@SuppressWarnings("restriction") abstract class AndroidTestReference implements ITestReference, ITestIdentifier { /** * Gets the {@link ITestIdentifier} for this test reference. */ + @Override public ITestIdentifier getIdentifier() { // this class serves as its own test identifier return this; @@ -40,6 +41,7 @@ abstract class AndroidTestReference implements ITestReference, ITestIdentifier { /** * Not supported. */ + @Override public void run(TestExecution execution) { throw new UnsupportedOperationException(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/RemoteAdtTestRunner.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/RemoteAdtTestRunner.java index 040822f..2bb194d 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/RemoteAdtTestRunner.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/RemoteAdtTestRunner.java @@ -198,6 +198,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { */ private class TestRunListener implements ITestRunListener { + @Override public void testEnded(TestIdentifier test, Map<String, String> ignoredTestMetrics) { mExecution.getListener().notifyTestEnded(new TestCaseReference(test)); } @@ -205,6 +206,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testFailed(com.android.ddmlib.testrunner.ITestRunListener.TestFailure, com.android.ddmlib.testrunner.TestIdentifier, java.lang.String) */ + @Override public void testFailed(TestFailure status, TestIdentifier test, String trace) { String statusString; if (status == TestFailure.ERROR) { @@ -221,6 +223,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunEnded(long, Map<String, String>) */ + @Override public void testRunEnded(long elapsedTime, Map<String, String> runMetrics) { notifyTestRunEnded(elapsedTime); AdtPlugin.printToConsole(mLaunchInfo.getProject(), @@ -230,6 +233,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunFailed(java.lang.String) */ + @Override public void testRunFailed(String errorMessage) { reportError(errorMessage); } @@ -237,6 +241,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunStarted(int) */ + @Override public void testRunStarted(String runName, int testCount) { // ignore } @@ -244,6 +249,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunStopped(long) */ + @Override public void testRunStopped(long elapsedTime) { notifyTestRunStopped(elapsedTime); AdtPlugin.printToConsole(mLaunchInfo.getProject(), @@ -253,6 +259,7 @@ public class RemoteAdtTestRunner extends RemoteTestRunner { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testStarted(com.android.ddmlib.testrunner.TestIdentifier) */ + @Override public void testStarted(TestIdentifier test) { TestCaseReference testId = new TestCaseReference(test); mExecution.getListener().notifyTestStarted(testId); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCaseReference.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCaseReference.java index 1164956..6c89926 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCaseReference.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCaseReference.java @@ -31,7 +31,7 @@ class TestCaseReference extends AndroidTestReference { private final String mClassName; private final String mTestName; - + /** * Creates a TestCaseReference from a class and method name */ @@ -52,15 +52,17 @@ class TestCaseReference extends AndroidTestReference { /** * Returns a count of the number of test cases referenced. Is always one for this class. */ + @Override public int countTestCases() { return 1; } /** * Sends test identifier and test count information for this test - * + * * @param notified the {@link IVisitsTestTrees} to send test info to */ + @Override public void sendTree(IVisitsTestTrees notified) { notified.visitTreeEntry(getIdentifier(), false, countTestCases()); } @@ -68,8 +70,9 @@ class TestCaseReference extends AndroidTestReference { /** * Returns the identifier of this test, in a format expected by JDT JUnit */ + @Override public String getName() { - return MessageFormat.format(MessageIds.TEST_IDENTIFIER_MESSAGE_FORMAT, + return MessageFormat.format(MessageIds.TEST_IDENTIFIER_MESSAGE_FORMAT, new Object[] { mTestName, mClassName}); } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCollector.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCollector.java index 3f099a2..b18ee6c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCollector.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestCollector.java @@ -41,6 +41,7 @@ class TestCollector implements ITestRunListener { mTestTree = new HashMap<String, TestSuiteReference>(); } + @Override public void testEnded(TestIdentifier test, Map<String, String> testMetrics) { // ignore } @@ -48,6 +49,7 @@ class TestCollector implements ITestRunListener { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testFailed(com.android.ddmlib.testrunner.ITestRunListener.TestFailure, com.android.ddmlib.testrunner.TestIdentifier, java.lang.String) */ + @Override public void testFailed(TestFailure status, TestIdentifier test, String trace) { // ignore - should be impossible since this is only collecting test information } @@ -55,6 +57,7 @@ class TestCollector implements ITestRunListener { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunEnded(long, Map<String, String>) */ + @Override public void testRunEnded(long elapsedTime, Map<String, String> runMetrics) { // ignore } @@ -62,6 +65,7 @@ class TestCollector implements ITestRunListener { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunFailed(java.lang.String) */ + @Override public void testRunFailed(String errorMessage) { mErrorMessage = errorMessage; } @@ -69,6 +73,7 @@ class TestCollector implements ITestRunListener { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunStarted(int) */ + @Override public void testRunStarted(String ignoredRunName, int testCount) { mTotalTestCount = testCount; } @@ -76,6 +81,7 @@ class TestCollector implements ITestRunListener { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testRunStopped(long) */ + @Override public void testRunStopped(long elapsedTime) { // ignore } @@ -83,6 +89,7 @@ class TestCollector implements ITestRunListener { /* (non-Javadoc) * @see com.android.ddmlib.testrunner.ITestRunListener#testStarted(com.android.ddmlib.testrunner.TestIdentifier) */ + @Override public void testStarted(TestIdentifier test) { TestSuiteReference suiteRef = mTestTree.get(test.getClassName()); if (suiteRef == null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestSuiteReference.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestSuiteReference.java index 9bf1e8d..394ae13 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestSuiteReference.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/runtime/TestSuiteReference.java @@ -18,8 +18,8 @@ package com.android.ide.eclipse.adt.internal.launch.junit.runtime; import org.eclipse.jdt.internal.junit.runner.IVisitsTestTrees; -import java.util.List; import java.util.ArrayList; +import java.util.List; /** * Reference for an Android test suite aka class. @@ -32,17 +32,18 @@ class TestSuiteReference extends AndroidTestReference { /** * Creates a TestSuiteReference - * + * * @param className the fully qualified name of the test class */ TestSuiteReference(String className) { - mClassName = className; + mClassName = className; mTests = new ArrayList<TestCaseReference>(); } /** - * Returns a count of the number of test cases included in this suite. + * Returns a count of the number of test cases included in this suite. */ + @Override public int countTestCases() { return mTests.size(); } @@ -50,9 +51,10 @@ class TestSuiteReference extends AndroidTestReference { /** * Sends test identifier and test count information for this test class, and all its included * test methods. - * + * * @param notified the {@link IVisitsTestTrees} to send test info too */ + @Override public void sendTree(IVisitsTestTrees notified) { notified.visitTreeEntry(getIdentifier(), true, countTestCases()); for (TestCaseReference ref : mTests) { @@ -63,13 +65,14 @@ class TestSuiteReference extends AndroidTestReference { /** * Return the name of this test class. */ + @Override public String getName() { return mClassName; } /** * Adds a test method to this suite. - * + * * @param testRef the {@link TestCaseReference} to add */ void addTest(TestCaseReference testRef) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ClearLintMarkersAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ClearLintMarkersAction.java index 26e5606..1717a87 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ClearLintMarkersAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ClearLintMarkersAction.java @@ -26,10 +26,12 @@ public class ClearLintMarkersAction implements IActionDelegate { private ISelection mSelection; + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } + @Override public void run(IAction action) { IProject project = RunLintAction.getSelectedProject(mSelection); if (project != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java index 959c75e..310d689 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java @@ -116,6 +116,7 @@ public class EclipseLintClient extends LintClient implements IDomParser { // ----- Implements IDomParser ----- + @Override public Document parseXml(XmlContext context) { // Map File to IFile IFile file = AdtUtils.fileToIFile(context.file); @@ -530,12 +531,14 @@ public class EclipseLintClient extends LintClient implements IDomParser { return ""; //$NON-NLS-1$ } + @Override public Location getLocation(XmlContext context, Node node) { IStructuredDocument doc = (IStructuredDocument) context.getProperty(DOCUMENT_PROPERTY); return new LazyLocation(context.file, doc, (IndexedRegion) node); } - public Handle createLocationHandle(XmlContext context, Node node) { + @Override + public Handle createLocationHandle(final XmlContext context, final Node node) { IStructuredDocument doc = (IStructuredDocument) context.getProperty(DOCUMENT_PROPERTY); return new LazyLocation(context.file, doc, (IndexedRegion) node); } @@ -560,6 +563,7 @@ public class EclipseLintClient extends LintClient implements IDomParser { return detectorClass; } + @Override public void dispose(XmlContext context, Document document) { // TODO: Consider leaving read-lock on the document in parse() and freeing it here. } @@ -609,6 +613,7 @@ public class EclipseLintClient extends LintClient implements IDomParser { return mEnd; } + @Override public Location resolve() { return this; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java index 5bf0851..3f44a2c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java @@ -137,10 +137,12 @@ abstract class LintFix implements ICompletionProposal { // ---- Implements ICompletionProposal ---- + @Override public String getDisplayString() { return null; } + @Override public String getAdditionalProposalInfo() { Issue issue = EclipseLintClient.getRegistry().getIssue(mId); if (issue != null) { @@ -160,15 +162,18 @@ abstract class LintFix implements ICompletionProposal { } } + @Override public Point getSelection(IDocument document) { return null; } + @Override public Image getImage() { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK); } + @Override public IContextInformation getContextInformation() { return null; } @@ -234,6 +239,7 @@ abstract class LintFix implements ICompletionProposal { protected abstract void apply(IDocument document, IStructuredModel model, Node node, int start, int end); + @Override public void apply(IDocument document) { if (!(document instanceof IStructuredDocument)) { AdtPlugin.log(null, "Unexpected document type: %1$s. Can't fix.", @@ -773,6 +779,7 @@ abstract class LintFix implements ICompletionProposal { // ---- Implements IInputValidator ---- + @Override public String isValid(String input) { if (input == null || input.length() == 0) return " "; //$NON-NLS-1$ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java index 9ac0b4d..b935439 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java @@ -93,6 +93,7 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi // ---- Implements IMarkerResolutionGenerator2 ---- + @Override public boolean hasResolutions(IMarker marker) { try { assert marker.getType().equals(AdtConstants.MARKER_LINT); @@ -102,6 +103,7 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi return true; } + @Override public IMarkerResolution[] getResolutions(IMarker marker) { String id = marker.getAttribute(LintRunner.MARKER_CHECKID_PROPERTY, ""); //$NON-NLS-1$ @@ -117,18 +119,22 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi // ---- Implements IQuickAssistProcessor ---- + @Override public String getErrorMessage() { return "Disable Lint Error"; } + @Override public boolean canFix(Annotation annotation) { return true; } + @Override public boolean canAssist(IQuickAssistInvocationContext invocationContext) { return true; } + @Override public ICompletionProposal[] computeQuickAssistProposals( IQuickAssistInvocationContext invocationContext) { ISourceViewer sourceViewer = invocationContext.getSourceViewer(); @@ -210,6 +216,7 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi suppressDetector(mId, true, mResource, !mGlobal); } + @Override public String getDisplayString() { if (mResource instanceof IProject) { return "Disable Check in This Project"; @@ -222,28 +229,34 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi // ---- Implements MarkerResolution2 ---- + @Override public String getLabel() { return getDisplayString(); } + @Override public void run(IMarker marker) { perform(); } + @Override public String getDescription() { return getAdditionalProposalInfo(); } // ---- Implements ICompletionProposal ---- + @Override public void apply(IDocument document) { perform(); } + @Override public Point getSelection(IDocument document) { return null; } + @Override public String getAdditionalProposalInfo() { StringBuilder sb = new StringBuilder(200); if (mResource instanceof IProject) { @@ -259,11 +272,13 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi return sb.toString(); } + @Override public Image getImage() { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK); } + @Override public IContextInformation getContextInformation() { return null; } @@ -283,34 +298,41 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi EclipseLintClient.clearMarkers(resource); } + @Override public String getDisplayString() { return mGlobal ? "Clear All Lint Markers" : "Clear Markers in This File Only"; } // ---- Implements MarkerResolution2 ---- + @Override public String getLabel() { return getDisplayString(); } + @Override public void run(IMarker marker) { perform(); } + @Override public String getDescription() { return getAdditionalProposalInfo(); } // ---- Implements ICompletionProposal ---- + @Override public void apply(IDocument document) { perform(); } + @Override public Point getSelection(IDocument document) { return null; } + @Override public String getAdditionalProposalInfo() { StringBuilder sb = new StringBuilder(200); if (mGlobal) { @@ -331,11 +353,13 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi return sb.toString(); } + @Override public Image getImage() { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_ELCL_REMOVE); } + @Override public IContextInformation getContextInformation() { return null; } @@ -376,43 +400,52 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi sb.toString()); } + @Override public String getDisplayString() { return "Explain Issue"; } // ---- Implements MarkerResolution2 ---- + @Override public String getLabel() { return getDisplayString(); } + @Override public void run(IMarker marker) { perform(); } + @Override public String getDescription() { return getAdditionalProposalInfo(); } // ---- Implements ICompletionProposal ---- + @Override public void apply(IDocument document) { perform(); } + @Override public Point getSelection(IDocument document) { return null; } + @Override public String getAdditionalProposalInfo() { return "Provides more information about this issue"; } + @Override public Image getImage() { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK); } + @Override public IContextInformation getContextInformation() { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java index 1be6803..c110df3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintList.java @@ -187,6 +187,7 @@ class LintList extends Composite implements IResourceChangeListener, ControlList final IssueRegistry registry = EclipseLintClient.getRegistry(); Collections.sort(markerList, new Comparator<IMarker>() { + @Override public int compare(IMarker marker1, IMarker marker2) { // Sort by priority, then by category, then by id, // then by file, then by line @@ -279,6 +280,7 @@ class LintList extends Composite implements IResourceChangeListener, ControlList } private class ContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement == null) { return new IMarker[0]; @@ -289,14 +291,17 @@ class LintList extends Composite implements IResourceChangeListener, ControlList return list.toArray(new IMarker[list.size()]); } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } private class LabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex != 0) { return null; @@ -323,6 +328,7 @@ class LintList extends Composite implements IResourceChangeListener, ControlList } } + @Override public String getColumnText(Object element, int columnIndex) { IMarker marker = (IMarker) element; try { @@ -343,16 +349,20 @@ class LintList extends Composite implements IResourceChangeListener, ControlList return ""; //$NON-NLS-1$ } + @Override public void addListener(ILabelProviderListener listener) { } + @Override public void removeListener(ILabelProviderListener listener) { } + @Override public boolean isLabelProperty(Object element, String property) { return false; } + @Override public void dispose() { } } @@ -363,6 +373,7 @@ class LintList extends Composite implements IResourceChangeListener, ControlList // ---- Implements IResourceChangeListener ---- + @Override public void resourceChanged(IResourceChangeEvent event) { if (mResources == null) { return; @@ -458,9 +469,11 @@ class LintList extends Composite implements IResourceChangeListener, ControlList // ---- Implements ControlListener + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { updateColumnWidths(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintListDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintListDialog.java index 5daa632..03849fc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintListDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintListDialog.java @@ -172,6 +172,7 @@ class LintListDialog extends TitleAreaDialog implements SelectionListener { // ---- Implements SelectionListener ---- + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); if (source == mList.getTableViewer().getControl()) { @@ -236,6 +237,7 @@ class LintListDialog extends TitleAreaDialog implements SelectionListener { mFixButton.setEnabled(canFix); } + @Override public void widgetDefaultSelected(SelectionEvent e) { Object source = e.getSource(); if (source == mList.getTableViewer().getControl()) { 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 b4a4a0c..03e1c1c 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 @@ -219,6 +219,7 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha // ---- Implements SelectionListener ---- + @Override public void widgetSelected(SelectionEvent e) { List<IMarker> markers = mLintView.getSelectedMarkers(); if (markers.size() != 1) { @@ -260,6 +261,7 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha } } + @Override public void widgetDefaultSelected(SelectionEvent e) { Object source = e.getSource(); if (source == mLintView.getTableViewer().getControl()) { @@ -273,12 +275,14 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha // --- Implements IJobChangeListener ---- + @Override public void done(IJobChangeEvent event) { mRefreshAction.setImageDescriptor( IconFactory.getInstance().getImageDescriptor(REFRESH_ICON)); if (!mLintView.isDisposed()) { mLintView.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (!mLintView.isDisposed()) { updateIssueCount(); @@ -294,18 +298,23 @@ public class LintViewPart extends ViewPart implements SelectionListener, IJobCha mErrorLabel.setText(String.format("%1$d errors, %2$d warnings", errors, warnings)); } + @Override public void aboutToRun(IJobChangeEvent event) { } + @Override public void awake(IJobChangeEvent event) { } + @Override public void running(IJobChangeEvent event) { } + @Override public void scheduled(IJobChangeEvent event) { } + @Override public void sleeping(IJobChangeEvent event) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java index 9162c48..3c9b5da 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java @@ -41,10 +41,12 @@ public class RunLintAction implements IWorkbenchWindowActionDelegate, IObjectAct private ISelection mSelection; + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } + @Override public void run(IAction action) { IProject project = RunLintAction.getSelectedProject(mSelection); @@ -134,13 +136,16 @@ public class RunLintAction implements IWorkbenchWindowActionDelegate, IObjectAct return null; } + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } + @Override public void dispose() { // Nothing to dispose } + @Override public void init(IWorkbenchWindow window) { } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AndroidPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AndroidPreferencePage.java index c700145..426149e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AndroidPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AndroidPreferencePage.java @@ -80,6 +80,7 @@ public class AndroidPreferencePage extends FieldEditorPreferencePage implements * * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ + @Override public void init(IWorkbench workbench) { } @@ -220,6 +221,7 @@ public class AndroidPreferencePage extends FieldEditorPreferencePage implements } private class TargetChangedListener implements ITargetChangeListener { + @Override public void onSdkLoaded() { if (mTargetSelector != null) { // We may not have an sdk if the sdk path pref is empty or not valid. @@ -230,10 +232,12 @@ public class AndroidPreferencePage extends FieldEditorPreferencePage implements } } + @Override public void onProjectTargetChange(IProject changedProject) { // do nothing. } + @Override public void onTargetLoaded(IAndroidTarget target) { // do nothing. } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java index 63ed876..8ec9adc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java @@ -51,6 +51,7 @@ public enum AttributeSortOrder { /** Comparator which can be used to sort attributes in the coding style priority order */ private static final Comparator<Attr> SORTED_ORDER_COMPARATOR = new Comparator<Attr>() { + @Override public int compare(Attr attr1, Attr attr2) { // Namespace declarations should always go first if (XMLNS.equals(attr1.getPrefix())) { @@ -73,6 +74,7 @@ public enum AttributeSortOrder { * (which is not the same as the node map iteration order in the DOM model) */ private static final Comparator<Attr> EXISTING_ORDER_COMPARATOR = new Comparator<Attr>() { + @Override public int compare(Attr attr1, Attr attr2) { IndexedRegion region1 = (IndexedRegion) attr1; IndexedRegion region2 = (IndexedRegion) attr2; @@ -86,6 +88,7 @@ public enum AttributeSortOrder { * is always first) */ private static final Comparator<Attr> ALPHABETICAL_COMPARATOR = new Comparator<Attr>() { + @Override public int compare(Attr attr1, Attr attr2) { // Namespace declarations should always go first if (XMLNS.equals(attr1.getPrefix())) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java index 3ad112a..d5aa30a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java @@ -89,6 +89,7 @@ public class BuildPreferencePage extends FieldEditorPreferencePage implements * * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ + @Override public void init(IWorkbench workbench) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java index 1dbf996..0aeadc0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java @@ -53,6 +53,7 @@ public class EditorsPage extends FieldEditorPreferencePage implements IWorkbench setPreferenceStore(AdtPlugin.getDefault().getPreferenceStore()); } + @Override public void init(IWorkbench workbench) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LaunchPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LaunchPreferencePage.java index c684d61..0ac1f0f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LaunchPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LaunchPreferencePage.java @@ -44,6 +44,7 @@ public class LaunchPreferencePage extends FieldEditorPreferencePage implements Messages.LaunchPreferencePage_Default_HOME_Package, getFieldEditorParent())); } + @Override public void init(IWorkbench workbench) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java index 8e3bdb4..c19fb2c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java @@ -216,6 +216,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer /** * Initialize the preference page. */ + @Override public void init(IWorkbench workbench) { // Initialize the preference page } @@ -322,6 +323,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer // ---- Implements SelectionListener ---- + @Override public void widgetSelected(SelectionEvent e) { if (mIgnoreEvent) { return; @@ -390,6 +392,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer return mConfiguration.getSeverity(issue); } + @Override public void widgetDefaultSelected(SelectionEvent e) { if (e.getSource() == mTree) { widgetSelected(e); @@ -398,9 +401,11 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer // ---- Implements ControlListener ---- + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { Rectangle r = mTree.getClientArea(); int availableWidth = r.width; @@ -451,19 +456,24 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer private class LabelProvider implements ITableLabelProvider, IColorProvider { + @Override public void addListener(ILabelProviderListener listener) { } + @Override public void dispose() { } + @Override public boolean isLabelProperty(Object element, String property) { return true; } + @Override public void removeListener(ILabelProviderListener listener) { } + @Override public Image getColumnImage(Object element, int columnIndex) { if (element instanceof Category) { return null; @@ -491,6 +501,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof Category) { if (columnIndex == 0) { @@ -513,6 +524,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer // ---- IColorProvider ---- + @Override public Color getForeground(Object element) { if (element instanceof Category) { return mTree.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND); @@ -529,6 +541,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer return null; } + @Override public Color getBackground(Object element) { if (element instanceof Category) { return mTree.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/UsagePreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/UsagePreferencePage.java index a333bc5..470b4c0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/UsagePreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/UsagePreferencePage.java @@ -18,11 +18,9 @@ package com.android.ide.eclipse.adt.internal.preferences; import com.android.sdkstats.DdmsPreferenceStore; import com.android.sdkstats.SdkStatsPermissionDialog; -import com.android.sdkstats.SdkStatsService; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.PreferenceStore; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -35,8 +33,6 @@ import org.eclipse.swt.widgets.Link; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; -import java.io.IOException; - public class UsagePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private static final int WRAP_WIDTH_PX = 200; @@ -46,6 +42,7 @@ public class UsagePreferencePage extends PreferencePage implements IWorkbenchPre public UsagePreferencePage() { } + @Override public void init(IWorkbench workbench) { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainer.java index 0b891c9..475dd5a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainer.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainer.java @@ -47,18 +47,22 @@ class AndroidClasspathContainer implements IClasspathContainer { mKind = kind; } + @Override public IClasspathEntry[] getClasspathEntries() { return mClasspathEntry; } + @Override public String getDescription() { return mName; } + @Override public int getKind() { return mKind; } + @Override public IPath getPath() { return mContainerPath; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java index a8d1914..0d24bad 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java @@ -23,8 +23,8 @@ import com.android.ide.eclipse.adt.internal.sdk.ProjectState; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.sdklib.AndroidVersion; import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkConstants; import com.android.sdklib.IAndroidTarget.IOptionalLibrary; +import com.android.sdklib.SdkConstants; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; @@ -253,18 +253,22 @@ public class AndroidClasspathContainerInitializer extends ClasspathContainerInit // It'll be replaced by the real when if/when the target is resolved if/when the // SDK finishes loading. return new IClasspathContainer() { + @Override public IClasspathEntry[] getClasspathEntries() { return new IClasspathEntry[0]; } + @Override public String getDescription() { return "Unable to get system library for the project"; } + @Override public int getKind() { return IClasspathContainer.K_DEFAULT_SYSTEM; } + @Override public IPath getPath() { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerPage.java index ed4e1ed..b027650 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerPage.java @@ -62,6 +62,7 @@ public class AndroidClasspathContainerPage extends WizardPage implements IClassp setDescription("This container manages classpath entries for Android container"); } + @Override public IClasspathEntry getSelection() { IPath path = new Path(AdtConstants.CONTAINER_FRAMEWORK); @@ -78,6 +79,7 @@ public class AndroidClasspathContainerPage extends WizardPage implements IClassp return JavaCore.newContainerEntry(path); } + @Override public void setSelection(final IClasspathEntry cpentry) { final IPath path = cpentry == null ? null : cpentry.getPath(); @@ -90,6 +92,7 @@ public class AndroidClasspathContainerPage extends WizardPage implements IClassp } } + @Override public void createControl(final Composite parent) { final Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); @@ -127,6 +130,7 @@ public class AndroidClasspathContainerPage extends WizardPage implements IClassp setControl(composite); } + @Override public boolean finish() { return true; } @@ -169,6 +173,7 @@ public class AndroidClasspathContainerPage extends WizardPage implements IClassp updateStatus(StatusUtil.getMostSevere(status)); } + @Override public void initialize(final IJavaProject project, final IClasspathEntry[] currentEntries) { this.mOwnerProject = (project == null ? null : project.getProject()); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidExportNature.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidExportNature.java index 8cb3e40..218cffe 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidExportNature.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidExportNature.java @@ -42,6 +42,7 @@ public class AndroidExportNature implements IProjectNature { * @see org.eclipse.core.resources.IProjectNature#configure() * @throws CoreException if configuration fails. */ + @Override public void configure() throws CoreException { // nothing to do. } @@ -62,6 +63,7 @@ public class AndroidExportNature implements IProjectNature { * @see org.eclipse.core.resources.IProjectNature#deconfigure() * @throws CoreException if configuration fails. */ + @Override public void deconfigure() throws CoreException { // nothing to do } @@ -72,6 +74,7 @@ public class AndroidExportNature implements IProjectNature { * @return the project handle * @see org.eclipse.core.resources.IProjectNature#getProject() */ + @Override public IProject getProject() { return mProject; } @@ -86,6 +89,7 @@ public class AndroidExportNature implements IProjectNature { * @param project the project to which this nature applies * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject) */ + @Override public void setProject(IProject project) { mProject = project; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidNature.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidNature.java index dddc7a0..9da519e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidNature.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidNature.java @@ -55,6 +55,7 @@ public class AndroidNature implements IProjectNature { * @see org.eclipse.core.resources.IProjectNature#configure() * @throws CoreException if configuration fails. */ + @Override public void configure() throws CoreException { configureResourceManagerBuilder(mProject); configurePreBuilder(mProject); @@ -77,6 +78,7 @@ public class AndroidNature implements IProjectNature { * @see org.eclipse.core.resources.IProjectNature#deconfigure() * @throws CoreException if configuration fails. */ + @Override public void deconfigure() throws CoreException { // remove the android builders removeBuilder(mProject, ResourceManagerBuilder.ID); @@ -90,6 +92,7 @@ public class AndroidNature implements IProjectNature { * @return the project handle * @see org.eclipse.core.resources.IProjectNature#getProject() */ + @Override public IProject getProject() { return mProject; } @@ -104,6 +107,7 @@ public class AndroidNature implements IProjectNature { * @param project the project to which this nature applies * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject) */ + @Override public void setProject(IProject project) { mProject = project; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ApkInstallManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ApkInstallManager.java index 19d20d8..912a5ac 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ApkInstallManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ApkInstallManager.java @@ -17,10 +17,10 @@ package com.android.ide.eclipse.adt.internal.project; import com.android.ddmlib.AndroidDebugBridge; -import com.android.ddmlib.IDevice; -import com.android.ddmlib.MultiLineReceiver; import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener; import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; +import com.android.ddmlib.IDevice; +import com.android.ddmlib.MultiLineReceiver; import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor; import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor.IProjectListener; @@ -97,6 +97,7 @@ public final class ApkInstallManager { } } + @Override public boolean isCancelled() { return false; } @@ -190,6 +191,7 @@ public final class ApkInstallManager { * * @see IDebugBridgeChangeListener#bridgeChanged(AndroidDebugBridge) */ + @Override public void bridgeChanged(AndroidDebugBridge bridge) { // the bridge changed, there is no way to know which IDevice will be which. // We reset everything @@ -206,6 +208,7 @@ public final class ApkInstallManager { * * @see IDeviceChangeListener#deviceDisconnected(IDevice) */ + @Override public void deviceDisconnected(IDevice device) { synchronized (mInstallList) { Iterator<ApkInstall> iterator = mInstallList.iterator(); @@ -218,10 +221,12 @@ public final class ApkInstallManager { } } + @Override public void deviceChanged(IDevice device, int changeMask) { // nothing to do. } + @Override public void deviceConnected(IDevice device) { // nothing to do. } @@ -233,6 +238,7 @@ public final class ApkInstallManager { * * @see IProjectListener#projectClosed(IProject) */ + @Override public void projectClosed(IProject project) { resetInstallationFor(project); } @@ -242,18 +248,22 @@ public final class ApkInstallManager { * * @see IProjectListener#projectDeleted(IProject) */ + @Override public void projectDeleted(IProject project) { resetInstallationFor(project); } + @Override public void projectOpened(IProject project) { // nothing to do. } + @Override public void projectOpenedWithWorkspace(IProject project) { // nothing to do. } + @Override public void projectRenamed(IProject project, IPath from) { // project renaming also triggers delete/open events so // there's nothing to do here (since delete will remove diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/FolderDecorator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/FolderDecorator.java index 2ca4269..726c4d6 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/FolderDecorator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/FolderDecorator.java @@ -42,6 +42,7 @@ public class FolderDecorator implements ILightweightLabelDecorator { mDescriptor = AdtPlugin.getImageDescriptor("/icons/android_project.png"); //$NON-NLS-1$ } + @Override public void decorate(Object element, IDecoration decoration) { if (element instanceof IFolder) { IFolder folder = (IFolder)element; @@ -85,19 +86,23 @@ public class FolderDecorator implements ILightweightLabelDecorator { } } + @Override public boolean isLabelProperty(Object element, String property) { // Property change do not affect the label return false; } + @Override public void addListener(ILabelProviderListener listener) { // No state change will affect the rendering. } + @Override public void removeListener(ILabelProviderListener listener) { // No state change will affect the rendering. } + @Override public void dispose() { // nothing to dispose } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ProjectChooserHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ProjectChooserHelper.java index cfeb623..9de8ad0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ProjectChooserHelper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ProjectChooserHelper.java @@ -69,6 +69,7 @@ public class ProjectChooserHelper { * An implementation of {@link IProjectChooserFilter} that only displays non-library projects. */ public final static class NonLibraryProjectOnlyFilter implements IProjectChooserFilter { + @Override public boolean accept(IProject project) { ProjectState state = Sdk.getProjectState(project); if (state != null) { @@ -78,6 +79,7 @@ public class ProjectChooserHelper { return false; } + @Override public boolean useCache() { return true; } @@ -87,6 +89,7 @@ public class ProjectChooserHelper { * An implementation of {@link IProjectChooserFilter} that only displays library projects. */ public final static class LibraryProjectOnlyFilter implements IProjectChooserFilter { + @Override public boolean accept(IProject project) { ProjectState state = Sdk.getProjectState(project); if (state != null ) { @@ -96,6 +99,7 @@ public class ProjectChooserHelper { return false; } + @Override public boolean useCache() { return true; } @@ -275,6 +279,7 @@ public class ProjectChooserHelper { * Click handler for the button: Open the {@link ProjectChooserHelper} * dialog for selecting a new project. */ + @Override public void widgetSelected(SelectionEvent e) { int selectionIndex = getSelectionIndex(); if (selectionIndex > 0 && mAvailableProjects != null @@ -287,6 +292,7 @@ public class ProjectChooserHelper { } } + @Override public void widgetDefaultSelected(SelectionEvent e) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/XmlErrorHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/XmlErrorHandler.java index 7cd0161..8e16e84 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/XmlErrorHandler.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/XmlErrorHandler.java @@ -53,6 +53,7 @@ public class XmlErrorHandler extends DefaultHandler implements ManifestErrorHand public static class BasicXmlErrorListener implements XmlErrorListener { public boolean mHasXmlError = false; + @Override public void errorFound() { mHasXmlError = true; } @@ -113,6 +114,7 @@ public class XmlErrorHandler extends DefaultHandler implements ManifestErrorHand * @param exception * @param lineNumber */ + @Override public void handleError(Exception exception, int lineNumber) { if (mErrorListener != null) { mErrorListener.errorFound(); @@ -142,6 +144,7 @@ public class XmlErrorHandler extends DefaultHandler implements ManifestErrorHand * @param testVisibility if <code>true</code>, the method will check the visibility of * the class or of its constructors. */ + @Override public void checkClass(Locator locator, String className, String superClassName, boolean testVisibility) { if (mJavaProject == null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java index 26459d7..38b4425 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java @@ -20,8 +20,8 @@ import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper; import com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper.IProjectChooserFilter; import com.android.ide.eclipse.adt.internal.sdk.ProjectState; -import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.ide.eclipse.adt.internal.sdk.ProjectState.LibraryState; +import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.sdklib.internal.project.ProjectProperties; import com.android.sdklib.internal.project.ProjectPropertiesWorkingCopy; @@ -92,6 +92,7 @@ final class LibraryProperties { * that are already dependencies. */ IProjectChooserFilter mFilter = new IProjectChooserFilter() { + @Override public boolean accept(IProject project) { // first check if it's a library ProjectState state = Sdk.getProjectState(project); @@ -113,6 +114,7 @@ final class LibraryProperties { return false; } + @Override public boolean useCache() { return false; } @@ -129,6 +131,7 @@ final class LibraryProperties { mTop.setLayoutData(new GridData(GridData.FILL_BOTH)); mTop.setFont(parent.getFont()); mTop.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { mMatchIcon.dispose(); mErrorIcon.dispose(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java index fed7725..3b63acf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java @@ -104,6 +104,7 @@ public class FixImportsJob extends WorkspaceJob { false }; IChooseImportQuery query = new IChooseImportQuery() { + @Override public TypeNameMatch[] chooseImports(TypeNameMatch[][] openChoices, ISourceRange[] ranges) { hasAmbiguity[0] = true; @@ -115,6 +116,7 @@ public class FixImportsJob extends WorkspaceJob { true, query); Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { try { IProgressService progressService = PlatformUI diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringAction.java index e005f1c..14556fd 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringAction.java @@ -80,10 +80,12 @@ public class ExtractStringAction implements IWorkbenchWindowActionDelegate { /** * Keep track of the current workbench window. */ + @Override public void init(IWorkbenchWindow window) { mWindow = window; } + @Override public void dispose() { // Nothing to do } @@ -93,6 +95,7 @@ public class ExtractStringAction implements IWorkbenchWindowActionDelegate { * <p/> * Keep a link to the relevant selection structure (i.e. a part of the Java AST). */ + @Override public void selectionChanged(IAction action, ISelection selection) { // Note, two kinds of selections are returned here: @@ -119,6 +122,7 @@ public class ExtractStringAction implements IWorkbenchWindowActionDelegate { /** * Create a new instance of our refactoring and a wizard to configure it. */ + @Override public void run(IAction action) { if (mSelection != null && mFile != null) { ExtractStringRefactoring ref = new ExtractStringRefactoring(mFile, mEditor, mSelection); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringInputPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringInputPage.java index b45c137..ff3f5f6 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringInputPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringInputPage.java @@ -95,6 +95,7 @@ class ExtractStringInputPage extends UserInputWizardPage { private final OnConfigSelectorUpdated mOnConfigSelectorUpdated = new OnConfigSelectorUpdated(); private ModifyListener mValidateOnModify = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -122,6 +123,7 @@ class ExtractStringInputPage extends UserInputWizardPage { * Note: the special tag below defines this as the entry point for the WindowsDesigner Editor. * @wbp.parser.entryPoint */ + @Override public void createControl(Composite parent) { Composite content = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -170,6 +172,7 @@ class ExtractStringInputPage extends UserInputWizardPage { ref.setNewStringValue(mStringValueField.getText()); mStringValueField.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -448,6 +451,7 @@ class ExtractStringInputPage extends UserInputWizardPage { * <li> Re-populate the file combo with all the choices. * <li> Select the original XML file. */ + @Override public void run() { if (mInternalConfigChange) { return; @@ -545,6 +549,7 @@ class ExtractStringInputPage extends UserInputWizardPage { * Callback invoked when {@link ExtractStringInputPage#mResFileCombo} has been * modified. */ + @Override public void modifyText(ModifyEvent e) { if (mInternalFileComboChange) { return; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringProposal.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringProposal.java index a14a3f0..5400be4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringProposal.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringProposal.java @@ -46,6 +46,7 @@ public class ExtractStringProposal implements IJavaCompletionProposal { mContext = context; } + @Override public void apply(IDocument document) { IEditorPart editor = AdtUtils.getActiveEditor(); IFile file = AdtUtils.getActiveFile(); @@ -70,10 +71,12 @@ public class ExtractStringProposal implements IJavaCompletionProposal { } } + @Override public Point getSelection(IDocument document) { return null; } + @Override public String getAdditionalProposalInfo() { try { ASTNode coveringNode = mContext.getCoveringNode(); @@ -160,18 +163,22 @@ public class ExtractStringProposal implements IJavaCompletionProposal { return "Initiates the Extract String refactoring operation"; } + @Override public String getDisplayString() { return "Extract String"; } + @Override public Image getImage() { return AdtPlugin.getAndroidLogo(); } + @Override public IContextInformation getContextInformation() { return null; } + @Override public int getRelevance() { return 80; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java index d3cb469..59b6a7a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java @@ -999,6 +999,7 @@ public class ExtractStringRefactoring extends Refactoring { */ private Iterable<IFile> findAllResXmlFiles() { return new Iterable<IFile>() { + @Override public Iterator<IFile> iterator() { return new Iterator<IFile>() { final Queue<IFile> mFiles = new LinkedList<IFile>(); @@ -1036,6 +1037,7 @@ public class ExtractStringRefactoring extends Refactoring { } } + @Override public boolean hasNext() { if (!mFiles.isEmpty()) { return true; @@ -1077,12 +1079,14 @@ public class ExtractStringRefactoring extends Refactoring { } } + @Override public IFile next() { IFile file = mFiles.poll(); hasNext(); return file; } + @Override public void remove() { throw new UnsupportedOperationException( "This iterator does not support removal"); //$NON-NLS-1$ @@ -1752,6 +1756,7 @@ public class ExtractStringRefactoring extends Refactoring { final IJavaProject javaProject = JavaCore.create(mProject); return new Iterable<ICompilationUnit>() { + @Override public Iterator<ICompilationUnit> iterator() { return new Iterator<ICompilationUnit>() { final Queue<ICompilationUnit> mUnits = new LinkedList<ICompilationUnit>(); @@ -1767,6 +1772,7 @@ public class ExtractStringRefactoring extends Refactoring { } } + @Override public boolean hasNext() { if (!mUnits.isEmpty()) { return true; @@ -1789,12 +1795,14 @@ public class ExtractStringRefactoring extends Refactoring { return false; } + @Override public ICompilationUnit next() { ICompilationUnit unit = mUnits.poll(); hasNext(); return unit; } + @Override public void remove() { throw new UnsupportedOperationException( "This iterator does not support removal"); //$NON-NLS-1$ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java index 3df35bc..5ec5a76 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java @@ -16,8 +16,8 @@ package com.android.ide.eclipse.adt.internal.refactorings.renamepackage; -import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtConstants; +import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.editors.descriptors.XmlnsAttributeDescriptor; import com.android.sdklib.SdkConstants; import com.android.sdklib.xml.AndroidManifest; @@ -413,6 +413,7 @@ class ApplicationPackageNameRefactoring extends Refactoring { return change; } + @Override @SuppressWarnings("unused") public boolean visit(IResource resource) throws CoreException { if (resource instanceof IFile) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java index d50fa95..f098f32 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java @@ -66,10 +66,12 @@ public class RenamePackageAction implements IObjectActionDelegate { /** * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { mTargetPart = targetPart; } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } @@ -81,6 +83,7 @@ public class RenamePackageAction implements IObjectActionDelegate { // pass } + @Override public void run(IAction action) { // Prompt for refactoring on the selected project @@ -124,6 +127,7 @@ public class RenamePackageAction implements IObjectActionDelegate { IInputValidator validator = new IInputValidator() { + @Override public String isValid(String newText) { try { astValidator.newName(newText); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/CyclicDependencyValidator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/CyclicDependencyValidator.java index 809f099..911cf3a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/CyclicDependencyValidator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/CyclicDependencyValidator.java @@ -31,6 +31,7 @@ public class CyclicDependencyValidator implements IInputValidator { this.mInvalidIds = invalid; } + @Override public String isValid(String newText) { if (mInvalidIds.contains(newText)) { return "Cyclic include, not valid"; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidator.java index 2b07545..d6d77d3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidator.java @@ -65,6 +65,7 @@ public class ResourceNameValidator implements IInputValidator { mIsImageType = isImageType; } + @Override public String isValid(String newText) { // IValidator has the same interface as SWT's IInputValidator try { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java index 7ad974a..4f2a63c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java @@ -79,6 +79,7 @@ public final class CompiledResourcesMonitor implements IFileListener, IProjectLi * * @see IFileListener#fileChanged */ + @Override public void fileChanged(IFile file, IMarkerDelta[] markerDeltas, int kind) { IProject project = file.getProject(); @@ -134,6 +135,7 @@ public final class CompiledResourcesMonitor implements IFileListener, IProjectLi /** * Processes project close event. */ + @Override public void projectClosed(IProject project) { // the ProjectResources object will be removed by the ResourceManager. } @@ -141,6 +143,7 @@ public final class CompiledResourcesMonitor implements IFileListener, IProjectLi /** * Processes project delete event. */ + @Override public void projectDeleted(IProject project) { // the ProjectResources object will be removed by the ResourceManager. } @@ -148,11 +151,13 @@ public final class CompiledResourcesMonitor implements IFileListener, IProjectLi /** * Processes project open event. */ + @Override public void projectOpened(IProject project) { // when the project is opened, we get an ADDED event for each file, so we don't // need to do anything here. } + @Override public void projectRenamed(IProject project, IPath from) { // renamed projects also trigger delete/open event, // so nothing to be done here. @@ -161,6 +166,7 @@ public final class CompiledResourcesMonitor implements IFileListener, IProjectLi /** * Processes existing project at init time. */ + @Override public void projectOpenedWithWorkspace(IProject project) { try { // check this is an android project diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java index f92f431..0576312 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java @@ -193,6 +193,7 @@ public final class GlobalProjectMonitor { */ private final class DeltaVisitor implements IResourceDeltaVisitor { + @Override public boolean visit(IResourceDelta delta) { // Find the other resource listeners to notify IResource r = delta.getResource(); @@ -453,6 +454,7 @@ public final class GlobalProjectMonitor { * * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent) */ + @Override public synchronized void resourceChanged(IResourceChangeEvent event) { // notify the event listeners of a start. notifyResourceEventStart(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContext.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContext.java index 5e849e6..fddd0ca 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContext.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContext.java @@ -16,7 +16,6 @@ package com.android.ide.eclipse.adt.internal.resources.manager; import static com.android.ide.eclipse.adt.AdtConstants.MARKER_AAPT_COMPILE; - import static org.eclipse.core.resources.IResource.DEPTH_ONE; import static org.eclipse.core.resources.IResource.DEPTH_ZERO; @@ -107,6 +106,7 @@ public class IdeScanningContext extends ScanningContext { // marker will throw a org.eclipse.core.internal.resources.ResourceException. if (async) { AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { updateMarkers(false); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java index 1c9687d..ef51373 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java @@ -339,26 +339,31 @@ public final class ResourceManager { * do not appear in the public API of {@link ResourceManager}. */ private final IProjectListener mProjectListener = new IProjectListener() { + @Override public void projectClosed(IProject project) { synchronized (mMap) { mMap.remove(project); } } + @Override public void projectDeleted(IProject project) { synchronized (mMap) { mMap.remove(project); } } + @Override public void projectOpened(IProject project) { createProject(project); } + @Override public void projectOpenedWithWorkspace(IProject project) { createProject(project); } + @Override public void projectRenamed(IProject project, IPath from) { // renamed project get a delete/open event too, so this can be ignored. } @@ -370,6 +375,7 @@ public final class ResourceManager { * accessed through the {@link ResourceManager#visitDelta(IResourceDelta delta)} method. */ private final IRawDeltaListener mRawDeltaListener = new IRawDeltaListener() { + @Override public void visitDelta(IResourceDelta workspaceDelta) { // If we're auto-building, then PreCompilerBuilder will pass us deltas and // they will be processed as part of the build. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java index 062c2d4..e5798d2 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java @@ -26,6 +26,7 @@ public class AdtConsoleSdkLog implements ISdkLog { private static final String TAG = "SDK Manager"; //$NON-NLS-1$ + @Override public void error(Throwable t, String errorFormat, Object... args) { if (t != null) { AdtPlugin.logAndPrintError(t, TAG, "Error: " + errorFormat, args); @@ -34,6 +35,7 @@ public class AdtConsoleSdkLog implements ISdkLog { } } + @Override public void printf(String msgFormat, Object... args) { String msg = String.format(msgFormat, args); for (String s : msg.split("\n")) { @@ -43,6 +45,7 @@ public class AdtConsoleSdkLog implements ISdkLog { } } + @Override public void warning(String warningFormat, Object... args) { AdtPlugin.printToConsole(TAG, String.format("Warning: " + warningFormat, args)); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java index 807acfc..409210d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java @@ -35,7 +35,7 @@ import javax.management.InvalidAttributeValueException; * Custom class loader able to load a class from the SDK jar file. */ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader { - + /** * Wrapper around a {@link Class} to provide the methods of * {@link IAndroidClassLoader.IClassDescriptor}. @@ -47,10 +47,12 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader mClass = clazz; } + @Override public String getFullClassName() { return mClass.getCanonicalName(); } + @Override public IClassDescriptor[] getDeclaredClasses() { Class<?>[] classes = mClass.getDeclaredClasses(); IClassDescriptor[] iclasses = new IClassDescriptor[classes.length]; @@ -61,18 +63,21 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader return iclasses; } + @Override public IClassDescriptor getEnclosingClass() { return new ClassWrapper(mClass.getEnclosingClass()); } + @Override public String getSimpleName() { return mClass.getSimpleName(); } + @Override public IClassDescriptor getSuperclass() { return new ClassWrapper(mClass.getSuperclass()); } - + @Override public boolean equals(Object clazz) { if (clazz instanceof ClassWrapper) { @@ -80,13 +85,14 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader } return super.equals(clazz); } - + @Override public int hashCode() { return mClass.hashCode(); } + @Override public boolean isInstantiable() { int modifiers = mClass.getModifiers(); return Modifier.isAbstract(modifiers) == false && Modifier.isPublic(modifiers) == true; @@ -97,28 +103,29 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader } } - + private String mOsFrameworkLocation; - + /** A cache for binary data extracted from the zip */ private final HashMap<String, byte[]> mEntryCache = new HashMap<String, byte[]>(); /** A cache for already defined Classes */ private final HashMap<String, Class<?> > mClassCache = new HashMap<String, Class<?> >(); - + /** * Creates the class loader by providing the os path to the framework jar archive - * + * * @param osFrameworkLocation OS Path of the framework JAR file */ public AndroidJarLoader(String osFrameworkLocation) { super(); mOsFrameworkLocation = osFrameworkLocation; } - + + @Override public String getSource() { return mOsFrameworkLocation; } - + /** * Pre-loads all class binary data that belong to the given package by reading the archive * once and caching them internally. @@ -130,7 +137,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader * found later. * <p/> * May throw some exceptions if the framework JAR cannot be read. - * + * * @param packageFilter The package that contains all the class data to preload, using a fully * qualified binary name (.e.g "com.my.package."). The matching algorithm * is simple "startsWith". Use an empty string to include everything. @@ -144,17 +151,17 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader throws IOException, InvalidAttributeValueException, ClassFormatError { // Transform the package name into a zip entry path String pathFilter = packageFilter.replaceAll("\\.", "/"); //$NON-NLS-1$ //$NON-NLS-2$ - + SubMonitor progress = SubMonitor.convert(monitor, taskLabel == null ? "" : taskLabel, 100); - + // create streams to read the intermediary archive FileInputStream fis = new FileInputStream(mOsFrameworkLocation); ZipInputStream zis = new ZipInputStream(fis); - ZipEntry entry; + ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { // get the name of the entry. String entryPath = entry.getName(); - + if (!entryPath.endsWith(AdtConstants.DOT_CLASS)) { // only accept class files continue; @@ -186,18 +193,19 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader * Finds and loads all classes that derive from a given set of super classes. * <p/> * As a side-effect this will load and cache most, if not all, classes in the input JAR file. - * + * * @param packageFilter Base name of package of classes to find. * Use an empty string to find everyting. - * @param superClasses The super classes of all the classes to find. + * @param superClasses The super classes of all the classes to find. * @return An hash map which keys are the super classes looked for and which values are * ArrayList of the classes found. The array lists are always created for all the * valid keys, they are simply empty if no deriving class is found for a given - * super class. + * super class. * @throws IOException * @throws InvalidAttributeValueException * @throws ClassFormatError */ + @Override public HashMap<String, ArrayList<IClassDescriptor>> findClassesDerivingFrom( String packageFilter, String[] superClasses) @@ -228,11 +236,11 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader continue; } String className = entryPathToClassName(entryPath); - + Class<?> loaded_class = mClassCache.get(className); if (loaded_class == null) { byte[] data = mEntryCache.get(className); - if (data == null) { + if (data == null) { // Get the class and cache it long entrySize = entry.getSize(); if (entrySize > Integer.MAX_VALUE) { @@ -268,7 +276,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader /** * Finds the class with the specified binary name. - * + * * {@inheritDoc} */ @Override @@ -282,7 +290,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader } else if (cached_class != null) { return cached_class; } - + // if not found, look it up and cache it byte[] data = loadClassData(name); if (data != null) { @@ -296,13 +304,13 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader } catch (ClassNotFoundException e) { throw e; } catch (Exception e) { - throw new ClassNotFoundException(e.getMessage()); + throw new ClassNotFoundException(e.getMessage()); } } /** * Defines a class based on its binary data and caches the resulting class object. - * + * * @param name The binary name of the class (i.e. package.class1$class2) * @param data The binary data from the loader. * @return The class defined @@ -319,17 +327,17 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader } return cached_class; } - + /** * Loads a class data from its binary name. * <p/> * This uses the class binary data that has been preloaded earlier by the preLoadClasses() * method if possible. - * + * * @param className the binary name * @return an array of bytes representing the class data or null if not found - * @throws InvalidAttributeValueException - * @throws IOException + * @throws InvalidAttributeValueException + * @throws IOException */ private synchronized byte[] loadClassData(String className) throws InvalidAttributeValueException, IOException { @@ -338,7 +346,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader if (data != null) { return data; } - + // The name is a binary name. Something like "android.R", or "android.R$id". // Make a path out of it. String entryName = className.replaceAll("\\.", "/") + AdtConstants.DOT_CLASS; //$NON-NLS-1$ //$NON-NLS-2$ @@ -346,14 +354,14 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader // create streams to read the intermediary archive FileInputStream fis = new FileInputStream(mOsFrameworkLocation); ZipInputStream zis = new ZipInputStream(fis); - + // loop on the entries of the intermediary package and put them in the final package. ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { // get the name of the entry. String currEntryName = entry.getName(); - + if (currEntryName.equals(entryName)) { long entrySize = entry.getSize(); if (entrySize > Integer.MAX_VALUE) { @@ -370,7 +378,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader /** * Reads data for the <em>current</em> entry from the zip input stream. - * + * * @param zis The Zip input stream * @param entrySize The entry size. -1 if unknown. * @return The new data for the <em>current</em> entry. @@ -378,17 +386,17 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader */ private byte[] readZipData(ZipInputStream zis, int entrySize) throws IOException { int block_size = 1024; - int data_size = entrySize < 1 ? block_size : entrySize; + int data_size = entrySize < 1 ? block_size : entrySize; int offset = 0; byte[] data = new byte[data_size]; - + while(zis.available() != 0) { int count = zis.read(data, offset, data_size - offset); if (count < 0) { // read data is done break; } offset += count; - + if (entrySize >= 1 && offset >= entrySize) { // we know the size and we're done break; } @@ -403,7 +411,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader block_size *= 2; } } - + if (offset < data_size) { // buffer was allocated too large, trim it byte[] temp = new byte[offset]; @@ -412,7 +420,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader } data = temp; } - + return data; } @@ -421,6 +429,7 @@ public class AndroidJarLoader extends ClassLoader implements IAndroidClassLoader * @param className the fully-qualified name of the class to return. * @throws ClassNotFoundException */ + @Override public IClassDescriptor getClass(String className) throws ClassNotFoundException { try { return new ClassWrapper(loadClass(className)); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/LayoutDeviceManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/LayoutDeviceManager.java index 57d1e50..988c2f4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/LayoutDeviceManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/LayoutDeviceManager.java @@ -80,6 +80,7 @@ public class LayoutDeviceManager { /** * @throws SAXException */ + @Override public void error(SAXParseException ex) throws SAXException { mFoundError = true; AdtPlugin.log(ex, "Error validating %1$s", mSourceLocation); @@ -88,6 +89,7 @@ public class LayoutDeviceManager { /** * @throws SAXException */ + @Override public void fatalError(SAXParseException ex) throws SAXException { mFoundError = true; AdtPlugin.log(ex, "Error validating %1$s", mSourceLocation); @@ -96,6 +98,7 @@ public class LayoutDeviceManager { /** * @throws SAXException */ + @Override public void warning(SAXParseException ex) throws SAXException { // ignore those for now. } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java index 6c3530f..e52f820 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java @@ -174,12 +174,14 @@ public final class Sdk { */ public abstract void reload(); + @Override public void onProjectTargetChange(IProject changedProject) { if (changedProject != null && changedProject.equals(getProject())) { reload(); } } + @Override public void onTargetLoaded(IAndroidTarget target) { IProject project = getProject(); if (target != null && target.equals(Sdk.getCurrent().getTarget(project))) { @@ -187,6 +189,7 @@ public final class Sdk { } } + @Override public void onSdkLoaded() { // do nothing; } @@ -214,6 +217,7 @@ public final class Sdk { final ArrayList<String> logMessages = new ArrayList<String>(); ISdkLog log = new ISdkLog() { + @Override public void error(Throwable throwable, String errorFormat, Object... arg) { if (errorFormat != null) { logMessages.add(String.format("Error: " + errorFormat, arg)); @@ -224,10 +228,12 @@ public final class Sdk { } } + @Override public void warning(String warningFormat, Object... arg) { logMessages.add(String.format("Warning: " + warningFormat, arg)); } + @Override public void printf(String msgFormat, Object... arg) { logMessages.add(String.format(msgFormat, arg)); } @@ -804,10 +810,12 @@ public final class Sdk { * Delegate listener for project changes. */ private IProjectListener mProjectListener = new IProjectListener() { + @Override public void projectClosed(IProject project) { onProjectRemoved(project, false /*deleted*/); } + @Override public void projectDeleted(IProject project) { onProjectRemoved(project, true /*deleted*/); } @@ -878,10 +886,12 @@ public final class Sdk { } } + @Override public void projectOpened(IProject project) { onProjectOpened(project); } + @Override public void projectOpenedWithWorkspace(IProject project) { // no need to force recompilation when projects are opened with the workspace. onProjectOpened(project); @@ -965,6 +975,7 @@ public final class Sdk { } } + @Override public void projectRenamed(IProject project, IPath from) { // we don't actually care about this anymore. } @@ -974,6 +985,7 @@ public final class Sdk { * Delegate listener for file changes. */ private IFileListener mFileListener = new IFileListener() { + @Override public void fileChanged(final IFile file, IMarkerDelta[] markerDeltas, int kind) { if (SdkConstants.FN_PROJECT_PROPERTIES.equals(file.getName()) && file.getParent() == file.getProject()) { @@ -1072,11 +1084,13 @@ public final class Sdk { * project and file listeners (for a given resource change event). */ private IResourceEventListener mResourceEventListener = new IResourceEventListener() { + @Override public void resourceChangeEventStart() { mModifiedProjects.clear(); mModifiedChildProjects.clear(); } + @Override public void resourceChangeEventEnd() { if (mModifiedProjects.size() == 0) { return; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/WidgetClassLoader.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/WidgetClassLoader.java index 5dcc25e..5ea2cde 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/WidgetClassLoader.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/WidgetClassLoader.java @@ -61,14 +61,17 @@ public final class WidgetClassLoader implements IAndroidClassLoader { mSimpleName = getSimpleName(fqcn); } + @Override public String getFullClassName() { return mFqcn; } + @Override public String getSimpleName() { return mSimpleName; } + @Override public IClassDescriptor[] getDeclaredClasses() { return mDeclaredClasses.toArray(new IClassDescriptor[mDeclaredClasses.size()]); } @@ -77,6 +80,7 @@ public final class WidgetClassLoader implements IAndroidClassLoader { mDeclaredClasses.add(declaredClass); } + @Override public IClassDescriptor getEnclosingClass() { return mEnclosingClass; } @@ -93,6 +97,7 @@ public final class WidgetClassLoader implements IAndroidClassLoader { mFqcn = enclosingClass.mFqcn + "$" + mFqcn.substring(enclosingClass.mFqcn.length() + 1); } + @Override public IClassDescriptor getSuperclass() { return mSuperClass; } @@ -114,6 +119,7 @@ public final class WidgetClassLoader implements IAndroidClassLoader { return mFqcn.hashCode(); } + @Override public boolean isInstantiable() { return mIsInstantiable; } @@ -152,6 +158,7 @@ public final class WidgetClassLoader implements IAndroidClassLoader { mReader = new BufferedReader(new FileReader(osFilePath)); } + @Override public String getSource() { return mOsFilePath; } @@ -301,6 +308,7 @@ public final class WidgetClassLoader implements IAndroidClassLoader { * @throws InvalidAttributeValueException * @throws ClassFormatError */ + @Override public HashMap<String, ArrayList<IClassDescriptor>> findClassesDerivingFrom(String rootPackage, String[] superClasses) throws IOException, InvalidAttributeValueException, ClassFormatError { @@ -327,6 +335,7 @@ public final class WidgetClassLoader implements IAndroidClassLoader { * @param className the fully-qualified name of the class to return. * @throws ClassNotFoundException */ + @Override public IClassDescriptor getClass(String className) throws ClassNotFoundException { return mMap.get(className); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java index 709f61b..34a4c22 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java @@ -128,6 +128,7 @@ public class ConfigurationSelector extends Composite { * Basic of {@link VerifyListener} to only accept digits. */ private static class DigitVerifier implements VerifyListener { + @Override public void verifyText(VerifyEvent e) { // check for digit only. for (int i = 0 ; i < e.text.length(); i++) { @@ -163,6 +164,7 @@ public class ConfigurationSelector extends Composite { * Implementation of {@link VerifyListener} for the Language and Region qualifiers. */ public static class LanguageRegionVerifier implements VerifyListener { + @Override public void verifyText(VerifyEvent e) { // check for length if (e.text.length() - e.end + e.start + ((Combo)e.getSource()).getText().length() > 2) { @@ -274,6 +276,7 @@ public class ConfigurationSelector extends Composite { mMode == SelectorMode.CONFIG_ONLY)); mFullTableViewer.setInput(mBaseConfiguration); mFullTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { @@ -372,6 +375,7 @@ public class ConfigurationSelector extends Composite { true /* showQualifierValue */)); mSelectionTableViewer.setInput(mSelectedConfiguration); mSelectionTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { // ignore selection changes during resfreshes in some cases. if (mOnRefresh) { @@ -602,10 +606,12 @@ public class ConfigurationSelector extends Composite { public QualifierContentProvider() { } + @Override public void dispose() { // pass } + @Override public Object[] getElements(Object inputElement) { // default easy case if (mQualifierFilter == null) { @@ -623,6 +629,7 @@ public class ConfigurationSelector extends Composite { return list.toArray(); } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { mInput = null; if (newInput instanceof FolderConfiguration) { @@ -642,6 +649,7 @@ public class ConfigurationSelector extends Composite { mShowQualifierValue = showQualifierValue; } + @Override public String getColumnText(Object element, int columnIndex) { // only one column, so we can ignore columnIndex if (element instanceof ResourceQualifier) { @@ -662,6 +670,7 @@ public class ConfigurationSelector extends Composite { return null; } + @Override public Image getColumnImage(Object element, int columnIndex) { // only one column, so we can ignore columnIndex if (element instanceof ResourceQualifier) { @@ -671,19 +680,23 @@ public class ConfigurationSelector extends Composite { return null; } + @Override public void addListener(ILabelProviderListener listener) { // pass } + @Override public void dispose() { // pass } + @Override public boolean isLabelProperty(Object element, String property) { // pass return false; } + @Override public void removeListener(ILabelProviderListener listener) { // pass } @@ -718,6 +731,7 @@ public class ConfigurationSelector extends Composite { mText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mText.addVerifyListener(new MobileCodeVerifier()); mText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onTextChange(); } @@ -784,6 +798,7 @@ public class ConfigurationSelector extends Composite { mText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mText.addVerifyListener(new MobileCodeVerifier()); mText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onTextChange(); } @@ -849,14 +864,17 @@ public class ConfigurationSelector extends Composite { mLanguage.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mLanguage.addVerifyListener(new LanguageRegionVerifier()); mLanguage.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onLanguageChange(); } + @Override public void widgetSelected(SelectionEvent e) { onLanguageChange(); } }); mLanguage.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onLanguageChange(); } @@ -917,14 +935,17 @@ public class ConfigurationSelector extends Composite { mRegion.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mRegion.addVerifyListener(new LanguageRegionVerifier()); mRegion.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onRegionChange(); } + @Override public void widgetSelected(SelectionEvent e) { onRegionChange(); } }); mRegion.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onRegionChange(); } @@ -983,6 +1004,7 @@ public class ConfigurationSelector extends Composite { super(parent, SmallestScreenWidthQualifier.NAME); ModifyListener modifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onSizeChange(); } @@ -1050,6 +1072,7 @@ public class ConfigurationSelector extends Composite { super(parent, ScreenWidthQualifier.NAME); ModifyListener modifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onSizeChange(); } @@ -1115,6 +1138,7 @@ public class ConfigurationSelector extends Composite { super(parent, ScreenHeightQualifier.NAME); ModifyListener modifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onSizeChange(); } @@ -1185,9 +1209,11 @@ public class ConfigurationSelector extends Composite { mSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mSize.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onScreenSizeChange(); } + @Override public void widgetSelected(SelectionEvent e) { onScreenSizeChange(); } @@ -1241,9 +1267,11 @@ public class ConfigurationSelector extends Composite { mRatio.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mRatio.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onScreenRatioChange(); } + @Override public void widgetSelected(SelectionEvent e) { onScreenRatioChange(); } @@ -1297,9 +1325,11 @@ public class ConfigurationSelector extends Composite { mOrientation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mOrientation.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onOrientationChange(); } + @Override public void widgetSelected(SelectionEvent e) { onOrientationChange(); } @@ -1353,9 +1383,11 @@ public class ConfigurationSelector extends Composite { mUiMode.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mUiMode.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onDockModeChange(); } + @Override public void widgetSelected(SelectionEvent e) { onDockModeChange(); } @@ -1408,9 +1440,11 @@ public class ConfigurationSelector extends Composite { mNightMode.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mNightMode.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onNightModeChange(); } + @Override public void widgetSelected(SelectionEvent e) { onNightModeChange(); } @@ -1463,9 +1497,11 @@ public class ConfigurationSelector extends Composite { mDensity.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mDensity.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onDensityChange(); } + @Override public void widgetSelected(SelectionEvent e) { onDensityChange(); } @@ -1519,9 +1555,11 @@ public class ConfigurationSelector extends Composite { mTouchScreen.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mTouchScreen.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onTouchChange(); } + @Override public void widgetSelected(SelectionEvent e) { onTouchChange(); } @@ -1574,9 +1612,11 @@ public class ConfigurationSelector extends Composite { mKeyboardState.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mKeyboardState.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onKeyboardChange(); } + @Override public void widgetSelected(SelectionEvent e) { onKeyboardChange(); } @@ -1630,9 +1670,11 @@ public class ConfigurationSelector extends Composite { mTextInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mTextInput.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onTextInputChange(); } + @Override public void widgetSelected(SelectionEvent e) { onTextInputChange(); } @@ -1686,9 +1728,11 @@ public class ConfigurationSelector extends Composite { mNavigationState.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mNavigationState.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onNavigationChange(); } + @Override public void widgetSelected(SelectionEvent e) { onNavigationChange(); } @@ -1742,9 +1786,11 @@ public class ConfigurationSelector extends Composite { mNavigation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mNavigation.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { onNavigationChange(); } + @Override public void widgetSelected(SelectionEvent e) { onNavigationChange(); } @@ -1795,6 +1841,7 @@ public class ConfigurationSelector extends Composite { super(parent, ScreenDimensionQualifier.NAME); ModifyListener modifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onSizeChange(); } @@ -1871,6 +1918,7 @@ public class ConfigurationSelector extends Composite { mText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mText.addVerifyListener(new MobileCodeVerifier()); mText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onVersionChange(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java index 3c32d96..509fec2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java @@ -170,6 +170,7 @@ public class MarginChooser extends SelectionStatusDialog implements Listener { return mMargins; } + @Override public void handleEvent(Event event) { if (event.type == SWT.Modify) { // Text field modification -- warn about non-dip numbers diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java index caf05aa..54b5716 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java @@ -171,10 +171,12 @@ public class ReferenceChooserDialog extends SelectionStatusDialog { Tree tree = mTreeViewer.getTree(); tree.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { handleDoubleClick(); } + @Override public void widgetSelected(SelectionEvent e) { handleSelection(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java index d28c79e..d6635f7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java @@ -547,6 +547,7 @@ public class ResourceChooser extends AbstractElementListSelectionDialog { return mValue; } + @Override public void handleEvent(Event event) { validate(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceContentProvider.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceContentProvider.java index 6eaa756..d26dfaf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceContentProvider.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceContentProvider.java @@ -67,6 +67,7 @@ public class ResourceContentProvider implements ITreeContentProvider { mFullLevels = fullLevels; } + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof ResourceType) { Object[] array = mResources.getResourceItemsOfType( @@ -79,11 +80,13 @@ public class ResourceContentProvider implements ITreeContentProvider { return null; } + @Override public Object getParent(Object element) { // pass return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof ResourceType) { return mResources.hasResourcesOfType((ResourceType)element); @@ -93,6 +96,7 @@ public class ResourceContentProvider implements ITreeContentProvider { return false; } + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof ResourceRepository) { if ((ResourceRepository)inputElement == mResources) { @@ -106,10 +110,12 @@ public class ResourceContentProvider implements ITreeContentProvider { return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (newInput instanceof ResourceRepository) { mResources = (ResourceRepository)newInput; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceExplorerView.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceExplorerView.java index df8a97a..746e727 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceExplorerView.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceExplorerView.java @@ -18,11 +18,11 @@ package com.android.ide.eclipse.adt.internal.ui; import com.android.ide.common.resources.ResourceFile; import com.android.ide.common.resources.ResourceItem; -import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtConstants; +import com.android.ide.eclipse.adt.AdtPlugin; +import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor.IResourceEventListener; import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources; import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager; -import com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor.IResourceEventListener; import com.android.ide.eclipse.adt.io.IFileWrapper; import com.android.io.IAbstractFile; @@ -119,6 +119,7 @@ public class ResourceExplorerView extends ViewPart implements ISelectionListener // add support for double click. mTreeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { ISelection sel = event.getSelection(); @@ -182,6 +183,7 @@ public class ResourceExplorerView extends ViewPart implements ISelectionListener /** * Processes a new selection. */ + @Override public void selectionChanged(IWorkbenchPart part, ISelection selection) { // first we test if the part is an editor. if (part instanceof IEditorPart) { @@ -302,9 +304,11 @@ public class ResourceExplorerView extends ViewPart implements ISelectionListener // listener to catch column resize to put the new width value into the store. if (prefs != null && pref_name != null) { col.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { // get the new width int w = ((TreeColumn)e.widget).getWidth(); @@ -323,6 +327,7 @@ public class ResourceExplorerView extends ViewPart implements ISelectionListener /** * Processes a start in a resource event change. */ + @Override public void resourceChangeEventStart() { // pass } @@ -330,9 +335,11 @@ public class ResourceExplorerView extends ViewPart implements ISelectionListener /** * Processes the end of a resource change event. */ + @Override public void resourceChangeEventEnd() { try { mTree.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { mTreeViewer.refresh(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceLabelProvider.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceLabelProvider.java index 4453acb..5bf8615 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceLabelProvider.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceLabelProvider.java @@ -61,6 +61,7 @@ public class ResourceLabelProvider implements ILabelProvider, ITableLabelProvide /** * @see #getColumnImage(Object, int) */ + @Override public Image getImage(Object element) { // pass return null; @@ -69,26 +70,32 @@ public class ResourceLabelProvider implements ILabelProvider, ITableLabelProvide /** * @see #getColumnText(Object, int) */ + @Override public String getText(Object element) { return getColumnText(element, 0); } + @Override public void addListener(ILabelProviderListener listener) { // pass } + @Override public void dispose() { mWarningImage.dispose(); } + @Override public boolean isLabelProperty(Object element, String property) { return false; } + @Override public void removeListener(ILabelProviderListener listener) { // pass } + @Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 1) { if (element instanceof ResourceItem) { @@ -101,6 +108,7 @@ public class ResourceLabelProvider implements ILabelProvider, ITableLabelProvide return null; } + @Override public String getColumnText(Object element, int columnIndex) { switch (columnIndex) { case 0: diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java index 6dfc17b..2b3e2c2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java @@ -55,6 +55,7 @@ public class AdtStartup implements IStartup { private DdmsPreferenceStore mStore = new DdmsPreferenceStore(); + @Override public void earlyStartup() { if (isFirstTime()) { showWelcomeWizard(); @@ -107,6 +108,7 @@ public class AdtStartup implements IStartup { private void showWelcomeWizard() { final IWorkbench workbench = PlatformUI.getWorkbench(); workbench.getDisplay().asyncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); if (window != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/UsagePermissionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/UsagePermissionPage.java index 0341b73..d8413bb 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/UsagePermissionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/UsagePermissionPage.java @@ -56,6 +56,7 @@ public class UsagePermissionPage extends WizardPage implements SelectionListener * * @param parent parent to create page into */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -106,6 +107,7 @@ public class UsagePermissionPage extends WizardPage implements SelectionListener return mYesRadio.getSelection(); } + @Override public void widgetSelected(SelectionEvent event) { if (event.getSource() == mLink) { try { @@ -124,6 +126,7 @@ public class UsagePermissionPage extends WizardPage implements SelectionListener } } + @Override public void widgetDefaultSelected(SelectionEvent e) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java index 421da9d..44a9170 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java @@ -106,6 +106,7 @@ public class WelcomeWizard extends Wizard { // Perform installation asynchronously since it takes a while. getShell().getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (createNew) { try { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java index 763a0e1..d418432 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java @@ -59,6 +59,7 @@ public class WelcomeWizardPage extends WizardPage implements ModifyListener, Sel * Create contents of the wizard. * @param parent parent widget to add page to */ + @Override @SuppressWarnings("unused") // SWT constructors have side effects so "new Label" is not unused public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -160,6 +161,7 @@ public class WelcomeWizardPage extends WizardPage implements ModifyListener, Sel return new File(text.getText()); } + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); @@ -198,9 +200,11 @@ public class WelcomeWizardPage extends WizardPage implements ModifyListener, Sel validatePage(); } + @Override public void widgetDefaultSelected(SelectionEvent e) { } + @Override public void modifyText(ModifyEvent e) { validatePage(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportAction.java index 41cf397..6ad4f54 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportAction.java @@ -39,10 +39,12 @@ public class ExportAction implements IObjectActionDelegate { /** * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { mShell = targetPart.getSite().getShell(); } + @Override public void run(IAction action) { if (mSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection)mSelection; @@ -76,6 +78,7 @@ public class ExportAction implements IObjectActionDelegate { } } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportWizardAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportWizardAction.java index dfd05c0..b1ad916 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportWizardAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/ExportWizardAction.java @@ -40,10 +40,12 @@ public class ExportWizardAction implements IObjectActionDelegate { /** * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { mWorkbench = targetPart.getSite().getWorkbenchWindow().getWorkbench(); } + @Override public void run(IAction action) { if (mSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection)mSelection; @@ -85,6 +87,7 @@ public class ExportWizardAction implements IObjectActionDelegate { } } + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/OpenWizardAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/OpenWizardAction.java index 01280cc..a3e6135 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/OpenWizardAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/actions/OpenWizardAction.java @@ -79,6 +79,7 @@ import org.eclipse.ui.internal.util.Util; /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() */ + @Override public void dispose() { // pass } @@ -86,6 +87,7 @@ import org.eclipse.ui.internal.util.Util; /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow) */ + @Override public void init(IWorkbenchWindow window) { // pass } @@ -98,6 +100,7 @@ import org.eclipse.ui.internal.util.Util; * @param action The action that got us here. Can be null when used internally. * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(IAction action) { // get the workbench and the current window @@ -165,6 +168,7 @@ import org.eclipse.ui.internal.util.Util; /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(IAction action, ISelection selection) { mSelection = selection; } @@ -172,6 +176,7 @@ import org.eclipse.ui.internal.util.Util; /* (non-Javadoc) * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { mWorkbench = targetPart.getSite().getWorkbenchWindow().getWorkbench(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java index c1ce672..4c74628 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java @@ -20,8 +20,8 @@ import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity; import com.android.ide.eclipse.adt.internal.project.ExportHelper; import com.android.ide.eclipse.adt.internal.project.ProjectHelper; -import com.android.sdklib.internal.build.KeystoreHelper; import com.android.sdklib.internal.build.DebugKeyProvider.IKeyGenOutput; +import com.android.sdklib.internal.build.KeystoreHelper; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; @@ -48,8 +48,8 @@ import java.io.InputStreamReader; import java.io.PrintStream; import java.lang.reflect.InvocationTargetException; import java.security.KeyStore; -import java.security.PrivateKey; import java.security.KeyStore.PrivateKeyEntry; +import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; @@ -88,6 +88,7 @@ public final class ExportWizard extends Wizard implements IExportWizard { protected static final int DATA_KEY = 0x004; protected static final VerifyListener sPasswordVerifier = new VerifyListener() { + @Override public void verifyText(VerifyEvent e) { // verify the characters are valid for password. int len = e.text.length(); @@ -208,6 +209,7 @@ public final class ExportWizard extends Wizard implements IExportWizard { * @throws InvocationTargetException * @throws InterruptedException */ + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { @@ -240,9 +242,11 @@ public final class ExportWizard extends Wizard implements IExportWizard { mDName, mValidity, new IKeyGenOutput() { + @Override public void err(String message) { output.add(message); } + @Override public void out(String message) { output.add(message); } @@ -330,6 +334,7 @@ public final class ExportWizard extends Wizard implements IExportWizard { * (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { // get the project from the selection Object selected = selection.getFirstElement(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java index 5c2a3cd..39ab258 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java @@ -43,11 +43,11 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.security.KeyStore; +import java.security.KeyStore.PrivateKeyEntry; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.UnrecoverableEntryException; -import java.security.KeyStore.PrivateKeyEntry; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Calendar; @@ -76,6 +76,7 @@ final class KeyCheckPage extends ExportWizardPage { setDescription(""); // TODO } + @Override public void createControl(Composite parent) { setErrorMessage(null); setMessage(null); @@ -93,6 +94,7 @@ final class KeyCheckPage extends ExportWizardPage { mDestination = new Text(composite, SWT.BORDER); mDestination.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); mDestination.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onDestinationChange(false /*forceDetailUpdate*/); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCreationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCreationPage.java index 2bc72db..aea94ad 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCreationPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCreationPage.java @@ -35,7 +35,7 @@ import org.eclipse.swt.widgets.Text; import java.util.List; /** - * Key creation page. + * Key creation page. */ final class KeyCreationPage extends ExportWizardPage { @@ -54,7 +54,7 @@ final class KeyCreationPage extends ExportWizardPage { private int mValidity = 0; private List<String> mExistingAliases; - + protected KeyCreationPage(ExportWizard wizard, String pageName) { super(pageName); mWizard = wizard; @@ -63,12 +63,13 @@ final class KeyCreationPage extends ExportWizardPage { setDescription(""); // TODO? } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout gl = new GridLayout(2, false); composite.setLayout(gl); - + GridData gd; new Label(composite, SWT.NONE).setText("Alias:"); @@ -89,6 +90,7 @@ final class KeyCreationPage extends ExportWizardPage { final Text validityText = new Text(composite, SWT.BORDER); validityText.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); validityText.addVerifyListener(new VerifyListener() { + @Override public void verifyText(VerifyEvent e) { // check for digit only. for (int i = 0 ; i < e.text.length(); i++) { @@ -104,7 +106,7 @@ final class KeyCreationPage extends ExportWizardPage { new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData( gd = new GridData(GridData.FILL_HORIZONTAL)); gd.horizontalSpan = 2; - + new Label(composite, SWT.NONE).setText("First and Last Name:"); mCnField = new Text(composite, SWT.BORDER); mCnField.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); @@ -124,7 +126,7 @@ final class KeyCreationPage extends ExportWizardPage { new Label(composite, SWT.NONE).setText("State or Province:"); mStField = new Text(composite, SWT.BORDER); mStField.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); - + new Label(composite, SWT.NONE).setText("Country Code (XX):"); mCField = new Text(composite, SWT.BORDER); mCField.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); @@ -133,26 +135,30 @@ final class KeyCreationPage extends ExportWizardPage { setErrorMessage(null); setMessage(null); setControl(composite); - + mAlias.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mWizard.setKeyAlias(mAlias.getText().trim()); onChange(); } }); mKeyPassword.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mWizard.setKeyPassword(mKeyPassword.getText()); onChange(); } }); mKeyPassword2.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onChange(); } }); - + validityText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { try { mValidity = Integer.parseInt(validityText.getText()); @@ -166,11 +172,12 @@ final class KeyCreationPage extends ExportWizardPage { }); ModifyListener dNameListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onDNameChange(); } }; - + mCnField.addModifyListener(dNameListener); mOuField.addModifyListener(dNameListener); mOField.addModifyListener(dNameListener); @@ -178,33 +185,33 @@ final class KeyCreationPage extends ExportWizardPage { mStField.addModifyListener(dNameListener); mCField.addModifyListener(dNameListener); } - + @Override void onShow() { // fill the texts with information loaded from the project. if ((mProjectDataChanged & (DATA_PROJECT | DATA_KEYSTORE)) != 0) { // reset the keystore/alias from the content of the project IProject project = mWizard.getProject(); - + // disable onChange for now. we'll call it once at the end. mDisableOnChange = true; - + String alias = ProjectHelper.loadStringProperty(project, ExportWizard.PROPERTY_ALIAS); if (alias != null) { mAlias.setText(alias); } - + // get the existing list of keys if applicable if (mWizard.getKeyCreationMode()) { mExistingAliases = mWizard.getExistingAliases(); } else { mExistingAliases = null; } - + // reset the passwords mKeyPassword.setText(""); //$NON-NLS-1$ mKeyPassword2.setText(""); //$NON-NLS-1$ - + // enable onChange, and call it to display errors and enable/disable pageCompleted. mDisableOnChange = false; onChange(); @@ -216,7 +223,7 @@ final class KeyCreationPage extends ExportWizardPage { if (mWizard.getKeyCreationMode()) { // this means we create a key from an existing store return mWizard.getKeySelectionPage(); } - + return mWizard.getKeystoreSelectionPage(); } @@ -289,26 +296,26 @@ final class KeyCreationPage extends ExportWizardPage { setPageComplete(true); } - + /** * Handles changes in the DName fields. */ private void onDNameChange() { StringBuilder sb = new StringBuilder(); - + buildDName("CN", mCnField, sb); buildDName("OU", mOuField, sb); buildDName("O", mOField, sb); buildDName("L", mLField, sb); buildDName("ST", mStField, sb); buildDName("C", mCField, sb); - + mDName = sb.toString(); mWizard.setDName(mDName); onChange(); } - + /** * Builds the distinguished name string with the provided {@link StringBuilder}. * @param prefix the prefix of the entry. @@ -322,7 +329,7 @@ final class KeyCreationPage extends ExportWizardPage { if (sb.length() > 0) { sb.append(","); } - + sb.append(prefix); sb.append('='); sb.append(value); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeySelectionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeySelectionPage.java index 131e009..604a208 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeySelectionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeySelectionPage.java @@ -45,7 +45,7 @@ import java.util.ArrayList; import java.util.Enumeration; /** - * Key Selection Page. This is used when an existing keystore is used. + * Key Selection Page. This is used when an existing keystore is used. */ final class KeySelectionPage extends ExportWizardPage { @@ -66,6 +66,7 @@ final class KeySelectionPage extends ExportWizardPage { setDescription(""); // TODO } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); @@ -87,7 +88,7 @@ final class KeySelectionPage extends ExportWizardPage { mKeyAliasesLabel.setText("Alias:"); mKeyAliases = new Combo(composite, SWT.READ_ONLY); mKeyAliases.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - + new Composite(composite, SWT.NONE).setLayoutData(gd = new GridData()); gd.heightHint = 0; gd.widthHint = 50; @@ -105,7 +106,7 @@ final class KeySelectionPage extends ExportWizardPage { setErrorMessage(null); setMessage(null); setControl(composite); - + mUseExistingKey.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -114,7 +115,7 @@ final class KeySelectionPage extends ExportWizardPage { onChange(); } }); - + mKeyAliases.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -122,15 +123,16 @@ final class KeySelectionPage extends ExportWizardPage { onChange(); } }); - + mKeyPassword.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mWizard.setKeyPassword(mKeyPassword.getText()); onChange(); } }); } - + @Override void onShow() { // fill the texts with information loaded from the project. @@ -155,7 +157,7 @@ final class KeySelectionPage extends ExportWizardPage { FileInputStream fis = new FileInputStream(mWizard.getKeystore()); keyStore.load(fis, mWizard.getKeystorePassword().toCharArray()); fis.close(); - + Enumeration<String> aliases = keyStore.aliases(); // get the alias from the project previous export, and look for a match as @@ -164,7 +166,7 @@ final class KeySelectionPage extends ExportWizardPage { String keyAlias = ProjectHelper.loadStringProperty(project, ExportWizard.PROPERTY_ALIAS); - + ArrayList<String> aliasList = new ArrayList<String>(); int selection = -1; @@ -178,7 +180,7 @@ final class KeySelectionPage extends ExportWizardPage { } count++; } - + mWizard.setExistingAliases(aliasList); if (selection != -1) { @@ -213,7 +215,7 @@ final class KeySelectionPage extends ExportWizardPage { } } } - + @Override public IWizardPage getPreviousPage() { return mWizard.getKeystoreSelectionPage(); @@ -224,7 +226,7 @@ final class KeySelectionPage extends ExportWizardPage { if (mWizard.getKeyCreationMode()) { return mWizard.getKeyCreationPage(); } - + return mWizard.getKeyCheckPage(); } @@ -245,7 +247,7 @@ final class KeySelectionPage extends ExportWizardPage { setPageComplete(false); return; } - + if (mKeyPassword.getText().trim().length() == 0) { setErrorMessage("Enter key password."); setPageComplete(false); @@ -255,7 +257,7 @@ final class KeySelectionPage extends ExportWizardPage { setPageComplete(true); } - + private void enableWidgets() { boolean useKey = !mWizard.getKeyCreationMode(); mKeyAliasesLabel.setEnabled(useKey); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeystoreSelectionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeystoreSelectionPage.java index a02b7b0..eabee15 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeystoreSelectionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeystoreSelectionPage.java @@ -38,7 +38,7 @@ import java.io.File; /** * Keystore selection page. This page allows to choose to create a new keystore or use an - * existing one. + * existing one. */ final class KeystoreSelectionPage extends ExportWizardPage { @@ -59,14 +59,15 @@ final class KeystoreSelectionPage extends ExportWizardPage { setDescription(""); //TODO } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout gl = new GridLayout(3, false); composite.setLayout(gl); - + GridData gd; - + mUseExistingKeystore = new Button(composite, SWT.RADIO); mUseExistingKeystore.setText("Use existing keystore"); mUseExistingKeystore.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); @@ -122,7 +123,7 @@ final class KeystoreSelectionPage extends ExportWizardPage { setErrorMessage(null); setMessage(null); setControl(composite); - + mUseExistingKeystore.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -133,8 +134,9 @@ final class KeystoreSelectionPage extends ExportWizardPage { onChange(); } }); - + mKeystore.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mWizard.setKeystore(mKeystore.getText().trim()); onChange(); @@ -142,6 +144,7 @@ final class KeystoreSelectionPage extends ExportWizardPage { }); mKeystorePassword.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mWizard.setKeystorePassword(mKeystorePassword.getText()); onChange(); @@ -149,41 +152,42 @@ final class KeystoreSelectionPage extends ExportWizardPage { }); mKeystorePassword2.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onChange(); } }); } - + @Override public IWizardPage getNextPage() { if (mUseExistingKeystore.getSelection()) { return mWizard.getKeySelectionPage(); } - + return mWizard.getKeyCreationPage(); } - + @Override void onShow() { // fill the texts with information loaded from the project. if ((mProjectDataChanged & DATA_PROJECT) != 0) { // reset the keystore/alias from the content of the project IProject project = mWizard.getProject(); - + // disable onChange for now. we'll call it once at the end. mDisableOnChange = true; - + String keystore = ProjectHelper.loadStringProperty(project, ExportWizard.PROPERTY_KEYSTORE); if (keystore != null) { mKeystore.setText(keystore); } - + // reset the passwords mKeystorePassword.setText(""); //$NON-NLS-1$ mKeystorePassword2.setText(""); //$NON-NLS-1$ - + // enable onChange, and call it to display errors and enable/disable pageCompleted. mDisableOnChange = false; onChange(); @@ -229,7 +233,7 @@ final class KeystoreSelectionPage extends ExportWizardPage { } } } - + String value = mKeystorePassword.getText(); if (value.length() == 0) { setErrorMessage("Enter keystore password."); @@ -247,7 +251,7 @@ final class KeystoreSelectionPage extends ExportWizardPage { setPageComplete(false); return; } - + if (mKeystorePassword.getText().equals(mKeystorePassword2.getText()) == false) { setErrorMessage("Keystore passwords do not match."); setPageComplete(false); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java index 9ebdfbb..f13d776 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java @@ -43,9 +43,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; -import java.io.File; -import java.io.IOException; - /** * First Export Wizard Page. Display warning/errors. */ @@ -71,6 +68,7 @@ final class ProjectCheckPage extends ExportWizardPage { setDescription("Performs a set of checks to make sure the application can be exported."); } + @Override public void createControl(Composite parent) { mProjectChooserHelper = new ProjectChooserHelper(parent.getShell(), new NonLibraryProjectOnlyFilter()); @@ -97,6 +95,7 @@ final class ProjectCheckPage extends ExportWizardPage { mProjectText = new Text(projectComposite, SWT.BORDER); mProjectText.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); mProjectText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { handleProjectNameChange(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ApplicationInfoPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ApplicationInfoPage.java index 9b2ce05..0d7e9ae 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ApplicationInfoPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ApplicationInfoPage.java @@ -92,6 +92,7 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif /** * Create contents of the wizard. */ + @Override @SuppressWarnings("unused") // Eclipse marks SWT constructors with side effects as unused public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -293,6 +294,7 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif return super.isPageComplete(); } + @Override public void modifyText(ModifyEvent e) { if (mIgnore) { return; @@ -366,6 +368,7 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif validatePage(); } + @Override public void widgetSelected(SelectionEvent e) { if (mIgnore) { return; @@ -430,6 +433,7 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif validatePage(); } + @Override public void widgetDefaultSelected(SelectionEvent e) { } @@ -568,6 +572,7 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif File projectDir = mValues.projectLocation; File[] allDirs = projectDir.listFiles(new FileFilter() { + @Override public boolean accept(File pathname) { return pathname.isDirectory(); } @@ -725,6 +730,7 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif // ---- Implement ITargetChangeListener ---- + @Override public void onSdkLoaded() { if (mSdkCombo == null) { return; @@ -740,10 +746,12 @@ class ApplicationInfoPage extends WizardPage implements SelectionListener, Modif setSdkTargets(targets, mValues.target); } + @Override public void onProjectTargetChange(IProject changedProject) { // Ignore } + @Override public void onTargetLoaded(IAndroidTarget target) { // Ignore } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java index e6739b3..ff1bc98 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java @@ -477,6 +477,7 @@ public class NewProjectCreator { final IJavaProject javaProject = JavaCore.create(mainProject); Display.getDefault().syncExec(new Runnable() { + @Override public void run() { IWorkingSet[] workingSets = mValues.workingSets; if (workingSets.length > 0 && javaProject != null @@ -506,6 +507,7 @@ public class NewProjectCreator { final IJavaProject javaProject = JavaCore.create(testProject); Display.getDefault().syncExec(new Runnable() { + @Override public void run() { IWorkingSet[] workingSets = mValues.workingSets; if (workingSets.length > 0 && javaProject != null diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizard.java index 0277496..d5bd895 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizard.java @@ -96,6 +96,7 @@ public class NewProjectWizard extends Wizard implements INewWizard { } } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { setHelpAvailable(false); // TODO have help ImageDescriptor desc = AdtPlugin.getImageDescriptor(PROJECT_LOGO_LARGE); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java index 7797850..3db3353 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java @@ -108,6 +108,7 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis * Create contents of the wizard. * @param parent the parent to add the page to */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(3, false)); @@ -193,6 +194,7 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis validatePage(); } + @Override public void modifyText(ModifyEvent e) { if (mIgnore) { return; @@ -241,6 +243,7 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis updateLocationPathField(null); } + @Override public void widgetSelected(SelectionEvent e) { if (mIgnore) { return; @@ -338,6 +341,7 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis } } + @Override public void widgetDefaultSelected(SelectionEvent e) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java index c3acdad..d54697f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java @@ -68,6 +68,7 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif /** * Create contents of the wizard. */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(2, false)); @@ -169,6 +170,7 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif } } + @Override public void widgetSelected(SelectionEvent e) { if (mIgnore) { return; @@ -190,9 +192,11 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif validatePage(); } + @Override public void widgetDefaultSelected(SelectionEvent e) { } + @Override public void modifyText(ModifyEvent e) { if (mIgnore) { return; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java index 495db18..11d0e95 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java @@ -66,6 +66,7 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { /** * Create contents of the wizard. */ + @Override public void createControl(Composite parent) { Group group = new Group(parent, SWT.SHADOW_ETCHED_IN); // Layout has 1 column @@ -279,6 +280,7 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { } // ---- Implements ITargetChangeListener ---- + @Override public void onSdkLoaded() { if (mSdkTargetSelector == null) { return; @@ -327,10 +329,12 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { validatePage(); } + @Override public void onProjectTargetChange(IProject changedProject) { // Ignore } + @Override public void onTargetLoaded(IAndroidTarget target) { // Ignore } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java index 9dcee9e..51e1e46 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java @@ -68,6 +68,7 @@ class TestTargetPage extends WizardPage implements SelectionListener { /** * Create contents of the wizard. */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -148,6 +149,7 @@ class TestTargetPage extends WizardPage implements SelectionListener { validatePage(); } + @Override public void widgetSelected(SelectionEvent e) { if (mIgnore) { return; @@ -183,6 +185,7 @@ class TestTargetPage extends WizardPage implements SelectionListener { return project; } + @Override public void widgetDefaultSelected(SelectionEvent e) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java index b2a6a05..398b806 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java @@ -77,6 +77,7 @@ public class ChooseConfigurationPage extends WizardPage { } } + @Override public void createControl(Composite parent) { // This UI is maintained with WindowBuilder. @@ -114,6 +115,7 @@ public class ChooseConfigurationPage extends WizardPage { mWsFolderPathTextField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mWsFolderPathTextField.setToolTipText(tooltip); mWsFolderPathTextField.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { onWsFolderPathUpdated(); } @@ -184,6 +186,7 @@ public class ChooseConfigurationPage extends WizardPage { * Callback called when the configuration has changed in the {@link ConfigurationSelector}. */ private class ConfigurationChangeListener implements Runnable { + @Override public void run() { if (mInternalConfigSelectorUpdate) { return; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java index a0bf7c1..41d16c6 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java @@ -435,6 +435,7 @@ class NewXmlFileCreationPage extends WizardPage { * * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override @SuppressWarnings("unused") // SWT constructors have side effects, they aren't unused public void createControl(Composite parent) { // This UI is maintained with WindowBuilder. @@ -501,6 +502,7 @@ class NewXmlFileCreationPage extends WizardPage { mFileNameTextField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mFileNameTextField.setToolTipText(tooltip); mFileNameTextField.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mValues.name = mFileNameTextField.getText(); validatePage(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java index ac42cc9..4e17125 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java @@ -73,6 +73,7 @@ public class NewXmlFileWizard extends Wizard implements INewWizard { private ChooseConfigurationPage mConfigPage; private Values mValues; + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { setHelpAvailable(false); // TODO have help setWindowTitle("New Android XML File"); @@ -132,6 +133,7 @@ public class NewXmlFileWizard extends Wizard implements INewWizard { // Open the file // This has to be delayed in order for focus handling to work correctly AdtPlugin.getDisplay().asyncExec(new Runnable() { + @Override public void run() { IFile file = created.getFirst(); IRegion region = created.getSecond(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFileWrapper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFileWrapper.java index af6b56b..babee35 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFileWrapper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFileWrapper.java @@ -43,6 +43,7 @@ public class IFileWrapper implements IAbstractFile { mFile = file; } + @Override public InputStream getContents() throws StreamException { try { return mFile.getContents(); @@ -51,6 +52,7 @@ public class IFileWrapper implements IAbstractFile { } } + @Override public void setContents(InputStream source) throws StreamException { try { mFile.setContents(source, IResource.FORCE, null); @@ -59,6 +61,7 @@ public class IFileWrapper implements IAbstractFile { } } + @Override public OutputStream getOutputStream() throws StreamException { return new ByteArrayOutputStream() { @Override @@ -75,22 +78,27 @@ public class IFileWrapper implements IAbstractFile { }; } + @Override public PreferredWriteMode getPreferredWriteMode() { return PreferredWriteMode.INPUTSTREAM; } + @Override public String getOsLocation() { return mFile.getLocation().toOSString(); } + @Override public String getName() { return mFile.getName(); } + @Override public boolean exists() { return mFile.exists(); } + @Override public boolean delete() { try { mFile.delete(true /*force*/, new NullProgressMonitor()); @@ -107,6 +115,7 @@ public class IFileWrapper implements IAbstractFile { return mFile; } + @Override public long getModificationStamp() { return mFile.getModificationStamp(); } @@ -129,6 +138,7 @@ public class IFileWrapper implements IAbstractFile { return mFile.hashCode(); } + @Override public IAbstractFolder getParentFolder() { IContainer p = mFile.getParent(); if (p != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFolderWrapper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFolderWrapper.java index 01c230f..c659711 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFolderWrapper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFolderWrapper.java @@ -48,14 +48,17 @@ public class IFolderWrapper implements IAbstractFolder { mContainer = container; } + @Override public String getName() { return mContainer.getName(); } + @Override public boolean exists() { return mContainer.exists(); } + @Override public boolean delete() { try { mContainer.delete(true /*force*/, new NullProgressMonitor()); @@ -66,6 +69,7 @@ public class IFolderWrapper implements IAbstractFolder { } + @Override public IAbstractResource[] listMembers() { try { IResource[] members = mContainer.members(); @@ -89,6 +93,7 @@ public class IFolderWrapper implements IAbstractFolder { return new IAbstractResource[0]; } + @Override public boolean hasFile(String name) { try { IResource[] files = mContainer.members(); @@ -104,6 +109,7 @@ public class IFolderWrapper implements IAbstractFolder { return false; } + @Override public IAbstractFile getFile(String name) { if (mFolder != null) { IFile file = mFolder.getFile(name); @@ -140,6 +146,7 @@ public class IFolderWrapper implements IAbstractFolder { return mContainer.hashCode(); } + @Override public IAbstractFolder getFolder(String name) { if (mFolder != null) { IFolder folder = mFolder.getFolder(name); @@ -150,10 +157,12 @@ public class IFolderWrapper implements IAbstractFolder { return new IFolderWrapper(folder); } + @Override public String getOsLocation() { return mContainer.getLocation().toOSString(); } + @Override public String[] list(FilenameFilter filter) { try { IResource[] members = mContainer.members(); @@ -174,6 +183,7 @@ public class IFolderWrapper implements IAbstractFolder { return new String[0]; } + @Override public IAbstractFolder getParentFolder() { IContainer p = mContainer.getParent(); if (p != null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Thu Jun 09 12:26:44 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/CommonAction.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/CommonAction.java index 30ca4cb..ae13037 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/CommonAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/CommonAction.java @@ -25,7 +25,7 @@ import org.eclipse.jface.resource.ImageDescriptor; * ICommonAction. */ public class CommonAction extends Action implements ICommonAction { - + private Runnable mRunnable; public CommonAction() { @@ -51,18 +51,19 @@ public class CommonAction extends Action implements ICommonAction { public CommonAction(String text, int style) { super(text, style); } - + @Override public void run() { if (mRunnable != null) { mRunnable.run(); } } - + /** * Sets the {@link Runnable}. * @see ICommonAction#setRunnable(Runnable) */ + @Override public void setRunnable(Runnable runnable) { mRunnable = runnable; } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java index 6604e5a..a24f122 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java @@ -17,16 +17,16 @@ package com.android.ide.eclipse.ddms; import com.android.ddmlib.AndroidDebugBridge; +import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import com.android.ddmlib.Client; import com.android.ddmlib.DdmPreferences; import com.android.ddmlib.IDevice; import com.android.ddmlib.Log; -import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import com.android.ddmlib.Log.ILogOutput; import com.android.ddmlib.Log.LogLevel; import com.android.ddmuilib.DdmUiPreferences; -import com.android.ddmuilib.StackTracePanel; import com.android.ddmuilib.DevicePanel.IUiSelectionListener; +import com.android.ddmuilib.StackTracePanel; import com.android.ddmuilib.console.DdmConsole; import com.android.ddmuilib.console.IDdmConsole; import com.android.ide.eclipse.ddms.i18n.Messages; @@ -160,6 +160,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL // changing the console properties update the UI, we need to make this change // in the UI thread. display.asyncExec(new Runnable() { + @Override public void run() { errorConsoleStream.setColor(mRed); } @@ -167,6 +168,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL // set up the ddms log to use the ddms console. Log.setLogOutput(new ILogOutput() { + @Override public void printLog(LogLevel logLevel, String tag, String message) { if (logLevel.getPriority() >= LogLevel.ERROR.getPriority()) { printToStream(errorConsoleStream, tag, message); @@ -176,11 +178,13 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL } } + @Override public void printAndPromptLog(final LogLevel logLevel, final String tag, final String message) { printLog(logLevel, tag, message); // dialog box only run in UI thread.. display.asyncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); if (logLevel == LogLevel.ERROR) { @@ -196,19 +200,23 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL // set up the ddms console to use this objects DdmConsole.setConsole(new IDdmConsole() { + @Override public void printErrorToConsole(String message) { printToStream(errorConsoleStream, null, message); showConsoleView(mDdmsConsole); } + @Override public void printErrorToConsole(String[] messages) { for (String m : messages) { printToStream(errorConsoleStream, null, m); } showConsoleView(mDdmsConsole); } + @Override public void printToConsole(String message) { printToStream(consoleStream, null, message); } + @Override public void printToConsole(String[] messages) { for (String m : messages) { printToStream(consoleStream, null, m); @@ -218,6 +226,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL // set the listener for the preference change eclipseStore.addPropertyChangeListener(new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { // get the name of the property that changed. String property = event.getProperty(); @@ -573,6 +582,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL * * @see IDeviceChangeListener#deviceConnected(IDevice) */ + @Override public void deviceConnected(IDevice device) { // if we are listening to selection coming from the ui, then we do nothing, as // any change in the devices/clients, will be handled by the UI, and we'll receive @@ -592,6 +602,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL * * @see IDeviceChangeListener#deviceDisconnected(IDevice) */ + @Override public void deviceDisconnected(IDevice device) { // if we are listening to selection coming from the ui, then we do nothing, as // any change in the devices/clients, will be handled by the UI, and we'll receive @@ -627,6 +638,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL * * @see IDeviceChangeListener#deviceChanged(IDevice) */ + @Override public void deviceChanged(IDevice device, int changeMask) { // if we are listening to selection coming from the ui, then we do nothing, as // any change in the devices/clients, will be handled by the UI, and we'll receive @@ -663,6 +675,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL * @param selectedDevice the selected device. If null, no devices are selected. * @param selectedClient The selected client. If null, no clients are selected. */ + @Override public synchronized void selectionChanged(IDevice selectedDevice, Client selectedClient) { if (mCurrentDevice != selectedDevice) { mCurrentDevice = selectedDevice; @@ -694,6 +707,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL Display display = getDisplay(); display.asyncExec(new Runnable() { + @Override public void run() { // set the new device if different. boolean newDevice = false; @@ -773,6 +787,7 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL /** * Implementation of com.android.ddmuilib.StackTracePanel.ISourceRevealer. */ + @Override public void reveal(String applicationName, String className, int line) { JavaSourceRevealer.reveal(applicationName, className, line); } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java index 662e8f9..f9c94a7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java @@ -58,19 +58,23 @@ public class LogCatMonitor { mMonitoredDevices = new HashMap<String, DeviceData>(); AndroidDebugBridge.addDeviceChangeListener(new IDeviceChangeListener() { + @Override public void deviceDisconnected(IDevice device) { unmonitorDevice(device.getSerialNumber()); mMonitoredDevices.remove(device.getSerialNumber()); } + @Override public void deviceConnected(IDevice device) { } + @Override public void deviceChanged(IDevice device, int changeMask) { } }); mPrefStore.addPropertyChangeListener(new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { if (AUTO_MONITOR_PREFKEY.equals(event.getProperty()) && event.getNewValue().equals(false)) { @@ -110,6 +114,7 @@ public class LogCatMonitor { LogCatReceiver r = LogCatReceiverFactory.INSTANCE.newReceiver(device, mPrefStore); ILogCatMessageEventListener l = new ILogCatMessageEventListener() { + @Override public void messageReceived(List<LogCatMessage> receivedMessages) { checkMessages(receivedMessages, device); } @@ -152,6 +157,7 @@ public class LogCatMonitor { private void focusLogCatView(final IDevice device, final String appName) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) { diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java index 2a7279a..4f3494c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java @@ -16,7 +16,6 @@ package com.android.ide.eclipse.ddms; -import com.android.ide.eclipse.ddms.i18n.Messages; import com.android.ide.eclipse.ddms.views.AllocTrackerView; import com.android.ide.eclipse.ddms.views.DeviceView; import com.android.ide.eclipse.ddms.views.EmulatorControlView; @@ -33,6 +32,7 @@ public class Perspective implements IPerspectiveFactory { public static String ID = "com.android.ide.eclipse.ddms.Perspective"; //$NON-NLS-1$ + @Override public void createInitialLayout(IPageLayout layout) { // create a default layout that looks like the stand alone DDMS. diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java index 1f81a6d..99d4768 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java @@ -16,6 +16,13 @@ package com.android.ide.eclipse.ddms.preferences; +import com.android.ddmuilib.logcat.LogCatMessageList; +import com.android.ddmuilib.logcat.LogCatPanel; +import com.android.ide.eclipse.ddms.DdmsPlugin; +import com.android.ide.eclipse.ddms.LogCatMonitor; +import com.android.ide.eclipse.ddms.i18n.Messages; +import com.android.ide.eclipse.ddms.views.LogCatView; + import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; @@ -27,13 +34,6 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; -import com.android.ddmuilib.logcat.LogCatMessageList; -import com.android.ddmuilib.logcat.LogCatPanel; -import com.android.ide.eclipse.ddms.DdmsPlugin; -import com.android.ide.eclipse.ddms.LogCatMonitor; -import com.android.ide.eclipse.ddms.i18n.Messages; -import com.android.ide.eclipse.ddms.views.LogCatView; - /** * Preference Pane for LogCat. */ @@ -101,6 +101,7 @@ public class LogCatPreferencePage extends FieldEditorPreferencePage implements addField(mAutoMonitorLogcat); } + @Override public void init(IWorkbench workbench) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java index 3375d87..27b788b 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java @@ -16,11 +16,11 @@ package com.android.ide.eclipse.ddms.preferences; +import com.android.ddmlib.Log.LogLevel; +import com.android.ddmuilib.PortFieldEditor; import com.android.ide.eclipse.ddms.DdmsPlugin; import com.android.ide.eclipse.ddms.i18n.Messages; import com.android.ide.eclipse.ddms.views.DeviceView.HProfHandler; -import com.android.ddmlib.Log.LogLevel; -import com.android.ddmuilib.PortFieldEditor; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.ComboFieldEditor; @@ -120,6 +120,7 @@ public class PreferencePage extends FieldEditorPreferencePage implements addField(mAdbHostValue); } + @Override public void init(IWorkbench workbench) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java index 9d10763..56e7475 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java @@ -17,22 +17,22 @@ package com.android.ide.eclipse.ddms.views; import com.android.ddmlib.AndroidDebugBridge; +import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.Client; import com.android.ddmlib.ClientData; +import com.android.ddmlib.ClientData.IHprofDumpHandler; +import com.android.ddmlib.ClientData.MethodProfilingStatus; import com.android.ddmlib.DdmPreferences; import com.android.ddmlib.IDevice; import com.android.ddmlib.SyncException; import com.android.ddmlib.SyncService; -import com.android.ddmlib.TimeoutException; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; -import com.android.ddmlib.ClientData.IHprofDumpHandler; -import com.android.ddmlib.ClientData.MethodProfilingStatus; import com.android.ddmlib.SyncService.ISyncProgressMonitor; +import com.android.ddmlib.TimeoutException; import com.android.ddmuilib.DevicePanel; +import com.android.ddmuilib.DevicePanel.IUiSelectionListener; import com.android.ddmuilib.ImageLoader; import com.android.ddmuilib.ScreenShotDialog; import com.android.ddmuilib.SyncProgressHelper; -import com.android.ddmuilib.DevicePanel.IUiSelectionListener; import com.android.ddmuilib.SyncProgressHelper.SyncRunnable; import com.android.ddmuilib.handler.BaseFileHandler; import com.android.ddmuilib.handler.MethodProfilingHandler; @@ -110,8 +110,10 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien return Messages.DeviceView_HPROF_Error; } + @Override public void onEndFailure(final Client client, final String message) { mParentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { try { displayErrorFromUiThread( @@ -129,8 +131,10 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien }); } + @Override public void onSuccess(final String remoteFilePath, final Client client) { mParentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { final IDevice device = client.getDevice(); try { @@ -146,12 +150,14 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien final String tempPath = temp.getAbsolutePath(); SyncProgressHelper.run(new SyncRunnable() { + @Override public void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { sync.pullFile(remoteFilePath, tempPath, monitor); } + @Override public void close() { sync.close(); } @@ -195,8 +201,10 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien }); } + @Override public void onSuccess(final byte[] data, final Client client) { mParentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { // get from the preference what action to take IPreferenceStore store = DdmsPlugin.getDefault().getPreferenceStore(); @@ -311,6 +319,7 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien // dialog box only run in ui thread.. display.asyncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); MessageDialog.openError(shell, Messages.DeviceView_ADB_Error, @@ -481,12 +490,13 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien /** * Sent when a new {@link IDevice} and {@link Client} are selected. - * + * * @param selectedDevice the selected device. If null, no devices are * selected. * @param selectedClient The selected client. If null, no clients are * selected. */ + @Override public void selectionChanged(IDevice selectedDevice, Client selectedClient) { // update the buttons doSelectionChanged(selectedClient); @@ -615,10 +625,12 @@ public class DeviceView extends ViewPart implements IUiSelectionListener, IClien toolBarManager.add(mCaptureAction); } + @Override public void clientChanged(final Client client, int changeMask) { if ((changeMask & Client.CHANGE_METHOD_PROFILING_STATUS) == Client.CHANGE_METHOD_PROFILING_STATUS) { if (mDeviceList.getSelectedClient() == client) { mParentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { // force refresh of the button enabled state. doSelectionChanged(client); diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/FileExplorerView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/FileExplorerView.java index 68953d6..41796dc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/FileExplorerView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/FileExplorerView.java @@ -153,18 +153,20 @@ public class FileExplorerView extends ViewPart implements ISelectionListener { /** * Sent when a new {@link Client} is selected. - * + * * @param selectedClient The selected client. */ + @Override public void selectionChanged(Client selectedClient) { // pass } /** * Sent when a new {@link Device} is selected. - * + * * @param selectedDevice the selected device. */ + @Override public void selectionChanged(IDevice selectedDevice) { mExplorer.switchDevice(selectedDevice); } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java index fa845ff..878d0b6 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java @@ -74,6 +74,7 @@ public class LogCatView extends SelectionDependentViewPart { setSelectionDependentPanel(mLogCatPanel); mLogCatPanel.addLogCatMessageSelectionListener(new ILogCatMessageSelectionListener() { + @Override public void messageDoubleClicked(LogCatMessage m) { onDoubleClick(m); } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/OldLogCatView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/OldLogCatView.java index bbbc374..d0b1fb4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/OldLogCatView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/OldLogCatView.java @@ -112,6 +112,7 @@ public final class OldLogCatView extends SelectionDependentViewPart implements L */ private final class FilterStorage implements ILogFilterStorageManager { + @Override public LogFilter[] getFilterFromStore() { String filterPrefs = DdmsPlugin.getDefault().getPreferenceStore().getString( PREFS_FILTERS); @@ -134,6 +135,7 @@ public final class OldLogCatView extends SelectionDependentViewPart implements L return list.toArray(new LogFilter[list.size()]); } + @Override public void saveFilters(LogFilter[] filters) { StringBuilder sb = new StringBuilder(); for (LogFilter f : filters) { @@ -145,6 +147,7 @@ public final class OldLogCatView extends SelectionDependentViewPart implements L DdmsPlugin.getDefault().getPreferenceStore().setValue(PREFS_FILTERS, sb.toString()); } + @Override public boolean requiresDefaultFilter() { return true; } @@ -376,6 +379,7 @@ public final class OldLogCatView extends SelectionDependentViewPart implements L } } + @Override public void onDoubleClick() { } } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SelectionDependentViewPart.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SelectionDependentViewPart.java index 40dae43..3326d01 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SelectionDependentViewPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SelectionDependentViewPart.java @@ -53,6 +53,7 @@ public abstract class SelectionDependentViewPart extends ViewPart implements ISe * * @see ISelectionListener */ + @Override public final void selectionChanged(Client selectedClient) { mPanel.clientSelected(selectedClient); } @@ -63,6 +64,7 @@ public abstract class SelectionDependentViewPart extends ViewPart implements ISe * * @see ISelectionListener */ + @Override public final void selectionChanged(IDevice selectedDevice) { mPanel.deviceSelected(selectedDevice); } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/TableView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/TableView.java index 4a69674..1f9f0db 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/TableView.java +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/TableView.java @@ -17,8 +17,8 @@ package com.android.ide.eclipse.ddms.views; import com.android.ddmuilib.ITableFocusListener; -import com.android.ddmuilib.TablePanel; import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; +import com.android.ddmuilib.TablePanel; import com.android.ide.eclipse.ddms.i18n.Messages; import org.eclipse.jface.action.Action; @@ -44,18 +44,20 @@ public abstract class TableView extends SelectionDependentViewPart { /** * Setup the listener for the Table objects of <code>Panel</code>, and setup * the copy and select all actions. - * + * * @param panel The panel to setup * @param parent The parent composite of the Panel's content. */ void setupTableFocusListener(TablePanel panel, Composite parent) { panel.setTableFocusListener(new ITableFocusListener() { + @Override public void focusGained(IFocusedTableActivator activator) { mActivator = activator; mCopyAction.setEnabled(true); mSelectAllAction.setEnabled(true); } + @Override public void focusLost(IFocusedTableActivator activator) { if (activator == mActivator) { mActivator = null; diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Thu Jun 09 12:26:44 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java index 9bc3993..d4a64d0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java @@ -17,8 +17,8 @@ package com.android.ide.eclipse.hierarchyviewer; import com.android.ddmlib.AndroidDebugBridge; -import com.android.ddmlib.Log; import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener; +import com.android.ddmlib.Log; import com.android.ddmlib.Log.ILogOutput; import com.android.ddmlib.Log.LogLevel; import com.android.hierarchyviewerlib.HierarchyViewerDirector; @@ -78,6 +78,7 @@ public class HierarchyViewerPlugin extends AbstractUIPlugin { // change // in the UI thread. Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { errorConsoleStream.setColor(mRedColor); } @@ -85,6 +86,7 @@ public class HierarchyViewerPlugin extends AbstractUIPlugin { // set up the ddms log to use the ddms console. Log.setLogOutput(new ILogOutput() { + @Override public void printLog(LogLevel logLevel, String tag, String message) { if (logLevel.getPriority() >= LogLevel.ERROR.getPriority()) { printToStream(errorConsoleStream, tag, message); @@ -94,11 +96,13 @@ public class HierarchyViewerPlugin extends AbstractUIPlugin { } } + @Override public void printAndPromptLog(final LogLevel logLevel, final String tag, final String message) { printLog(logLevel, tag, message); // dialog box only run in UI thread.. Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { Shell shell = Display.getDefault().getActiveShell(); if (logLevel == LogLevel.ERROR) { @@ -117,6 +121,7 @@ public class HierarchyViewerPlugin extends AbstractUIPlugin { // make the director receive change in ADB. AndroidDebugBridge.addDebugBridgeChangeListener(new IDebugBridgeChangeListener() { + @Override public void bridgeChanged(AndroidDebugBridge bridge) { director.acquireBridge(bridge); } diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java index 419a63b..e950c60 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java @@ -53,10 +53,12 @@ public class HierarchyViewerPluginDirector extends HierarchyViewerDirector { } private ISchedulingRule mSchedulingRule = new ISchedulingRule() { + @Override public boolean contains(ISchedulingRule rule) { return rule == this; } + @Override public boolean isConflicting(ISchedulingRule rule) { return rule == this; } diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/PixelPerfectPespective.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/PixelPerfectPespective.java index def2864..973b30e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/PixelPerfectPespective.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/PixelPerfectPespective.java @@ -31,6 +31,7 @@ public class PixelPerfectPespective implements IPerspectiveFactory { public static final String ID = "com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective"; //$NON-NLS-1$ + @Override public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(false); diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/TreeViewPerspective.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/TreeViewPerspective.java index 09fca66..b6198d8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/TreeViewPerspective.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/TreeViewPerspective.java @@ -31,6 +31,7 @@ public class TreeViewPerspective implements IPerspectiveFactory { public static final String ID = "com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective"; //$NON-NLS-1$ + @Override public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(false); diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/DeviceSelectorView.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/DeviceSelectorView.java index e2fac78..1905cde 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/DeviceSelectorView.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/DeviceSelectorView.java @@ -96,6 +96,7 @@ public class DeviceSelectorView extends ViewPart implements IPerspectiveListener mDeviceSelector.setFocus(); } + @Override public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) { if (perspective.getId().equals(PixelPerfectPespective.ID)) { mDeviceSelector.setMode(false, true); @@ -109,6 +110,7 @@ public class DeviceSelectorView extends ViewPart implements IPerspectiveListener } } + @Override public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) { // pass diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/LayoutView.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/LayoutView.java index 62f2043..83cf38b 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/LayoutView.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/LayoutView.java @@ -131,12 +131,15 @@ public class LayoutView extends ViewPart implements ITreeChangeListener { mLayoutViewer.setFocus(); } + @Override public void selectionChanged() { // pass } + @Override public void treeChanged() { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { mLoadAllViewsAction.setEnabled(TreeViewModel.getModel().getTree() != null); mShowExtrasAction.setEnabled(TreeViewModel.getModel().getTree() != null); @@ -144,10 +147,12 @@ public class LayoutView extends ViewPart implements ITreeChangeListener { }); } + @Override public void viewportChanged() { // pass } + @Override public void zoomChanged() { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/PixelPerfectLoupeView.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/PixelPerfectLoupeView.java index f7e7789..bc45ff8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/PixelPerfectLoupeView.java +++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/PixelPerfectLoupeView.java @@ -113,21 +113,26 @@ public class PixelPerfectLoupeView extends ViewPart implements IImageChangeListe public void setFocus() { mPixelPerfectLoupe.setFocus(); } - + + @Override public void crosshairMoved() { // pass } + @Override public void treeChanged() { // pass } + @Override public void imageChanged() { // pass } + @Override public void imageLoaded() { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { Image overlayImage = PixelPerfectModel.getModel().getOverlayImage(); mShowInLoupeAction.setEnabled(overlayImage != null); @@ -135,8 +140,10 @@ public class PixelPerfectLoupeView extends ViewPart implements IImageChangeListe }); } + @Override public void overlayChanged() { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { mShowInLoupeAction .setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null); @@ -144,14 +151,17 @@ public class PixelPerfectLoupeView extends ViewPart implements IImageChangeListe }); } + @Override public void overlayTransparencyChanged() { // pass } + @Override public void selectionChanged() { // pass } + @Override public void zoomChanged() { // pass } diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs index 8401a32..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,81 @@ -#Tue Dec 06 16:39:22 PST 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Thu Jun 09 12:26:44 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/PdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/PdtPlugin.java index 298678a..3b53850 100644 --- a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/PdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/PdtPlugin.java @@ -49,6 +49,7 @@ public class PdtPlugin extends AbstractUIPlugin { // set the listener for the preference change getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { // if the SDK changed, we have to do some extra work if (PrefPage.PREFS_DEVTREE_DIR.equals(event.getProperty())) { diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/DebuggerConnector.java b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/DebuggerConnector.java index 11496df..238cad3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/DebuggerConnector.java +++ b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/DebuggerConnector.java @@ -39,10 +39,12 @@ public class DebuggerConnector extends DevTreeProjectProvider implements IDebugg private final static String ATTR_CONNECT_MAP_PORT = "port"; //$NON-NLS-1$ private final static String ATTR_CONNECT_MAP_HOSTNAME = "hostname"; //$NON-NLS-1$ + @Override public boolean isWorkspaceApp(String appName) { return getProject() != null; } + @Override public boolean connectDebugger(String appName, int appPort, int selectedPort) { IProject project = getProject(); diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/SourceRevealer.java b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/SourceRevealer.java index 77b4257..159e89f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/SourceRevealer.java +++ b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/SourceRevealer.java @@ -56,6 +56,7 @@ import org.eclipse.ui.texteditor.ITextEditor; */ public class SourceRevealer extends DevTreeProjectProvider implements ISourceRevealer { + @Override public boolean reveal(String applicationName, String className, int line) { IProject project = getProject(); @@ -113,6 +114,7 @@ public class SourceRevealer extends DevTreeProjectProvider implements ISourceRev return false; } + @Override public boolean revealLine(String fileName, int lineNumber) { SearchEngine se = new SearchEngine(); SearchPattern searchPattern = SearchPattern.createPattern( @@ -134,6 +136,7 @@ public class SourceRevealer extends DevTreeProjectProvider implements ISourceRev return requestor.didMatch(); } + @Override public boolean revealMethod(String fqmn) { SearchEngine se = new SearchEngine(); SearchPattern searchPattern = SearchPattern.createPattern( diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/ToolsLocator.java b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/ToolsLocator.java index 2b0b243..a7291cb 100644 --- a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/ToolsLocator.java +++ b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/ToolsLocator.java @@ -24,14 +24,17 @@ import com.android.ide.eclipse.pdt.PdtPlugin; */ public class ToolsLocator implements IToolsLocator { + @Override public String getAdbLocation() { return PdtPlugin.getAdbLocation(); } + @Override public String getHprofConvLocation() { return PdtPlugin.getHprofConvLocation(); } + @Override public String getTraceViewLocation() { return PdtPlugin.getTraceViewLocation(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/preferences/PrefPage.java b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/preferences/PrefPage.java index 3cd92b5..565b6ad 100644 --- a/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/preferences/PrefPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.pdt/src/com/android/ide/eclipse/pdt/internal/preferences/PrefPage.java @@ -46,6 +46,7 @@ public class PrefPage extends FieldEditorPreferencePage implements addField(mDirectoryField); } + @Override public void init(IWorkbench workbench) { } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Thu Jun 09 12:26:44 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java index 1380aea..c6993b0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java @@ -146,14 +146,17 @@ public class AaptQuickFixTest extends AdtProjectTest { // Next test quick assist. IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() { + @Override public int getLength() { return 0; } + @Override public int getOffset() { return offset; } + @Override public ISourceViewer getSourceViewer() { return viewer; } @@ -243,14 +246,17 @@ public class AaptQuickFixTest extends AdtProjectTest { // Next test quick assist. IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() { + @Override public int getLength() { return 0; } + @Override public int getOffset() { return offset; } + @Override public ISourceViewer getSourceViewer() { return viewer; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java index a33a2f6..7182d36 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java @@ -225,6 +225,7 @@ public class AdtProjectTest extends SdkTestCase { IRunnableContext context = new IRunnableContext() { + @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { runnable.run(new NullProgressMonitor()); diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java index 2802013..65c7d6f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java @@ -196,6 +196,7 @@ public class ExtractStyleRefactoringTest extends RefactoringTest { List<Attr> chosenAttributes = new ArrayList<Attr>(); for (List<Attr> list : availableAttributes.values()) { Collections.sort(list, new Comparator<Attr>() { + @Override public int compare(Attr a1, Attr a2) { return a1.getValue().compareTo(a2.getValue()); } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java index c107a30..7386e8d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java @@ -81,14 +81,17 @@ public class RefactoringAssistantTest extends AdtProjectTest { final ISourceViewer viewer = layoutEditor.getStructuredSourceViewer(); IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() { + @Override public int getLength() { return 0; } + @Override public int getOffset() { return offset; } + @Override public ISourceViewer getSourceViewer() { return viewer; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java index 2732f84..5b107cd 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java @@ -222,114 +222,142 @@ public class ManifestInfoTest extends AdtProjectTest { mApiLevel = apiLevel; } + @Override public boolean canRunOn(IAndroidTarget target) { return false; } + @Override public String getClasspathName() { return null; } + @Override public String getDefaultSkin() { return null; } + @Override public String getDescription() { return null; } + @Override public String getFullName() { return null; } + @Override public ISystemImage getSystemImage(String abiType) { return null; } + @Override public ISystemImage[] getSystemImages() { return new ISystemImage[0]; } + @Override public String getLocation() { return null; } + @Override public String getName() { return null; } + @Override public IOptionalLibrary[] getOptionalLibraries() { return null; } + @Override public IAndroidTarget getParent() { return null; } + @Override public String getPath(int pathId) { return null; } + @Override public String[] getPlatformLibraries() { return null; } + @Override public Map<String, String> getProperties() { return null; } + @Override public String getProperty(String name) { return null; } + @Override public Integer getProperty(String name, Integer defaultValue) { return null; } + @Override public Boolean getProperty(String name, Boolean defaultValue) { return null; } + @Override public int getRevision() { return 0; } + @Override public String[] getSkins() { return null; } + @Override public int getUsbVendorId() { return 0; } + @Override public String getVendor() { return null; } + @Override public AndroidVersion getVersion() { return new AndroidVersion(mApiLevel, null); } + @Override public String getVersionName() { return null; } + @Override public String hashString() { return null; } + @Override public boolean isPlatform() { return false; } + @Override public int compareTo(IAndroidTarget o) { return 0; } + @Override public boolean hasRenderingLibrary() { return false; } + @Override public String getShortClasspathName() { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/sdk/TestLayoutDevicesXsd.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/sdk/TestLayoutDevicesXsd.java index 9c3bf93..86fb8a6 100755 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/sdk/TestLayoutDevicesXsd.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/sdk/TestLayoutDevicesXsd.java @@ -82,6 +82,7 @@ public class TestLayoutDevicesXsd extends TestCase { /**
* @throws SAXException
*/
+ @Override
public void error(SAXParseException ex) throws SAXException {
mErrors += "Error: " + ex.getMessage() + "\n";
}
@@ -89,6 +90,7 @@ public class TestLayoutDevicesXsd extends TestCase { /**
* @throws SAXException
*/
+ @Override
public void fatalError(SAXParseException ex) throws SAXException {
mErrors += "Fatal Error: " + ex.getMessage() + "\n";
}
@@ -96,6 +98,7 @@ public class TestLayoutDevicesXsd extends TestCase { /**
* @throws SAXException
*/
+ @Override
public void warning(SAXParseException ex) throws SAXException {
mWarnings += "Warning: " + ex.getMessage() + "\n";
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java index 1887d9c..29e0631 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java @@ -85,10 +85,12 @@ public class ApiDemosRenderingTest extends SdkTestCase { * Since we're not going to go through the result of the rendering/layout, we can return * null for the View Key. */ + @Override public Object getViewCookie() { return null; } + @Override public ILayoutPullParser getParser(String layoutName) { return null; } @@ -108,11 +110,13 @@ public class ApiDemosRenderingTest extends SdkTestCase { private boolean mCustomViewAttempt = false; + @Override public String getNamespace() { // TODO: read from the ApiDemos manifest. return "com.example.android.apis"; } + @Override @SuppressWarnings("unchecked") public Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs) throws ClassNotFoundException, Exception { @@ -120,24 +124,29 @@ public class ApiDemosRenderingTest extends SdkTestCase { return null; } + @Override public Integer getResourceId(ResourceType type, String name) { Integer result = ++mIdCounter; mResourceMap.put(result, Pair.of(type, name)); return result; } + @Override public Pair<ResourceType, String> resolveResourceId(int id) { return mResourceMap.get(id); } + @Override public String resolveResourceId(int[] id) { return null; } + @Override public ILayoutPullParser getParser(String layoutName) { return null; } + @Override public Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie, ResourceReference itemRef, int fullPosition, int typePosition, int fullChildPosition, int typeChildPosition, @@ -145,11 +154,13 @@ public class ApiDemosRenderingTest extends SdkTestCase { return null; } + @Override public AdapterBinding getAdapterBinding(ResourceReference adapterView, Object adapterCookie, Object viewObject) { return null; } + @Override public ILayoutPullParser getParser(ResourceValue layoutResource) { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java index 675eca8..d3ca77a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java @@ -100,6 +100,7 @@ public class SampleProjectTest extends SdkTestCase { prepareProject(path, target); IRunnableContext context = new IRunnableContext() { + @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { runnable.run(new NullProgressMonitor()); @@ -192,6 +193,7 @@ public class SampleProjectTest extends SdkTestCase { final BuiltProjectDeltaVisitor deltaVisitor = new BuiltProjectDeltaVisitor(iproject); IResourceChangeListener newBuildListener = new IResourceChangeListener() { + @Override public void resourceChanged(IResourceChangeEvent event) { try { event.getDelta().accept(deltaVisitor); @@ -241,6 +243,7 @@ public class SampleProjectTest extends SdkTestCase { mIsBuilt = false; } + @Override public boolean visit(IResourceDelta delta) { if (mIProject.equals(delta.getResource())) { setBuilt(true); diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java index f914e5f..fd699fc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java @@ -187,6 +187,7 @@ public class BaseLayoutRuleTest extends LayoutTestBase { "hidden", "hiddenvalue"); AttributeFilter filter = new AttributeFilter() { + @Override public String replace(String attributeUri, String attributeName, String attributeValue) { if (attributeName.equals("hidden")) { diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java index 279e918..2d3e5ba 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java @@ -197,120 +197,146 @@ public class LayoutTestBase extends TestCase { mFqn = fqn; } + @Override public void debugPrintf(String msg, Object... params) { fail("Not supported in tests yet"); } + @Override public void displayAlert(String message) { fail("Not supported in tests yet"); } + @Override public String displayInput(String message, String value, IValidator filter) { fail("Not supported in tests yet"); return null; } + @Override public String getFqcn() { return mFqn; } + @Override public IViewMetadata getMetadata(final String fqcn) { return new IViewMetadata() { + @Override public String getDisplayName() { // This also works when there is no "." return fqcn.substring(fqcn.lastIndexOf('.') + 1); } + @Override public FillPreference getFillPreference() { return ViewMetadataRepository.get().getFillPreference(fqcn); } + @Override public Margins getInsets() { return null; } + @Override public List<String> getTopAttributes() { return ViewMetadataRepository.get().getTopAttributes(fqcn); } }; } + @Override public int getMinApiLevel() { return 8; } + @Override public IViewRule loadRule(String fqcn) { fail("Not supported in tests yet"); return null; } + @Override public String displayReferenceInput(String currentValue) { fail("Not supported in tests yet"); return null; } + @Override public IValidator getResourceValidator() { fail("Not supported in tests yet"); return null; } + @Override public String displayResourceInput(String resourceTypeName, String currentValue) { fail("Not supported in tests yet"); return null; } + @Override public String[] displayMarginInput(String all, String left, String right, String top, String bottom) { fail("Not supported in tests yet"); return null; } + @Override public String displayIncludeSourceInput() { fail("Not supported in tests yet"); return null; } + @Override public void select(Collection<INode> nodes) { fail("Not supported in tests yet"); } + @Override public String displayFragmentSourceInput() { fail("Not supported in tests yet"); return null; } + @Override public void layout() { fail("Not supported in tests yet"); } + @Override public void redraw() { fail("Not supported in tests yet"); } + @Override public Map<INode, Rect> measureChildren(INode parent, AttributeFilter filter) { return null; } + @Override public int pxToDp(int px) { fail("Not supported in tests yet"); return px; } + @Override public String getUniqueId(String prefix) { fail("Not supported in tests yet"); return null; } + @Override public int screenToLayout(int pixels) { fail("Not supported in tests yet"); return 0; } + @Override public int dpToPx(int dp) { fail("Not supported in tests yet"); return 0; } + @Override public String getAppNameSpace() { fail("Not supported in tests yet"); return null; diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java index 7ff425f..a1a2af7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java @@ -34,14 +34,17 @@ public class TestAttribute implements IAttribute, IDragAttribute { this.mValue = mValue; } + @Override public String getName() { return mName; } + @Override public String getUri() { return mUri; } + @Override public String getValue() { return mValue; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java index 908d0ba..ee04260 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java @@ -41,30 +41,37 @@ public class TestAttributeInfo implements IAttributeInfo { this.mJavadoc = javadoc; } + @Override public String getDeprecatedDoc() { return null; } + @Override public String[] getEnumValues() { return mEnumValues; } + @Override public String[] getFlagValues() { return mFlagValues; } + @Override public Format[] getFormats() { return mFormats; } + @Override public String getJavaDoc() { return mJavadoc; } + @Override public String getName() { return mName; } + @Override public String getDefinedBy() { return mDefinedBy; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java index 2c65317..197c281 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java @@ -99,6 +99,7 @@ public class TestDragElement implements IDragElement { // ==== IDragElement ==== + @Override public IDragAttribute getAttribute(String uri, String localName) { if (mAttributes == null) { return new TestAttribute(uri, localName, ""); @@ -107,18 +108,22 @@ public class TestDragElement implements IDragElement { return mAttributes.get(uri + localName); } + @Override public IDragAttribute[] getAttributes() { return mAttributes.values().toArray(new IDragAttribute[mAttributes.size()]); } + @Override public Rect getBounds() { return mRect; } + @Override public String getFqcn() { return mFqcn; } + @Override public IDragElement[] getInnerElements() { if (mChildren == null) { return new IDragElement[0]; @@ -127,10 +132,12 @@ public class TestDragElement implements IDragElement { return mChildren.toArray(new IDragElement[mChildren.size()]); } + @Override public Rect getParentBounds() { return mParent != null ? mParent.getBounds() : null; } + @Override public String getParentFqcn() { return mParent != null ? mParent.getFqcn() : null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java index 3bc9e53..04f6259 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java @@ -50,102 +50,126 @@ public class TestGraphics implements IGraphics { // ==== IGraphics ==== + @Override public void drawBoxedStrings(int x, int y, List<?> strings) { mDrawn.add("drawBoxedStrings(" + x + "," + y + "," + strings + ")"); } + @Override public void drawLine(int x1, int y1, int x2, int y2) { mDrawn.add("drawLine(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")"); } + @Override public void drawLine(Point p1, Point p2) { mDrawn.add("drawLine(" + p1 + "," + p2 + ")"); } + @Override public void drawRect(int x1, int y1, int x2, int y2) { mDrawn.add("drawRect(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")"); } + @Override public void drawRect(Point p1, Point p2) { mDrawn.add("drawRect(" + p1 + "," + p2 + ")"); } + @Override public void drawRect(Rect r) { mDrawn.add("drawRect(" + rectToString(r) + ")"); } + @Override public void drawString(String string, int x, int y) { mDrawn.add("drawString(" + x + "," + y + "," + string + ")"); } + @Override public void drawString(String string, Point topLeft) { mDrawn.add("drawString(" + string + "," + topLeft + ")"); } + @Override public void fillRect(int x1, int y1, int x2, int y2) { mDrawn.add("fillRect(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")"); } + @Override public void fillRect(Point p1, Point p2) { mDrawn.add("fillRect(" + p1 + "," + p2 + ")"); } + @Override public void fillRect(Rect r) { mDrawn.add("fillRect(" + rectToString(r) + ")"); } + @Override public int getAlpha() { return mAlpha; } + @Override public IColor getBackground() { return mBackground; } + @Override public int getFontHeight() { return 12; } + @Override public IColor getForeground() { return mForeground; } + @Override public IColor registerColor(int rgb) { mDrawn.add("registerColor(" + Integer.toHexString(rgb) + ")"); return new TestColor(rgb); } + @Override public void setAlpha(int alpha) { mAlpha = alpha; mDrawn.add("setAlpha(" + alpha + ")"); } + @Override public void setBackground(IColor color) { mDrawn.add("setBackground(" + color + ")"); mBackground = color; } + @Override public void setForeground(IColor color) { mDrawn.add("setForeground(" + color + ")"); mForeground = color; } + @Override public void setLineStyle(LineStyle style) { mDrawn.add("setLineStyle(" + style + ")"); } + @Override public void setLineWidth(int width) { mDrawn.add("setLineWidth(" + width + ")"); } + @Override public void useStyle(DrawingStyle style) { mDrawn.add("useStyle(" + style + ")"); } + @Override public void drawArrow(int x1, int y1, int x2, int y2, int size) { mDrawn.add("drawArrow(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")"); } + @Override public void drawPoint(int x, int y) { mDrawn.add("drawPoint(" + x + "," + y + ")"); } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java index ed2bc43..7e58cb9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java @@ -93,10 +93,12 @@ public class TestNode implements INode { // ==== INODE ==== + @Override public INode appendChild(String viewFqcn) { return insertChildAt(viewFqcn, mChildren.size()); } + @Override public void editXml(String undoName, INodeHandler callback) { callback.handle(this); } @@ -105,34 +107,42 @@ public class TestNode implements INode { mAttributeInfos.put(uri + attrName, info); } + @Override public IAttributeInfo getAttributeInfo(String uri, String attrName) { return mAttributeInfos.get(uri + attrName); } + @Override public Rect getBounds() { return mBounds; } + @Override public INode[] getChildren() { return mChildren.toArray(new INode[mChildren.size()]); } + @Override public IAttributeInfo[] getDeclaredAttributes() { return mAttributeInfos.values().toArray(new IAttributeInfo[mAttributeInfos.size()]); } + @Override public String getFqcn() { return mFqcn; } + @Override public IAttribute[] getLiveAttributes() { return mAttributes.values().toArray(new IAttribute[mAttributes.size()]); } + @Override public INode getParent() { return mParent; } + @Override public INode getRoot() { TestNode curr = this; while (curr.mParent != null) { @@ -142,6 +152,7 @@ public class TestNode implements INode { return curr; } + @Override public String getStringAttr(String uri, String attrName) { IAttribute attr = mAttributes.get(uri + attrName); if (attr == null) { @@ -151,6 +162,7 @@ public class TestNode implements INode { return attr.getValue(); } + @Override public INode insertChildAt(String viewFqcn, int index) { TestNode child = new TestNode(viewFqcn); if (index == -1) { @@ -162,6 +174,7 @@ public class TestNode implements INode { return child; } + @Override public void removeChild(INode node) { int index = mChildren.indexOf(node); if (index != -1) { @@ -169,6 +182,7 @@ public class TestNode implements INode { } } + @Override public boolean setAttribute(String uri, String localName, String value) { mAttributes.put(uri + localName, new TestAttribute(uri, localName, value)); return true; @@ -180,14 +194,17 @@ public class TestNode implements INode { + ", attributes=" + mAttributes + ", bounds=" + mBounds + "]"; } + @Override public int getBaseline() { return -1; } + @Override public Margins getMargins() { return null; } + @Override public List<String> getAttributeSources() { return mAttributeSources != null ? mAttributeSources : Collections.<String>emptyList(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java index 19682a1..0330216 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java @@ -55,10 +55,12 @@ class MockNamedNodeMap implements NamedNodeMap { // --------- NamedNodeMap ------- + @Override public int getLength() { return mNodeList.size(); } + @Override public Node getNamedItem(String name) { HashMap<String, Node> map = mNodeMap.get(""); // no namespace if (map != null) { @@ -68,6 +70,7 @@ class MockNamedNodeMap implements NamedNodeMap { return null; } + @Override public Node getNamedItemNS(String namespaceURI, String localName) throws DOMException { if (namespaceURI == null) { namespaceURI = ""; //no namespace @@ -81,22 +84,27 @@ class MockNamedNodeMap implements NamedNodeMap { return null; } + @Override public Node item(int index) { return mNodeList.get(index); } + @Override public Node removeNamedItem(String name) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Node setNamedItem(Node arg) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Node setNamedItemNS(Node arg) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java index def1993..ff9df19 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java @@ -31,7 +31,7 @@ public class MockNodeList implements NodeList { /** * Constructs a node list from a given children list. - * + * * @param children The children list. Can be null. */ public MockNodeList(MockXmlNode[] children) { @@ -43,10 +43,12 @@ public class MockNodeList implements NodeList { } } + @Override public int getLength() { return mChildren.size(); } + @Override public Node item(int index) { if (index >= 0 && index < mChildren.size()) { return mChildren.get(index); diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java index 49acaca..77de2c8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java @@ -119,19 +119,23 @@ public class MockXmlNode implements Node { // ----------- Node methods + @Override public Node appendChild(Node newChild) throws DOMException { mNodeList.getArrayList().add((MockXmlNode) newChild); return newChild; } + @Override public NamedNodeMap getAttributes() { return mAttributes; } + @Override public NodeList getChildNodes() { return mNodeList; } + @Override public Node getFirstChild() { if (mNodeList.getLength() > 0) { return mNodeList.item(0); @@ -139,6 +143,7 @@ public class MockXmlNode implements Node { return null; } + @Override public Node getLastChild() { if (mNodeList.getLength() > 0) { return mNodeList.item(mNodeList.getLength() - 1); @@ -146,50 +151,62 @@ public class MockXmlNode implements Node { return null; } + @Override public Node getNextSibling() { return mNextSibling; } + @Override public String getNodeName() { return mLocalName; } + @Override public String getLocalName() { return mLocalName; } + @Override public short getNodeType() { return mNodeType; } + @Override public Node getParentNode() { return mParent; } + @Override public Node getPreviousSibling() { return mPreviousSibling; } + @Override public boolean hasChildNodes() { return mNodeList.getLength() > 0; } + @Override public boolean hasAttributes() { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public boolean isSameNode(Node other) { return this == other; } + @Override public String getNodeValue() throws DOMException { return mAttrValue; } + @Override public String getPrefix() { return getPrefix(getNamespaceURI()); } + @Override public String getNamespaceURI() { return mNamespace; } @@ -197,84 +214,104 @@ public class MockXmlNode implements Node { // --- methods not implemented --- + @Override public Node cloneNode(boolean deep) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public short compareDocumentPosition(Node other) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public String getBaseURI() { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Object getFeature(String feature, String version) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Document getOwnerDocument() { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public String getTextContent() throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Object getUserData(String key) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public boolean isDefaultNamespace(String namespaceURI) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public boolean isEqualNode(Node arg) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public boolean isSupported(String feature, String version) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public String lookupNamespaceURI(String prefix) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public String lookupPrefix(String namespaceURI) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public void normalize() { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Node removeChild(Node oldChild) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public void setNodeValue(String nodeValue) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public void setPrefix(String prefix) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public void setTextContent(String textContent) throws DOMException { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ } + @Override public Object setUserData(String key, Object data, UserDataHandler handler) { throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$ diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java index 0be4cb3..b57f3da 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java @@ -55,6 +55,7 @@ public class Mocks { expect(javaProject.getOutputLocation()).andReturn(capturedOutput.getValue()).anyTimes(); expect(javaProject.getRawClasspath()).andAnswer(new IAnswer<IClasspathEntry[]>() { + @Override public IClasspathEntry[] answer() throws Throwable { return capturedEntries.getValue(); } @@ -76,18 +77,21 @@ public class Mocks { expect(javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true)).andAnswer( new IAnswer<String>() { + @Override public String answer() throws Throwable { return capturedCompliance.getValue(); } }); expect(javaProject.getOption(JavaCore.COMPILER_SOURCE, true)).andAnswer( new IAnswer<String>() { + @Override public String answer() throws Throwable { return capturedSource.getValue(); } }); expect(javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true)).andAnswer( new IAnswer<String>() { + @Override public String answer() throws Throwable { return capturedTarget.getValue(); } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java index 78919d4..5516168 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java @@ -26,6 +26,7 @@ import junit.framework.Assert; */ public class TestLogger implements ILogger { + @Override public void error(Throwable t, String errorFormat, Object... args) { String message = String.format(errorFormat, args); if (t != null) { @@ -34,10 +35,12 @@ public class TestLogger implements ILogger { Assert.fail(message); } + @Override public void printf(String msgFormat, Object... args) { System.out.println(String.format(msgFormat, args)); } + @Override public void warning(String warningFormat, Object... args) { System.err.println(String.format(warningFormat, args)); } diff --git a/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,14 @@ -#Thu Jun 09 12:26:44 PDT 2011 +#Tue Dec 20 16:31:10 PST 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning @@ -9,6 +17,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -69,3 +78,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/TraceviewLauncher.java b/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/TraceviewLauncher.java index 502084f..b232bac 100644 --- a/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/TraceviewLauncher.java +++ b/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/TraceviewLauncher.java @@ -34,6 +34,7 @@ import org.eclipse.ui.ide.IDE; public class TraceviewLauncher implements ITraceviewLauncher { + @Override public boolean openFile(String osPath) { final IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(osPath)); if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) { @@ -43,6 +44,7 @@ public class TraceviewLauncher implements ITraceviewLauncher { Display display = workbench.getDisplay(); final boolean[] result = new boolean[] { false }; display.syncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = window.getActivePage(); diff --git a/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/editors/TraceviewEditor.java b/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/editors/TraceviewEditor.java index 13f8d0f..449faec 100644 --- a/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/editors/TraceviewEditor.java +++ b/eclipse/plugins/com.android.ide.eclipse.traceview/src/com/android/ide/eclipse/traceview/editors/TraceviewEditor.java @@ -21,11 +21,11 @@ import com.android.traceview.ColorController; import com.android.traceview.DmTraceReader; import com.android.traceview.MethodData; import com.android.traceview.ProfileView; +import com.android.traceview.ProfileView.MethodHandler; import com.android.traceview.SelectionController; import com.android.traceview.TimeLineView; import com.android.traceview.TraceReader; import com.android.traceview.TraceUnits; -import com.android.traceview.ProfileView.MethodHandler; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; @@ -304,9 +304,11 @@ public class TraceviewEditor extends EditorPart implements MethodHandler { } // ---- MethodHandler methods + + @Override public void handleMethod(MethodData method) { String methodName = method.getMethodName(); - String className = method.getClassName().replaceAll("/", "."); //$NON-NLS-1$ //$NON-NLS-21$ + String className = method.getClassName().replaceAll("/", "."); //$NON-NLS-1$ //$NON-NLS-2$ String fqmn = className + "." + methodName; //$NON-NLS-1$ JavaSourceRevealer.revealMethod(fqmn); |