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 | |
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
502 files changed, 3298 insertions, 481 deletions
diff --git a/assetstudio/.settings/org.eclipse.jdt.core.prefs b/assetstudio/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/assetstudio/.settings/org.eclipse.jdt.core.prefs +++ b/assetstudio/.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/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java b/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java index 1c9fb29..0269c74 100644 --- a/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java +++ b/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java @@ -151,6 +151,7 @@ public abstract class GraphicGenerator { Density[] densityValues = Density.values(); // Sort density values into ascending order Arrays.sort(densityValues, new Comparator<Density>() { + @Override public int compare(Density d1, Density d2) { return d1.getDpiValue() - d2.getDpiValue(); } diff --git a/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java index 59812bf..4a96f30 100644 --- a/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java +++ b/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java @@ -195,6 +195,7 @@ public abstract class GeneratorTest extends TestCase implements GraphicGenerator return new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$ } + @Override public BufferedImage loadImageResource(String path) { try { return GraphicGenerator.getStencilImage(path); diff --git a/attribute_stats/.settings/org.eclipse.jdt.core.prefs b/attribute_stats/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/attribute_stats/.settings/org.eclipse.jdt.core.prefs +++ b/attribute_stats/.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/ddms/app/.settings/org.eclipse.jdt.core.prefs b/ddms/app/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/ddms/app/.settings/org.eclipse.jdt.core.prefs +++ b/ddms/app/.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/ddms/app/src/com/android/ddms/DebugPortProvider.java b/ddms/app/src/com/android/ddms/DebugPortProvider.java index 76a86b7..2dcd5d4 100644 --- a/ddms/app/src/com/android/ddms/DebugPortProvider.java +++ b/ddms/app/src/com/android/ddms/DebugPortProvider.java @@ -16,8 +16,8 @@ package com.android.ddms; -import com.android.ddmlib.IDevice; import com.android.ddmlib.DebugPortManager.IDebugPortProvider; +import com.android.ddmlib.IDevice; import org.eclipse.jface.preference.IPreferenceStore; @@ -61,6 +61,7 @@ public class DebugPortProvider implements IDebugPortProvider { * * @see IDebugPortProvider#getPort(IDevice, String) */ + @Override public int getPort(IDevice device, String appName) { if (mMap != null) { Map<String, Integer> deviceMap = mMap.get(device.getSerialNumber()); diff --git a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java index ce6865d..6775cbb 100644 --- a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java +++ b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java @@ -139,6 +139,7 @@ public class DeviceCommandDialog extends Dialog { shell.setLayout(new GridLayout(2, true)); shell.addListener(SWT.Close, new Listener() { + @Override public void handleEvent(Event event) { if (!mFinished) { Log.d("ddms", "NOT closing - cancelling command"); @@ -272,6 +273,7 @@ public class DeviceCommandDialog extends Dialog { } mShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { updateForResult(mResult); } @@ -281,6 +283,7 @@ public class DeviceCommandDialog extends Dialog { /** * Called by executeRemoteCommand(). */ + @Override public void addOutput(byte[] data, int offset, int length) { Log.v("ddms", "received " + length + " bytes"); @@ -290,6 +293,7 @@ public class DeviceCommandDialog extends Dialog { // add to text widget; must do in UI thread mText.getDisplay().asyncExec(new Runnable() { + @Override public void run() { mText.append(text); } @@ -300,6 +304,7 @@ public class DeviceCommandDialog extends Dialog { } } + @Override public void flush() { // nothing to flush. } @@ -307,6 +312,7 @@ public class DeviceCommandDialog extends Dialog { /** * Called by executeRemoteCommand(). */ + @Override public boolean isCancelled() { return mCancel; } diff --git a/ddms/app/src/com/android/ddms/Main.java b/ddms/app/src/com/android/ddms/Main.java index 6fe69c7..a7e0a2b 100644 --- a/ddms/app/src/com/android/ddms/Main.java +++ b/ddms/app/src/com/android/ddms/Main.java @@ -48,6 +48,7 @@ public class Main { * thing down. */ private static class UncaughtHandler implements Thread.UncaughtExceptionHandler { + @Override public void uncaughtException(Thread t, Throwable e) { Log.e("ddms", "shutting down due to uncaught exception"); Log.e("ddms", e); diff --git a/ddms/app/src/com/android/ddms/PrefsDialog.java b/ddms/app/src/com/android/ddms/PrefsDialog.java index cdcdd8a..84304df 100644 --- a/ddms/app/src/com/android/ddms/PrefsDialog.java +++ b/ddms/app/src/com/android/ddms/PrefsDialog.java @@ -242,6 +242,7 @@ public final class PrefsDialog { * a preference (e.g. not when the prefs file is loaded). */ private static class ChangeListener implements IPropertyChangeListener { + @Override public void propertyChange(PropertyChangeEvent event) { String changed = event.getProperty(); PreferenceStore prefStore = mStore.getPreferenceStore(); diff --git a/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java b/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java index d00bc7f..9a8ada3 100644 --- a/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java +++ b/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java @@ -129,6 +129,7 @@ public class StaticPortConfigDialog extends Dialog { mShell.setLayout(new GridLayout(1, true)); mShell.addListener(SWT.Close, new Listener() { + @Override public void handleEvent(Event event) { event.doit = true; } diff --git a/ddms/app/src/com/android/ddms/StaticPortEditDialog.java b/ddms/app/src/com/android/ddms/StaticPortEditDialog.java index 9191d9f..c9cb044 100644 --- a/ddms/app/src/com/android/ddms/StaticPortEditDialog.java +++ b/ddms/app/src/com/android/ddms/StaticPortEditDialog.java @@ -149,6 +149,7 @@ public class StaticPortEditDialog extends Dialog { mShell.setLayout(new GridLayout(1, false)); mShell.addListener(SWT.Close, new Listener() { + @Override public void handleEvent(Event event) { } }); @@ -167,6 +168,7 @@ public class StaticPortEditDialog extends Dialog { deviceSNText.setText(mDeviceSn); } deviceSNText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mDeviceSn = deviceSNText.getText().trim(); validate(); @@ -182,6 +184,7 @@ public class StaticPortEditDialog extends Dialog { } appNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); appNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mAppName = appNameText.getText().trim(); validate(); @@ -197,6 +200,7 @@ public class StaticPortEditDialog extends Dialog { } debugPortText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); debugPortText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mPortNumber = debugPortText.getText().trim(); validate(); diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java index a5a3867..0584d82 100644 --- a/ddms/app/src/com/android/ddms/UIThread.java +++ b/ddms/app/src/com/android/ddms/UIThread.java @@ -17,20 +17,21 @@ package com.android.ddms; 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.IDevice; -import com.android.ddmlib.Log; -import com.android.ddmlib.SyncException; -import com.android.ddmlib.SyncService; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.ClientData.IHprofDumpHandler; import com.android.ddmlib.ClientData.MethodProfilingStatus; +import com.android.ddmlib.IDevice; +import com.android.ddmlib.Log; import com.android.ddmlib.Log.ILogOutput; import com.android.ddmlib.Log.LogLevel; +import com.android.ddmlib.SyncException; +import com.android.ddmlib.SyncService; import com.android.ddmuilib.AllocationPanel; import com.android.ddmuilib.DdmUiPreferences; import com.android.ddmuilib.DevicePanel; +import com.android.ddmuilib.DevicePanel.IUiSelectionListener; import com.android.ddmuilib.EmulatorControlPanel; import com.android.ddmuilib.HeapPanel; import com.android.ddmuilib.ITableFocusListener; @@ -41,14 +42,12 @@ import com.android.ddmuilib.ScreenShotDialog; import com.android.ddmuilib.SysinfoPanel; import com.android.ddmuilib.TablePanel; import com.android.ddmuilib.ThreadPanel; -import com.android.ddmuilib.DevicePanel.IUiSelectionListener; import com.android.ddmuilib.actions.ToolItemAction; import com.android.ddmuilib.explorer.DeviceExplorer; import com.android.ddmuilib.handler.BaseFileHandler; import com.android.ddmuilib.handler.MethodProfilingHandler; import com.android.ddmuilib.log.event.EventLogPanel; import com.android.ddmuilib.logcat.LogCatPanel; -import com.android.ddmuilib.logcat.LogCatReceiver; import com.android.ddmuilib.logcat.LogColors; import com.android.ddmuilib.logcat.LogFilter; import com.android.ddmuilib.logcat.LogPanel; @@ -186,6 +185,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { private final class FilterStorage implements ILogFilterStorageManager { + @Override public LogFilter[] getFilterFromStore() { String filterPrefs = PrefsDialog.getStore().getString( PREFS_FILTERS); @@ -208,6 +208,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { return list.toArray(new LogFilter[list.size()]); } + @Override public void saveFilters(LogFilter[] filters) { StringBuilder sb = new StringBuilder(); for (LogFilter f : filters) { @@ -219,6 +220,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { PrefsDialog.getStore().setValue(PREFS_FILTERS, sb.toString()); } + @Override public boolean requiresDefaultFilter() { return true; } @@ -278,6 +280,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { private IFocusedTableActivator mCurrentActivator; + @Override public void focusGained(IFocusedTableActivator activator) { mCurrentActivator = activator; if (mCopyMenuItem.isDisposed() == false) { @@ -286,6 +289,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { } } + @Override public void focusLost(IFocusedTableActivator activator) { // if we move from one table to another, it's unclear // if the old table lose its focus before the new @@ -322,8 +326,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { super(parentShell); } + @Override public void onEndFailure(final Client client, final String message) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { try { displayErrorFromUiThread( @@ -340,8 +346,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { }); } + @Override public void onSuccess(final String remoteFilePath, final Client client) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { final IDevice device = client.getDevice(); try { @@ -375,8 +383,10 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { }); } + @Override public void onSuccess(final byte[] data, final Client client) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { promptAndSave(client.getClientData().getClientDescription() + ".hprof", data, "Save HPROF file"); @@ -454,11 +464,13 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { 100, 50, null)); Log.setLogOutput(new ILogOutput() { + @Override public void printAndPromptLog(final LogLevel logLevel, final String tag, final String message) { Log.printLog(logLevel, tag, message); // dialog box only run in UI thread.. mDisplay.asyncExec(new Runnable() { + @Override public void run() { Shell activeShell = mDisplay.getActiveShell(); if (logLevel == LogLevel.ERROR) { @@ -470,6 +482,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { }); } + @Override public void printLog(LogLevel logLevel, String tag, String message) { Log.printLog(logLevel, tag, message); } @@ -581,6 +594,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { // add listener for resize/move shell.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { // get the new x/y Rectangle controlBounds = shell.getBounds(); @@ -590,6 +604,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { currentPrefs.setValue(PrefsDialog.SHELL_Y, controlBounds.y); } + @Override public void controlResized(ControlEvent e) { // get the new w/h Rectangle controlBounds = shell.getBounds(); @@ -649,6 +664,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { // add listener for resize/move shell.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { // get the new x/y Rectangle controlBounds = shell.getBounds(); @@ -658,6 +674,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { currentPrefs.setValue(PrefsDialog.EXPLORER_SHELL_Y, controlBounds.y); } + @Override public void controlResized(ControlEvent e) { // get the new w/h Rectangle controlBounds = shell.getBounds(); @@ -720,14 +737,17 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenu(APP_NAME, fileMenu, new IMenuBarCallback() { + @Override public void printError(String format, Object... args) { Log.e("DDMS Menu Bar", String.format(format, args)); } + @Override public void onPreferencesMenuSelected() { PrefsDialog.run(shell); } + @Override public void onAboutMenuSelected() { AboutDialog dlg = new AboutDialog(shell); dlg.open(); @@ -1002,6 +1022,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { // allow resizes, but cap at minPanelWidth sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = panelArea.getClientArea(); @@ -1200,6 +1221,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { // allow resizes, but cap at minPanelWidth sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = comp.getClientArea(); @@ -1580,23 +1602,28 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { mExplorer.switchDevice(mCurrentDevice); mExplorerShell.addShellListener(new ShellListener() { + @Override public void shellActivated(ShellEvent e) { // pass } + @Override public void shellClosed(ShellEvent e) { mExplorer = null; mExplorerShell = null; } + @Override public void shellDeactivated(ShellEvent e) { // pass } + @Override public void shellDeiconified(ShellEvent e) { // pass } + @Override public void shellIconified(ShellEvent e) { // pass } @@ -1619,6 +1646,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { public void setStatusLine(final String str) { try { mDisplay.asyncExec(new Runnable() { + @Override public void run() { doSetStatusLine(str); } @@ -1644,6 +1672,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { public void displayError(final String msg) { try { mDisplay.syncExec(new Runnable() { + @Override public void run() { MessageDialog.openError(mDisplay.getActiveShell(), "Error", msg); @@ -1713,6 +1742,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { * * @see IUiSelectionListener */ + @Override public void selectionChanged(IDevice selectedDevice, Client selectedClient) { if (mCurrentDevice != selectedDevice) { mCurrentDevice = selectedDevice; @@ -1750,11 +1780,13 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener { } } + @Override public void clientChanged(Client client, int changeMask) { if ((changeMask & Client.CHANGE_METHOD_PROFILING_STATUS) == Client.CHANGE_METHOD_PROFILING_STATUS) { if (mCurrentClient == client) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { // force refresh of the button enabled state. enableButtons(); diff --git a/ddms/libs/ddmlib/.settings/org.eclipse.jdt.core.prefs b/ddms/libs/ddmlib/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/ddms/libs/ddmlib/.settings/org.eclipse.jdt.core.prefs +++ b/ddms/libs/ddmlib/.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/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java index 90bd7d4..a68962f 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java @@ -56,6 +56,7 @@ public class AllocationInfo implements IStackTraceInfo { return mDescending; } + @Override public int compare(AllocationInfo o1, AllocationInfo o2) { int diff = 0; switch (mSortMode) { @@ -159,6 +160,7 @@ public class AllocationInfo implements IStackTraceInfo { * (non-Javadoc) * @see com.android.ddmlib.IStackTraceInfo#getStackTrace() */ + @Override public StackTraceElement[] getStackTrace() { return mStackTrace; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java index 63f7292..cb4612f 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java @@ -34,6 +34,7 @@ public class CollectingOutputReceiver implements IShellOutputReceiver { /** * {@inheritDoc} */ + @Override public boolean isCancelled() { return mIsCanceled; } @@ -48,6 +49,7 @@ public class CollectingOutputReceiver implements IShellOutputReceiver { /** * {@inheritDoc} */ + @Override public void addOutput(byte[] data, int offset, int length) { if (!isCancelled()) { String s = null; @@ -64,6 +66,7 @@ public class CollectingOutputReceiver implements IShellOutputReceiver { /** * {@inheritDoc} */ + @Override public void flush() { // ignore } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java index 5a3cfd1..f3931a1 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java @@ -98,6 +98,7 @@ final class Device implements IDevice { } } + @Override public boolean isCancelled() { return false; } @@ -152,6 +153,7 @@ final class Device implements IDevice { } } + @Override public boolean isCancelled() { return false; } @@ -161,11 +163,13 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getSerialNumber() */ + @Override public String getSerialNumber() { return mSerialNumber; } /** {@inheritDoc} */ + @Override public String getAvdName() { return mAvdName; } @@ -186,6 +190,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getState() */ + @Override public DeviceState getState() { return mState; } @@ -202,6 +207,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getProperties() */ + @Override public Map<String, String> getProperties() { return Collections.unmodifiableMap(mProperties); } @@ -210,6 +216,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getPropertyCount() */ + @Override public int getPropertyCount() { return mProperties.size(); } @@ -218,6 +225,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getProperty(java.lang.String) */ + @Override public String getProperty(String name) { return mProperties.get(name); } @@ -225,6 +233,7 @@ final class Device implements IDevice { /** * {@inheritDoc} */ + @Override public boolean arePropertiesSet() { return mArePropertiesSet; } @@ -232,6 +241,7 @@ final class Device implements IDevice { /** * {@inheritDoc} */ + @Override public String getPropertyCacheOrSync(String name) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { if (mArePropertiesSet) { @@ -244,6 +254,7 @@ final class Device implements IDevice { /** * {@inheritDoc} */ + @Override public String getPropertySync(String name) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { CollectingOutputReceiver receiver = new CollectingOutputReceiver(); @@ -255,6 +266,7 @@ final class Device implements IDevice { return value; } + @Override public String getMountPoint(String name) { return mMountPoints.get(name); } @@ -269,6 +281,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#isOnline() */ + @Override public boolean isOnline() { return mState == DeviceState.ONLINE; } @@ -277,6 +290,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#isEmulator() */ + @Override public boolean isEmulator() { return mSerialNumber.matches(RE_EMULATOR_SN); } @@ -285,6 +299,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#isOffline() */ + @Override public boolean isOffline() { return mState == DeviceState.OFFLINE; } @@ -293,6 +308,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#isBootLoader() */ + @Override public boolean isBootLoader() { return mState == DeviceState.BOOTLOADER; } @@ -301,6 +317,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#hasClients() */ + @Override public boolean hasClients() { return mClients.size() > 0; } @@ -309,6 +326,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getClients() */ + @Override public Client[] getClients() { synchronized (mClients) { return mClients.toArray(new Client[mClients.size()]); @@ -319,6 +337,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getClient(java.lang.String) */ + @Override public Client getClient(String applicationName) { synchronized (mClients) { for (Client c : mClients) { @@ -336,6 +355,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getSyncService() */ + @Override public SyncService getSyncService() throws TimeoutException, AdbCommandRejectedException, IOException { SyncService syncService = new SyncService(AndroidDebugBridge.getSocketAddress(), this); @@ -350,15 +370,18 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getFileListingService() */ + @Override public FileListingService getFileListingService() { return new FileListingService(this); } + @Override public RawImage getScreenshot() throws TimeoutException, AdbCommandRejectedException, IOException { return AdbHelper.getFrameBuffer(AndroidDebugBridge.getSocketAddress(), this); } + @Override public void executeShellCommand(String command, IShellOutputReceiver receiver) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { @@ -366,6 +389,7 @@ final class Device implements IDevice { receiver, DdmPreferences.getTimeOut()); } + @Override public void executeShellCommand(String command, IShellOutputReceiver receiver, int maxTimeToOutputResponse) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, @@ -374,21 +398,25 @@ final class Device implements IDevice { receiver, maxTimeToOutputResponse); } + @Override public void runEventLogService(LogReceiver receiver) throws TimeoutException, AdbCommandRejectedException, IOException { AdbHelper.runEventLogService(AndroidDebugBridge.getSocketAddress(), this, receiver); } + @Override public void runLogService(String logname, LogReceiver receiver) throws TimeoutException, AdbCommandRejectedException, IOException { AdbHelper.runLogService(AndroidDebugBridge.getSocketAddress(), this, logname, receiver); } + @Override public void createForward(int localPort, int remotePort) throws TimeoutException, AdbCommandRejectedException, IOException { AdbHelper.createForward(AndroidDebugBridge.getSocketAddress(), this, localPort, remotePort); } + @Override public void removeForward(int localPort, int remotePort) throws TimeoutException, AdbCommandRejectedException, IOException { AdbHelper.removeForward(AndroidDebugBridge.getSocketAddress(), this, localPort, remotePort); @@ -398,6 +426,7 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#getClientName(int) */ + @Override public String getClientName(int pid) { synchronized (mClients) { for (Client c : mClients) { @@ -498,6 +527,7 @@ final class Device implements IDevice { mMountPoints.put(name, value); } + @Override public void pushFile(String local, String remote) throws IOException, AdbCommandRejectedException, TimeoutException, SyncException { SyncService sync = null; @@ -535,6 +565,7 @@ final class Device implements IDevice { } } + @Override public void pullFile(String remote, String local) throws IOException, AdbCommandRejectedException, TimeoutException, SyncException { SyncService sync = null; @@ -572,6 +603,7 @@ final class Device implements IDevice { } } + @Override public String installPackage(String packageFilePath, boolean reinstall, String... extraArgs) throws InstallException { try { @@ -590,6 +622,7 @@ final class Device implements IDevice { } } + @Override public String syncPackageToDevice(String localFilePath) throws IOException, AdbCommandRejectedException, TimeoutException, SyncException { SyncService sync = null; @@ -638,6 +671,7 @@ final class Device implements IDevice { return new File(filePath).getName(); } + @Override public String installRemotePackage(String remoteFilePath, boolean reinstall, String... extraArgs) throws InstallException { try { @@ -665,6 +699,7 @@ final class Device implements IDevice { } } + @Override public void removeRemotePackage(String remoteFilePath) throws InstallException { try { executeShellCommand("rm " + remoteFilePath, new NullOutputReceiver(), INSTALL_TIMEOUT); @@ -679,6 +714,7 @@ final class Device implements IDevice { } } + @Override public String uninstallPackage(String packageName) throws InstallException { try { InstallReceiver receiver = new InstallReceiver(); @@ -699,17 +735,20 @@ final class Device implements IDevice { * (non-Javadoc) * @see com.android.ddmlib.IDevice#reboot() */ + @Override public void reboot(String into) throws TimeoutException, AdbCommandRejectedException, IOException { AdbHelper.reboot(into, AndroidDebugBridge.getSocketAddress(), this); } + @Override public Integer getBatteryLevel() throws TimeoutException, AdbCommandRejectedException, IOException, ShellCommandUnresponsiveException { // use default of 5 minutes return getBatteryLevel(5 * 60 * 1000); } + @Override public Integer getBatteryLevel(long freshnessMs) throws TimeoutException, AdbCommandRejectedException, IOException, ShellCommandUnresponsiveException { if (mLastBatteryLevel != null diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java b/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java index e039cda..8f1bd87 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java @@ -486,6 +486,7 @@ final class DeviceMonitor { throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { device.executeShellCommand("echo $" + name, new MultiLineReceiver() { //$NON-NLS-1$ + @Override public boolean isCancelled() { return false; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java b/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java index 15a9fd2..5d569a2 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java @@ -116,10 +116,11 @@ public final class FileListingService { * Comparator object for FileEntry */ private static Comparator<FileEntry> sEntryComparator = new Comparator<FileEntry>() { + @Override public int compare(FileEntry o1, FileEntry o2) { if (o1 instanceof FileEntry && o2 instanceof FileEntry) { - FileEntry fe1 = (FileEntry)o1; - FileEntry fe2 = (FileEntry)o2; + FileEntry fe1 = o1; + FileEntry fe2 = o2; return fe1.name.compareTo(fe2.name); } return 0; @@ -569,6 +570,7 @@ public final class FileListingService { return null; } + @Override public boolean isCancelled() { return false; } @@ -696,6 +698,7 @@ public final class FileListingService { } } } + @Override public boolean isCancelled() { return false; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java index 9293379..2033f04 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java @@ -20,12 +20,12 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * A receiver able to parse the result of the execution of + * A receiver able to parse the result of the execution of * {@link #GETPROP_COMMAND} on a device. */ final class GetPropReceiver extends MultiLineReceiver { final static String GETPROP_COMMAND = "getprop"; //$NON-NLS-1$ - + private final static Pattern GETPROP_PATTERN = Pattern.compile("^\\[([^]]+)\\]\\:\\s*\\[(.*)\\]$"); //$NON-NLS-1$ /** indicates if we need to read the first */ @@ -50,23 +50,24 @@ final class GetPropReceiver extends MultiLineReceiver { if (line.length() == 0 || line.startsWith("#")) { continue; } - + Matcher m = GETPROP_PATTERN.matcher(line); if (m.matches()) { String label = m.group(1); String value = m.group(2); - + if (label.length() > 0) { mDevice.addProperty(label, value); } } } } - + + @Override public boolean isCancelled() { return false; } - + @Override public void done() { mDevice.update(Device.CHANGE_BUILD_INFO); diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java index 6a62e60..42f740c 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java @@ -162,20 +162,20 @@ public final class HeapSegment implements Comparable<HeapSegment> { * so that they can be examined independently. */ ByteBuffer data = hs.mUsageData; - int eState = (int)data.get() & 0x000000ff; - int eLen = ((int)data.get() & 0x000000ff) + 1; + int eState = data.get() & 0x000000ff; + int eLen = (data.get() & 0x000000ff) + 1; while ((eState & PARTIAL_MASK) != 0) { /* If the partial bit was set, the next byte should describe * the same object as the current one. */ - int nextState = (int)data.get() & 0x000000ff; + int nextState = data.get() & 0x000000ff; if ((nextState & ~PARTIAL_MASK) != (eState & ~PARTIAL_MASK)) { throw new ParseException("State mismatch", data.position()); } eState = nextState; - eLen += ((int)data.get() & 0x000000ff) + 1; + eLen += (data.get() & 0x000000ff) + 1; } setSolidity(eState & 0x7); @@ -209,6 +209,7 @@ public final class HeapSegment implements Comparable<HeapSegment> { this.mLength = length; } + @Override public int compareTo(HeapSegmentElement other) { if (mLength != other.mLength) { return mLength < other.mLength ? -1 : 1; @@ -253,8 +254,8 @@ public final class HeapSegment implements Comparable<HeapSegment> { */ hpsgData.order(ByteOrder.BIG_ENDIAN); mHeapId = hpsgData.getInt(); - mAllocationUnitSize = (int) hpsgData.get(); - mStartAddress = (long) hpsgData.getInt() & 0x00000000ffffffffL; + mAllocationUnitSize = hpsgData.get(); + mStartAddress = hpsgData.getInt() & 0x00000000ffffffffL; mOffset = hpsgData.getInt(); mAllocationUnitCount = hpsgData.getInt(); @@ -411,6 +412,7 @@ public final class HeapSegment implements Comparable<HeapSegment> { return str.toString(); } + @Override public int compareTo(HeapSegment other) { if (mHeapId != other.mHeapId) { return mHeapId < other.mHeapId ? -1 : 1; diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java index f3d9412..ac1fa91 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java @@ -47,6 +47,7 @@ public abstract class MultiLineReceiver implements IShellOutputReceiver { * @see com.android.ddmlib.adb.IShellOutputReceiver#addOutput( * byte[], int, int) */ + @Override public final void addOutput(byte[] data, int offset, int length) { if (isCancelled() == false) { String s = null; @@ -105,6 +106,7 @@ public abstract class MultiLineReceiver implements IShellOutputReceiver { /* (non-Javadoc) * @see com.android.ddmlib.adb.IShellOutputReceiver#flush() */ + @Override public final void flush() { if (mUnfinishedLine != null) { processNewLines(new String[] { mUnfinishedLine }); diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java index d2b5a1e..a963a64 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java @@ -31,18 +31,21 @@ public final class NullOutputReceiver implements IShellOutputReceiver { /* (non-Javadoc) * @see com.android.ddmlib.adb.IShellOutputReceiver#addOutput(byte[], int, int) */ + @Override public void addOutput(byte[] data, int offset, int length) { } /* (non-Javadoc) * @see com.android.ddmlib.adb.IShellOutputReceiver#flush() */ + @Override public void flush() { } /* (non-Javadoc) * @see com.android.ddmlib.adb.IShellOutputReceiver#isCancelled() */ + @Override public boolean isCancelled() { return false; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java b/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java index 6a94d22..bf0b4e1 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java @@ -113,16 +113,21 @@ public final class SyncService { * A Sync progress monitor that does nothing */ private static class NullSyncProgresMonitor implements ISyncProgressMonitor { + @Override public void advance(int work) { } + @Override public boolean isCanceled() { return false; } + @Override public void start(int totalWork) { } + @Override public void startSubTask(String name) { } + @Override public void stop() { } } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java index 8f284f3..93db931 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java @@ -57,7 +57,7 @@ public final class ThreadInfo implements IStackTraceInfo { mStime = stime; mIsDaemon = isDaemon; } - + /** * Sets the stack call of the thread. * @param trace stackcall information. @@ -80,7 +80,7 @@ public final class ThreadInfo implements IStackTraceInfo { public String getThreadName() { return mThreadName; } - + void setThreadName(String name) { mThreadName = name; } @@ -124,6 +124,7 @@ public final class ThreadInfo implements IStackTraceInfo { * (non-Javadoc) * @see com.android.ddmlib.IStackTraceInfo#getStackTrace() */ + @Override public StackTraceElement[] getStackTrace() { return mTrace; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java index 31f265f..22c0703 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java @@ -33,9 +33,9 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Calendar; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; -import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -93,6 +93,7 @@ public final class EventLogParser { processTagLine(line); } } + @Override public boolean isCancelled() { return false; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java index cbb1c5a..204e07a 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java @@ -419,6 +419,7 @@ public class InstrumentationResultParser extends MultiLineReceiver { * * @see IShellOutputReceiver#isCancelled() */ + @Override public boolean isCancelled() { return mIsCancelled; } diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java index b8cd154..124df7d 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java @@ -17,9 +17,9 @@ package com.android.ddmlib.testrunner; +import com.android.ddmlib.AdbCommandRejectedException; import com.android.ddmlib.IDevice; import com.android.ddmlib.Log; -import com.android.ddmlib.AdbCommandRejectedException; import com.android.ddmlib.ShellCommandUnresponsiveException; import com.android.ddmlib.TimeoutException; @@ -93,6 +93,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public String getPackageName() { return mPackageName; } @@ -100,6 +101,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public String getRunnerName() { if (mRunnerName == null) { return DEFAULT_RUNNER_NAME; @@ -117,6 +119,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setClassName(String className) { addInstrumentationArg(CLASS_ARG_NAME, className); } @@ -124,6 +127,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setClassNames(String[] classNames) { StringBuilder classArgBuilder = new StringBuilder(); @@ -139,6 +143,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setMethodName(String className, String testName) { setClassName(className + METHOD_SEPARATOR + testName); } @@ -146,6 +151,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setTestPackageName(String packageName) { addInstrumentationArg(PACKAGE_ARG_NAME, packageName); } @@ -153,6 +159,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void addInstrumentationArg(String name, String value) { if (name == null || value == null) { throw new IllegalArgumentException("name or value arguments cannot be null"); @@ -163,6 +170,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void removeInstrumentationArg(String name) { if (name == null) { throw new IllegalArgumentException("name argument cannot be null"); @@ -173,6 +181,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void addBooleanArg(String name, boolean value) { addInstrumentationArg(name, Boolean.toString(value)); } @@ -180,6 +189,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setLogOnly(boolean logOnly) { addBooleanArg(LOG_ARG_NAME, logOnly); } @@ -187,6 +197,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setDebug(boolean debug) { addBooleanArg(DEBUG_ARG_NAME, debug); } @@ -194,6 +205,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setCoverage(boolean coverage) { addBooleanArg(COVERAGE_ARG_NAME, coverage); } @@ -201,6 +213,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setTestSize(TestSize size) { addInstrumentationArg(SIZE_ARG_NAME, size.getRunnerValue()); } @@ -208,6 +221,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setMaxtimeToOutputResponse(int maxTimeToOutputResponse) { mMaxTimeToOutputResponse = maxTimeToOutputResponse; } @@ -215,6 +229,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void setRunName(String runName) { mRunName = runName; } @@ -222,6 +237,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void run(ITestRunListener... listeners) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { @@ -231,6 +247,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void run(Collection<ITestRunListener> listeners) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { @@ -276,6 +293,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner { /** * {@inheritDoc} */ + @Override public void cancel() { if (mParser != null) { mParser.cancel(); diff --git a/ddms/libs/ddmuilib/.settings/org.eclipse.jdt.core.prefs b/ddms/libs/ddmuilib/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/ddms/libs/ddmuilib/.settings/org.eclipse.jdt.core.prefs +++ b/ddms/libs/ddmuilib/.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/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java index e28b37e..3214da2 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java @@ -17,10 +17,10 @@ package com.android.ddmuilib; import com.android.ddmlib.AllocationInfo; -import com.android.ddmlib.Client; import com.android.ddmlib.AllocationInfo.AllocationSorter; import com.android.ddmlib.AllocationInfo.SortMode; import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; +import com.android.ddmlib.Client; import com.android.ddmlib.ClientData.AllocationTrackingStatus; import org.eclipse.jface.preference.IPreferenceStore; @@ -48,11 +48,11 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Sash; import org.eclipse.swt.widgets.Table; @@ -104,6 +104,7 @@ public class AllocationPanel extends TablePanel { * {@link AllocationInfo}. */ private class AllocationContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof Client) { AllocationInfo[] allocs = ((Client)inputElement).getClientData().getAllocations(); @@ -119,10 +120,12 @@ public class AllocationPanel extends TablePanel { return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } @@ -134,10 +137,12 @@ public class AllocationPanel extends TablePanel { */ private static class AllocationLabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof AllocationInfo) { AllocationInfo alloc = (AllocationInfo)element; @@ -160,19 +165,23 @@ public class AllocationPanel extends TablePanel { 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 } @@ -237,6 +246,7 @@ public class AllocationPanel extends TablePanel { gridData.widthHint = 200; filterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { mFilterText = filterText.getText().trim(); mAllocationViewer.refresh(); @@ -362,6 +372,7 @@ public class AllocationPanel extends TablePanel { mAllocationViewer.setLabelProvider(new AllocationLabelProvider()); mAllocationViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { AllocationInfo selectedAlloc = getAllocationSelection(event.getSelection()); updateAllocationStackTrace(selectedAlloc); @@ -411,6 +422,7 @@ public class AllocationPanel extends TablePanel { // allow resizes, but cap at minPanelWidth sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = mAllocationBase.getClientArea(); @@ -455,11 +467,13 @@ public class AllocationPanel extends TablePanel { * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, int changeMask) { if (client == getCurrentClient()) { if ((changeMask & Client.CHANGE_HEAP_ALLOCATIONS) != 0) { try { mAllocationTable.getDisplay().asyncExec(new Runnable() { + @Override public void run() { mAllocationViewer.refresh(); updateAllocationStackCall(); @@ -471,6 +485,7 @@ public class AllocationPanel extends TablePanel { } else if ((changeMask & Client.CHANGE_HEAP_ALLOCATION_STATUS) != 0) { try { mAllocationTable.getDisplay().asyncExec(new Runnable() { + @Override public void run() { setUpButtons(true, client.getClientData().getAllocationStatus()); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java index dc391a6..68f23b7 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java @@ -17,14 +17,14 @@ package com.android.ddmuilib; import com.android.ddmlib.AndroidDebugBridge; -import com.android.ddmlib.Client; -import com.android.ddmlib.ClientData; -import com.android.ddmlib.DdmPreferences; -import com.android.ddmlib.IDevice; import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener; import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; +import com.android.ddmlib.Client; +import com.android.ddmlib.ClientData; import com.android.ddmlib.ClientData.DebuggerStatus; +import com.android.ddmlib.DdmPreferences; +import com.android.ddmlib.IDevice; import com.android.ddmlib.IDevice.DeviceState; import org.eclipse.jface.preference.IPreferenceStore; @@ -108,6 +108,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen * and second level elements are {@link Client} object. */ private class ContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof IDevice) { return ((IDevice)parentElement).getClients(); @@ -115,6 +116,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen return new Object[0]; } + @Override public Object getParent(Object element) { if (element instanceof Client) { return ((Client)element).getDevice(); @@ -122,6 +124,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof IDevice) { return ((IDevice)element).hasClients(); @@ -131,6 +134,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen return false; } + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof AndroidDebugBridge) { return ((AndroidDebugBridge)inputElement).getDevices(); @@ -138,10 +142,12 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } @@ -155,6 +161,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen private static final String DEVICE_MODEL_PROPERTY = "ro.product.model"; //$NON-NLS-1$ private static final String DEVICE_MANUFACTURER_PROPERTY = "ro.product.manufacturer"; //$NON-NLS-1$ + @Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == DEVICE_COL_SERIAL && element instanceof IDevice) { IDevice device = (IDevice)element; @@ -195,6 +202,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof IDevice) { IDevice device = (IDevice)element; @@ -311,19 +319,23 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen return sb.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 } @@ -506,9 +518,11 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen * * @see IDebugBridgeChangeListener#serverChanged(AndroidDebugBridge) */ + @Override public void bridgeChanged(final AndroidDebugBridge bridge) { if (mTree.isDisposed() == false) { exec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { // set up the data source. @@ -541,8 +555,10 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen * * @see IDeviceChangeListener#deviceConnected(IDevice) */ + @Override public void deviceConnected(IDevice device) { exec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { // refresh all @@ -576,6 +592,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen * * @see IDeviceChangeListener#deviceDisconnected(IDevice) */ + @Override public void deviceDisconnected(IDevice device) { deviceConnected(device); @@ -594,6 +611,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen * * @see IDeviceChangeListener#deviceChanged(IDevice) */ + @Override public void deviceChanged(final IDevice device, int changeMask) { boolean expand = false; synchronized (mDevicesToExpand) { @@ -607,6 +625,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen final boolean finalExpand = expand; exec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { // look if the current device is selected. This is done in case the current @@ -655,8 +674,10 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, final int changeMask) { exec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { // refresh the client diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java index 4d36bc5..82aed98 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java @@ -16,13 +16,14 @@ package com.android.ddmuilib; -import com.android.ddmlib.IDevice; import com.android.ddmlib.EmulatorConsole; import com.android.ddmlib.EmulatorConsole.GsmMode; import com.android.ddmlib.EmulatorConsole.GsmStatus; import com.android.ddmlib.EmulatorConsole.NetworkStatus; +import com.android.ddmlib.IDevice; import com.android.ddmuilib.location.CoordinateControls; import com.android.ddmuilib.location.GpxParser; +import com.android.ddmuilib.location.GpxParser.Track; import com.android.ddmuilib.location.KmlParser; import com.android.ddmuilib.location.TrackContentProvider; import com.android.ddmuilib.location.TrackLabelProvider; @@ -30,7 +31,6 @@ import com.android.ddmuilib.location.TrackPoint; import com.android.ddmuilib.location.WayPoint; import com.android.ddmuilib.location.WayPointContentProvider; import com.android.ddmuilib.location.WayPointLabelProvider; -import com.android.ddmuilib.location.GpxParser.Track; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; @@ -401,6 +401,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { mPhoneNumber = new Text(phoneComp, SWT.BORDER | SWT.LEFT | SWT.SINGLE); mPhoneNumber.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mPhoneNumber.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // Reenable the widgets based on the content of the text. // doEnable checks the validity of the phone number to enable/disable some @@ -484,13 +485,13 @@ public class EmulatorControlPanel extends SelectionDependentPanel { // delimited. For this reason, we'll replace is several steps // replace the dual CR-LF - message = message.replaceAll("\r\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-1$ + message = message.replaceAll("\r\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$ // replace remaining stand alone \n - message = message.replaceAll("\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-1$ + message = message.replaceAll("\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$ // replace remaining stand alone \r - message = message.replaceAll("\r", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-1$ + message = message.replaceAll("\r", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$ processCommandResult(mEmulatorConsole.sendSms(mPhoneNumber.getText().trim(), message)); @@ -701,6 +702,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { gpxWayPointViewer.setLabelProvider(new WayPointLabelProvider()); gpxWayPointViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { @@ -748,6 +750,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { gpxTrackViewer.setLabelProvider(new TrackLabelProvider()); gpxTrackViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { @@ -921,6 +924,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { }); kmlWayPointViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { @@ -1075,6 +1079,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { final NetworkStatus f_netstatus = netstatus; d.asyncExec(new Runnable() { + @Override public void run() { if (f_gsm.voice != GsmMode.UNKNOWN) { mVoiceMode.select(getGsmComboIndex(f_gsm.voice)); @@ -1122,6 +1127,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { try { Display d = mParent.getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { if (mParent.isDisposed() == false) { doEnable(enabled); @@ -1230,6 +1236,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { if (result != EmulatorConsole.RESULT_OK) { try { mParent.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (mParent.isDisposed() == false) { MessageDialog.openError(mParent.getShell(), "Emulator Console", @@ -1334,6 +1341,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { mPlayingTrack = false; try { mParent.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (mPlayGpxButton.isDisposed() == false) { mPlayGpxButton.setImage(mPlayImage); @@ -1434,6 +1442,7 @@ public class EmulatorControlPanel extends SelectionDependentPanel { mPlayingTrack = false; try { mParent.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (mPlayGpxButton.isDisposed() == false) { mPlayGpxButton.setImage(mPlayImage); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java index 83cdc90..d0af8b0 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java @@ -16,11 +16,11 @@ package com.android.ddmuilib; +import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.Client; import com.android.ddmlib.ClientData; -import com.android.ddmlib.Log; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.HeapSegment.HeapSegmentElement; +import com.android.ddmlib.Log; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.swt.SWT; @@ -223,12 +223,14 @@ public final class HeapPanel extends BaseHeapPanel { * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, int changeMask) { if (client == getCurrentClient()) { if ((changeMask & Client.CHANGE_HEAP_MODE) == Client.CHANGE_HEAP_MODE || (changeMask & Client.CHANGE_HEAP_DATA) == Client.CHANGE_HEAP_DATA) { try { mTop.getDisplay().asyncExec(new Runnable() { + @Override public void run() { clientSelected(); } @@ -628,6 +630,7 @@ public final class HeapPanel extends BaseHeapPanel { CategoryItemRenderer renderer = categoryPlot.getRenderer(); renderer.setBaseToolTipGenerator(new CategoryToolTipGenerator() { + @Override public String generateToolTip(CategoryDataset dataset, int row, int column) { // get the key for the size of the allocation ByteLong columnKey = (ByteLong)dataset.getColumnKey(column); @@ -871,6 +874,7 @@ public final class HeapPanel extends BaseHeapPanel { return approximateByteCount(mValue); } + @Override public int compareTo(ByteLong other) { if (mValue != other.mValue) { return mValue < other.mValue ? -1 : 1; @@ -1168,7 +1172,7 @@ public final class HeapPanel extends BaseHeapPanel { int w, h; // Pick an image size that the largest of heaps will fit into. - w = (int)Math.sqrt((double)((16 * 1024 * 1024)/8)); + w = (int)Math.sqrt(((16 * 1024 * 1024)/8)); // Space-filling curves require a power-of-2 width. w = nextPow2(w); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java index ed402c0..60dc2c0 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java @@ -16,9 +16,9 @@ package com.android.ddmuilib; +import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.Client; import com.android.ddmlib.ClientData; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; @@ -98,6 +98,7 @@ public class InfoPanel extends TablePanel { * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, int changeMask) { if (client == getCurrentClient()) { if ((changeMask & Client.CHANGE_INFO) == Client.CHANGE_INFO) { @@ -105,6 +106,7 @@ public class InfoPanel extends TablePanel { return; mTable.getDisplay().asyncExec(new Runnable() { + @Override public void run() { clientSelected(); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java index 79191eb..337bff2 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java @@ -353,6 +353,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { private boolean updateNHAllocationStackCalls(final ClientData clientData, final int count) { if (mDisplay.isDisposed() == false) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { updateAllocationStackCalls(clientData, count); } @@ -392,6 +393,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { final int start, final int end) { if (mDisplay.isDisposed() == false) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { updateLibraryAllocationTable(libAlloc, start, end); } @@ -465,6 +467,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { mSize += info.getAllocationCount() * info.getSize(); } Collections.sort(mLibAllocations, new Comparator<NativeAllocationInfo>() { + @Override public int compare(NativeAllocationInfo o1, NativeAllocationInfo o2) { return o2.getAllocationCount() * o2.getSize() - o1.getAllocationCount() * o1.getSize(); @@ -673,6 +676,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, int changeMask) { if (client == getCurrentClient()) { if ((changeMask & Client.CHANGE_NATIVE_HEAP_DATA) == Client.CHANGE_NATIVE_HEAP_DATA) { @@ -680,6 +684,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { return; mBase.getDisplay().asyncExec(new Runnable() { + @Override public void run() { clientSelected(); } @@ -1268,6 +1273,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { // allow resizes, but cap at minPanelWidth sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = sash_composite.getClientArea(); @@ -1478,6 +1484,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { // allow resizes, but cap at minPanelWidth sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = top.getClientArea(); @@ -1540,6 +1547,7 @@ public final class NativeHeapPanel extends BaseHeapPanel { // now we sort it Collections.sort(mLibraryAllocations, new Comparator<LibraryAllocations>() { + @Override public int compare(LibraryAllocations o1, LibraryAllocations o2) { return o2.getSize() - o1.getSize(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java index 3358962..336a5a3 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java @@ -51,13 +51,14 @@ public final class StackTracePanel { private TableViewer mStackTraceViewer; private Client mCurrentClient; - - + + /** * Content Provider to display the stack trace of a thread. * Expected input is a {@link IStackTraceInfo} object. */ private static class StackTraceContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IStackTraceInfo) { // getElement cannot return null, so we return an empty array @@ -71,15 +72,17 @@ public final class StackTracePanel { return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } } - + /** * A Label Provider to use with {@link StackTraceContentProvider}. It expects the elements to be @@ -87,10 +90,12 @@ public final class StackTracePanel { */ private static class StackTraceLabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof StackTraceElement) { StackTraceElement traceElement = (StackTraceElement)element; @@ -111,24 +116,28 @@ public final class StackTracePanel { 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 } } - + /** * Classes which implement this interface provide a method that is able to reveal a method * in a source editor @@ -142,8 +151,8 @@ public final class StackTracePanel { */ public void reveal(String applicationName, String className, int line); } - - + + /** * Sets the {@link ISourceRevealer} object able to reveal source code in a source editor. * @param revealer @@ -151,27 +160,27 @@ public final class StackTracePanel { public static void setSourceRevealer(ISourceRevealer revealer) { sSourceRevealer = revealer; } - + /** * Creates the controls for the StrackTrace display. * <p/>This method will set the parent {@link Composite} to use a {@link GridLayout} with * 2 columns. * @param parent the parent composite. - * @param prefs_stack_col_class - * @param prefs_stack_col_method - * @param prefs_stack_col_file - * @param prefs_stack_col_line - * @param prefs_stack_col_native + * @param prefs_stack_col_class + * @param prefs_stack_col_method + * @param prefs_stack_col_file + * @param prefs_stack_col_line + * @param prefs_stack_col_native * @param store */ public Table createPanel(Composite parent, String prefs_stack_col_class, String prefs_stack_col_method, String prefs_stack_col_file, String prefs_stack_col_line, String prefs_stack_col_native, IPreferenceStore store) { - + mStackTraceTable = new Table(parent, SWT.MULTI | SWT.FULL_SELECTION); mStackTraceTable.setHeaderVisible(true); mStackTraceTable.setLinesVisible(true); - + TableHelper.createTableColumn( mStackTraceTable, "Class", @@ -206,26 +215,27 @@ public final class StackTracePanel { SWT.LEFT, "Native", //$NON-NLS-1$ prefs_stack_col_native, store); - + mStackTraceViewer = new TableViewer(mStackTraceTable); mStackTraceViewer.setContentProvider(new StackTraceContentProvider()); mStackTraceViewer.setLabelProvider(new StackTraceLabelProvider()); - + mStackTraceViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { if (sSourceRevealer != null && mCurrentClient != null) { // get the selected stack trace element ISelection selection = mStackTraceViewer.getSelection(); - + if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection)selection; Object object = structuredSelection.getFirstElement(); if (object instanceof StackTraceElement) { StackTraceElement traceElement = (StackTraceElement)object; - + if (traceElement.isNativeMethod() == false) { sSourceRevealer.reveal( - mCurrentClient.getClientData().getClientDescription(), + mCurrentClient.getClientData().getClientDescription(), traceElement.getClassName(), traceElement.getLineNumber()); } @@ -237,7 +247,7 @@ public final class StackTracePanel { return mStackTraceTable; } - + /** * Sets the input for the {@link TableViewer}. * @param input the {@link IStackTraceInfo} that will provide the viewer with the list of @@ -247,7 +257,7 @@ public final class StackTracePanel { mStackTraceViewer.setInput(input); mStackTraceViewer.refresh(); } - + /** * Sets the current client running the stack trace. * @param currentClient the {@link Client}. diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java index 23b749e..732de59 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java @@ -18,8 +18,8 @@ package com.android.ddmuilib; import com.android.ddmlib.SyncException; import com.android.ddmlib.SyncService; -import com.android.ddmlib.TimeoutException; import com.android.ddmlib.SyncService.ISyncProgressMonitor; +import com.android.ddmlib.TimeoutException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.dialogs.ProgressMonitorDialog; @@ -63,6 +63,7 @@ public class SyncProgressHelper { final Exception[] result = new Exception[1]; new ProgressMonitorDialog(parentShell).run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { try { runnable.run(new SyncProgressMonitor(monitor, progressMessage)); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java index 5925984..4254f67 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java @@ -33,22 +33,27 @@ public class SyncProgressMonitor implements ISyncProgressMonitor { mName = name; } + @Override public void start(int totalWork) { mMonitor.beginTask(mName, totalWork); } + @Override public void stop() { mMonitor.done(); } + @Override public void advance(int work) { mMonitor.worked(work); } + @Override public boolean isCanceled() { return mMonitor.isCanceled(); } + @Override public void startSubTask(String name) { mMonitor.subTask(name); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java index 6727fcb..3ca5ff3 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java @@ -184,6 +184,7 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver { * Adds output to the temp file. IShellOutputReceiver method. Called by * executeShellCommand(). */ + @Override public void addOutput(byte[] data, int offset, int length) { try { mTempStream.write(data, offset, length); @@ -198,6 +199,7 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver { * output is passed to generateDataset(). Called by executeShellCommand() on * completion. */ + @Override public void flush() { if (mTempStream != null) { try { @@ -216,6 +218,7 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver { * * @return false - don't cancel */ + @Override public boolean isCancelled() { return false; } @@ -302,6 +305,7 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver { return top; } + @Override public void clientChanged(final Client client, int changeMask) { // Don't care } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java index 9d557e0..66dcc0a 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java @@ -73,9 +73,11 @@ public final class TableHelper { // listener to catch column resize to put store the new width value. 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 = ((TableColumn)e.widget).getWidth(); @@ -132,9 +134,11 @@ public final class TableHelper { // listener to catch column resize to put store the new width value. 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(); @@ -187,9 +191,11 @@ public final class TableHelper { // listener to catch column resize to put store the new width value. 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(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java index 245b26e..c1eb7f6 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java @@ -68,6 +68,7 @@ public abstract class TablePanel extends ClientDisplayPanel { final int colStart, final int colEnd) { // create the activator for this table final IFocusedTableActivator activator = new IFocusedTableActivator() { + @Override public void copy(Clipboard clipboard) { int[] selection = table.getSelectionIndices(); @@ -96,6 +97,7 @@ public abstract class TablePanel extends ClientDisplayPanel { } } + @Override public void selectAll() { table.selectAll(); } @@ -103,10 +105,12 @@ public abstract class TablePanel extends ClientDisplayPanel { // add the focus listener on the table to notify the global listener table.addFocusListener(new FocusListener() { + @Override public void focusGained(FocusEvent e) { mGlobalListener.focusGained(activator); } + @Override public void focusLost(FocusEvent e) { mGlobalListener.focusLost(activator); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java index bf7a58d..f88b4c4 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java @@ -16,9 +16,9 @@ package com.android.ddmuilib; +import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import com.android.ddmlib.Client; import com.android.ddmlib.ThreadInfo; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.DoubleClickEvent; @@ -61,14 +61,14 @@ import java.util.Date; * Base class for our information panels. */ public class ThreadPanel extends TablePanel { - + private final static String PREFS_THREAD_COL_ID = "threadPanel.Col0"; //$NON-NLS-1$ private final static String PREFS_THREAD_COL_TID = "threadPanel.Col1"; //$NON-NLS-1$ private final static String PREFS_THREAD_COL_STATUS = "threadPanel.Col2"; //$NON-NLS-1$ private final static String PREFS_THREAD_COL_UTIME = "threadPanel.Col3"; //$NON-NLS-1$ private final static String PREFS_THREAD_COL_STIME = "threadPanel.Col4"; //$NON-NLS-1$ private final static String PREFS_THREAD_COL_NAME = "threadPanel.Col5"; //$NON-NLS-1$ - + private final static String PREFS_THREAD_SASH = "threadPanel.sash"; //$NON-NLS-1$ private static final String PREFS_STACK_COL_CLASS = "threadPanel.stack.col0"; //$NON-NLS-1$ @@ -76,12 +76,12 @@ public class ThreadPanel extends TablePanel { private static final String PREFS_STACK_COL_FILE = "threadPanel.stack.col2"; //$NON-NLS-1$ private static final String PREFS_STACK_COL_LINE = "threadPanel.stack.col3"; //$NON-NLS-1$ private static final String PREFS_STACK_COL_NATIVE = "threadPanel.stack.col4"; //$NON-NLS-1$ - + private Display mDisplay; private Composite mBase; private Label mNotEnabled; private Label mNotSelected; - + private Composite mThreadBase; private Table mThreadTable; private TableViewer mThreadViewer; @@ -104,12 +104,13 @@ public class ThreadPanel extends TablePanel { "wait", "init", "start", "native", "vmwait", "suspended" }; - + /** * Content Provider to display the threads of a client. * Expected input is a {@link Client} object. */ private static class ThreadContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof Client) { return ((Client)inputElement).getClientData().getThreads(); @@ -118,15 +119,17 @@ public class ThreadPanel extends TablePanel { return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } } - + /** * A Label Provider to use with {@link ThreadContentProvider}. It expects the elements to be @@ -134,10 +137,12 @@ public class ThreadPanel extends TablePanel { */ private static class ThreadLabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof ThreadInfo) { ThreadInfo thread = (ThreadInfo)element; @@ -163,19 +168,23 @@ public class ThreadPanel extends TablePanel { 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 } @@ -205,7 +214,7 @@ public class ThreadPanel extends TablePanel { // base composite for selected client with enabled thread update. mThreadBase = new Composite(mBase, SWT.NONE); mThreadBase.setLayout(new FormLayout()); - + // table above the sash mThreadTable = new Table(mThreadBase, SWT.MULTI | SWT.FULL_SELECTION); mThreadTable.setHeaderVisible(true); @@ -252,35 +261,37 @@ public class ThreadPanel extends TablePanel { SWT.LEFT, "android.class.ReallyLongClassName.MethodName", //$NON-NLS-1$ PREFS_THREAD_COL_NAME, store); - + mThreadViewer = new TableViewer(mThreadTable); mThreadViewer.setContentProvider(new ThreadContentProvider()); mThreadViewer.setLabelProvider(new ThreadLabelProvider()); mThreadViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ThreadInfo selectedThread = getThreadSelection(event.getSelection()); updateThreadStackTrace(selectedThread); } }); mThreadViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { ThreadInfo selectedThread = getThreadSelection(event.getSelection()); if (selectedThread != null) { Client client = (Client)mThreadViewer.getInput(); - + if (client != null) { client.requestThreadStackTrace(selectedThread.getThreadId()); } } } }); - + // the separating sash final Sash sash = new Sash(mThreadBase, SWT.HORIZONTAL); Color darkGray = parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY); sash.setBackground(darkGray); - + // the UI below the sash mStackTraceBase = new Composite(mThreadBase, SWT.NONE); mStackTraceBase.setLayout(new GridLayout(2, false)); @@ -299,7 +310,7 @@ public class ThreadPanel extends TablePanel { } } }); - + mStackTraceTimeLabel = new Label(mStackTraceBase, SWT.NONE); mStackTraceTimeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); @@ -311,11 +322,11 @@ public class ThreadPanel extends TablePanel { PREFS_STACK_COL_LINE, PREFS_STACK_COL_NATIVE, store); - + GridData gd; mStackTraceTable.setLayoutData(gd = new GridData(GridData.FILL_BOTH)); gd.horizontalSpan = 2; - + // now setup the sash. // form layout data FormData data = new FormData(); @@ -344,6 +355,7 @@ public class ThreadPanel extends TablePanel { // allow resizes, but cap at minPanelWidth sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = mThreadBase.getClientArea(); @@ -361,7 +373,7 @@ public class ThreadPanel extends TablePanel { return mBase; } - + /** * Sets the focus to the proper control inside the panel. */ @@ -383,12 +395,14 @@ public class ThreadPanel extends TablePanel { * * @see IClientChangeListener#clientChanged(Client, int) */ + @Override public void clientChanged(final Client client, int changeMask) { if (client == getCurrentClient()) { if ((changeMask & Client.CHANGE_THREAD_MODE) != 0 || (changeMask & Client.CHANGE_THREAD_DATA) != 0) { try { mThreadTable.getDisplay().asyncExec(new Runnable() { + @Override public void run() { clientSelected(); } @@ -399,6 +413,7 @@ public class ThreadPanel extends TablePanel { } else if ((changeMask & Client.CHANGE_THREAD_STACKTRACE) != 0) { try { mThreadTable.getDisplay().asyncExec(new Runnable() { + @Override public void run() { updateThreadStackCall(); } @@ -430,7 +445,7 @@ public class ThreadPanel extends TablePanel { } Client client = getCurrentClient(); - + mStackTracePanel.setCurrentClient(client); if (client != null) { @@ -462,7 +477,7 @@ public class ThreadPanel extends TablePanel { mBase.layout(); } - + /** * Updates the stack call of the currently selected thread. * <p/> @@ -473,7 +488,7 @@ public class ThreadPanel extends TablePanel { if (client != null) { // get the current selection in the ThreadTable ThreadInfo selectedThread = getThreadSelection(null); - + if (selectedThread != null) { updateThreadStackTrace(selectedThread); } else { @@ -481,7 +496,7 @@ public class ThreadPanel extends TablePanel { } } } - + /** * updates the stackcall of the specified thread. If <code>null</code> the UI is emptied * of current data. @@ -489,7 +504,7 @@ public class ThreadPanel extends TablePanel { */ private void updateThreadStackTrace(ThreadInfo thread) { mStackTracePanel.setViewerInput(thread); - + if (thread != null) { mRefreshStackTraceButton.setEnabled(true); long stackcallTime = thread.getStackCallTime(); @@ -521,6 +536,7 @@ public class ThreadPanel extends TablePanel { int initialWait = 1000; mDisplay.timerExec(initialWait, new Runnable() { + @Override public void run() { synchronized (mLock) { // lets check we still want updates. @@ -545,7 +561,7 @@ public class ThreadPanel extends TablePanel { } }); } - + /** * Returns the current thread selection or <code>null</code> if none is found. * If a {@link ISelection} object is specified, the first {@link ThreadInfo} from this selection @@ -557,7 +573,7 @@ public class ThreadPanel extends TablePanel { if (selection == null) { selection = mThreadViewer.getSelection(); } - + if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection)selection; Object object = structuredSelection.getFirstElement(); @@ -565,7 +581,7 @@ public class ThreadPanel extends TablePanel { return (ThreadInfo)object; } } - + return null; } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java index bc1598f..c7fef32 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java @@ -38,6 +38,7 @@ public class ToolItemAction implements ICommonAction { * <code>false</code> to disable * @see ICommonAction#setChecked(boolean) */ + @Override public void setChecked(boolean checked) { item.setSelection(checked); } @@ -48,6 +49,7 @@ public class ToolItemAction implements ICommonAction { * <code>false</code> to disable * @see ICommonAction#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { item.setEnabled(enabled); } @@ -57,6 +59,7 @@ public class ToolItemAction implements ICommonAction { * {@link SelectionListener#widgetSelected(SelectionEvent)} on the wrapped {@link ToolItem}). * @see ICommonAction#setRunnable(Runnable) */ + @Override public void setRunnable(final Runnable runnable) { item.addSelectionListener(new SelectionAdapter() { @Override diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java index 75c19fe..062d4f0 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java @@ -36,12 +36,14 @@ class DeviceContentProvider implements ITreeContentProvider { private FileEntry mRootEntry; private IListingReceiver sListingReceiver = new IListingReceiver() { + @Override public void setChildren(final FileEntry entry, FileEntry[] children) { final Tree t = mViewer.getTree(); if (t != null && t.isDisposed() == false) { Display display = t.getDisplay(); if (display.isDisposed() == false) { display.asyncExec(new Runnable() { + @Override public void run() { if (t.isDisposed() == false) { // refresh the entry. @@ -58,12 +60,14 @@ class DeviceContentProvider implements ITreeContentProvider { } } + @Override public void refreshEntry(final FileEntry entry) { final Tree t = mViewer.getTree(); if (t != null && t.isDisposed() == false) { Display display = t.getDisplay(); if (display.isDisposed() == false) { display.asyncExec(new Runnable() { + @Override public void run() { if (t.isDisposed() == false) { // refresh the entry. @@ -89,6 +93,7 @@ class DeviceContentProvider implements ITreeContentProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof FileEntry) { FileEntry parentEntry = (FileEntry)parentElement; @@ -112,6 +117,7 @@ class DeviceContentProvider implements ITreeContentProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ + @Override public Object getParent(Object element) { if (element instanceof FileEntry) { FileEntry entry = (FileEntry)element; @@ -124,6 +130,7 @@ class DeviceContentProvider implements ITreeContentProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ + @Override public boolean hasChildren(Object element) { if (element instanceof FileEntry) { FileEntry entry = (FileEntry)element; @@ -136,6 +143,7 @@ class DeviceContentProvider implements ITreeContentProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof FileEntry) { FileEntry entry = (FileEntry)inputElement; @@ -150,12 +158,14 @@ class DeviceContentProvider implements ITreeContentProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (viewer instanceof TreeViewer) { mViewer = (TreeViewer)viewer; diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java index a466be1..b69d3b5 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java @@ -203,6 +203,7 @@ public class DeviceExplorer extends Panel { // setup a listener for selection mTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection sel = event.getSelection(); if (sel.isEmpty()) { @@ -234,6 +235,7 @@ public class DeviceExplorer extends Panel { // add support for double click mTreeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { ISelection sel = event.getSelection(); @@ -355,6 +357,7 @@ public class DeviceExplorer extends Panel { Display display = mTree.getDisplay(); if (display.isDisposed() == false) { display.asyncExec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { mTreeViewer.refresh(true); @@ -599,15 +602,18 @@ public class DeviceExplorer extends Panel { try { mCurrentDevice.executeShellCommand(command, new IShellOutputReceiver() { + @Override public void addOutput(byte[] data, int offset, int length) { // pass // TODO get output to display errors if any. } + @Override public void flush() { mTreeViewer.refresh(parentEntry); } + @Override public boolean isCancelled() { return false; } @@ -640,6 +646,7 @@ public class DeviceExplorer extends Panel { if (entry.isDirectory()) { InputDialog inputDialog = new InputDialog(mTree.getShell(), "New Folder", "Please enter the new folder name", "New Folder", new IInputValidator() { + @Override public String isValid(String newText) { if ((newText != null) && (newText.length() > 0) && (newText.trim().length() > 0) @@ -662,14 +669,17 @@ public class DeviceExplorer extends Panel { try { mCurrentDevice.executeShellCommand(command, new IShellOutputReceiver() { + @Override public boolean isCancelled() { return false; } + @Override public void flush() { mTreeViewer.refresh(entry); } + @Override public void addOutput(byte[] data, int offset, int length) { String errorMessage; if (data != null) { @@ -722,6 +732,7 @@ public class DeviceExplorer extends Panel { if (mTree.isDisposed() == false) { Display d = mTree.getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { if (mTree.isDisposed() == false) { // new service @@ -744,6 +755,7 @@ public class DeviceExplorer extends Panel { private void refresh(final FileEntry entry) { Display d = mTreeViewer.getTree().getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { mTreeViewer.refresh(entry); } @@ -771,11 +783,13 @@ public class DeviceExplorer extends Panel { new FileEntry[entries.size()]); SyncProgressHelper.run(new SyncRunnable() { + @Override public void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { sync.pull(entryArray, localDirectory, monitor); } + @Override public void close() { sync.close(); } @@ -802,11 +816,13 @@ public class DeviceExplorer extends Panel { final SyncService sync = mCurrentDevice.getSyncService(); if (sync != null) { SyncProgressHelper.run(new SyncRunnable() { + @Override public void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { sync.pullFile(remote, local, monitor); } + @Override public void close() { sync.close(); } @@ -834,11 +850,13 @@ public class DeviceExplorer extends Panel { final SyncService sync = mCurrentDevice.getSyncService(); if (sync != null) { SyncProgressHelper.run(new SyncRunnable() { + @Override public void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { sync.push(localFiles, remoteDirectory, monitor); } + @Override public void close() { sync.close(); } @@ -871,11 +889,13 @@ public class DeviceExplorer extends Panel { + name; SyncProgressHelper.run(new SyncRunnable() { + @Override public void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { sync.pushFile(local, remoteFile, monitor); } + @Override public void close() { sync.close(); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java index 1dca962..1240e59 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java @@ -65,6 +65,7 @@ class FileLabelProvider implements ILabelProvider, ITableLabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { return null; } @@ -72,10 +73,12 @@ class FileLabelProvider implements ILabelProvider, ITableLabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { return null; } + @Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 0) { if (element instanceof FileEntry) { @@ -100,6 +103,7 @@ class FileLabelProvider implements ILabelProvider, ITableLabelProvider { return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof FileEntry) { FileEntry entry = (FileEntry)element; @@ -125,6 +129,7 @@ class FileLabelProvider implements ILabelProvider, ITableLabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) */ + @Override public void addListener(ILabelProviderListener listener) { // we don't need listeners. } @@ -132,12 +137,14 @@ class FileLabelProvider implements ILabelProvider, ITableLabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) */ + @Override public boolean isLabelProperty(Object element, String property) { return false; } @@ -145,6 +152,7 @@ class FileLabelProvider implements ILabelProvider, ITableLabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) */ + @Override public void removeListener(ILabelProviderListener listener) { // we don't need listeners } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java index 83ff0ba..f50a94c 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java @@ -16,12 +16,12 @@ package com.android.ddmuilib.handler; -import com.android.ddmlib.SyncException; -import com.android.ddmlib.SyncService; -import com.android.ddmlib.TimeoutException; import com.android.ddmlib.ClientData.IHprofDumpHandler; import com.android.ddmlib.ClientData.IMethodProfilingHandler; +import com.android.ddmlib.SyncException; +import com.android.ddmlib.SyncService; import com.android.ddmlib.SyncService.ISyncProgressMonitor; +import com.android.ddmlib.TimeoutException; import com.android.ddmuilib.SyncProgressHelper; import com.android.ddmuilib.SyncProgressHelper.SyncRunnable; @@ -78,11 +78,13 @@ public abstract class BaseFileHandler { final String localFilePath = fileDialog.open(); if (localFilePath != null) { SyncProgressHelper.run(new SyncRunnable() { + @Override public void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { sync.pullFile(remoteFilePath, localFilePath, monitor); } + @Override public void close() { sync.close(); } @@ -131,6 +133,7 @@ public abstract class BaseFileHandler { */ protected void displayErrorInUiThread(final String format, final Object... args) { mParentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { MessageDialog.openError(mParentShell, getDialogTitle(), String.format(format, args)); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java index 10680f7..ab1b5f7 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java @@ -54,6 +54,7 @@ public class MethodProfilingHandler extends BaseFileHandler return "Method Profiling Error"; } + @Override public void onStartFailure(final Client client, final String message) { displayErrorInUiThread( "Unable to create Method Profiling file for application '%1$s'\n\n%2$s" + @@ -62,6 +63,7 @@ public class MethodProfilingHandler extends BaseFileHandler message != null ? message + "\n\n" : ""); } + @Override public void onEndFailure(final Client client, final String message) { displayErrorInUiThread( "Unable to finish Method Profiling for application '%1$s'\n\n%2$s" + @@ -70,8 +72,10 @@ public class MethodProfilingHandler extends BaseFileHandler message != null ? message + "\n\n" : ""); } + @Override public void onSuccess(final String remoteFilePath, final Client client) { mParentShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (remoteFilePath == null) { displayErrorFromUiThread( @@ -100,6 +104,7 @@ public class MethodProfilingHandler extends BaseFileHandler }); } + @Override public void onSuccess(byte[] data, final Client client) { try { File tempFile = saveTempFile(data, DdmConstants.DOT_TRACE); @@ -124,11 +129,13 @@ public class MethodProfilingHandler extends BaseFileHandler // pull the file try { 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(); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java index e5f4fdb..88db5cc 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java @@ -44,6 +44,7 @@ public class NativeHeapDataImporter implements IRunnableWithProgress { mReader.setLineNumber(1); // start numbering at 1 } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask("Importing Heap Data", IProgressMonitor.UNKNOWN); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java index 874e9d6..b96fa02 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java @@ -29,10 +29,12 @@ import org.eclipse.swt.graphics.Image; public class NativeHeapLabelProvider extends LabelProvider implements ITableLabelProvider { private long mTotalSize; + @Override public Image getColumnImage(Object arg0, int arg1) { return null; } + @Override public String getColumnText(Object element, int index) { if (element instanceof NativeAllocationInfo) { return getColumnTextForNativeAllocation((NativeAllocationInfo) element, index); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java index 72cdc22..5f7abe2 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java @@ -24,9 +24,9 @@ import com.android.ddmlib.NativeStackCallInfo; import com.android.ddmuilib.Addr2Line; import com.android.ddmuilib.BaseHeapPanel; import com.android.ddmuilib.ITableFocusListener; +import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; import com.android.ddmuilib.ImageLoader; import com.android.ddmuilib.TableHelper; -import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; @@ -165,6 +165,7 @@ public class NativeHeapPanel extends BaseHeapPanel { } /** {@inheritDoc} */ + @Override public void clientChanged(final Client client, int changeMask) { if (client != getCurrentClient()) { return; @@ -195,6 +196,7 @@ public class NativeHeapPanel extends BaseHeapPanel { t.start(); } else { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { resolveSymbols(); mDetailsTreeViewer.refresh(); @@ -361,6 +363,7 @@ public class NativeHeapPanel extends BaseHeapPanel { private void updateDisplay() { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { updateSnapshotIndexCombo(); updateToolbars(); @@ -374,6 +377,7 @@ public class NativeHeapPanel extends BaseHeapPanel { private void displaySelectedSnapshot() { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { int idx = mSnapshotIndexCombo.getSelectionIndex(); displaySnapshot(idx); @@ -654,6 +658,7 @@ public class NativeHeapPanel extends BaseHeapPanel { mSymbolSearchPathText.setMessage(SYMBOL_SEARCH_PATH_TEXT_MESSAGE); mSymbolSearchPathText.setToolTipText(SYMBOL_SEARCH_PATH_TOOLTIP_TEXT); mSymbolSearchPathText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { String path = mSymbolSearchPathText.getText(); updateSearchPath(path); @@ -743,6 +748,7 @@ public class NativeHeapPanel extends BaseHeapPanel { stackTraceTree.setLayoutData(data); sash.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event e) { Rectangle sashRect = sash.getBounds(); Rectangle panelRect = c.getClientArea(); @@ -826,6 +832,7 @@ public class NativeHeapPanel extends BaseHeapPanel { final NativeHeapSnapshot snapshot = mNativeHeapSnapshots.get(idx); Thread t = new Thread(new Runnable() { + @Override public void run() { PrintWriter out; try { @@ -843,6 +850,7 @@ public class NativeHeapPanel extends BaseHeapPanel { private void displayErrorMessage(final String message) { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { MessageDialog.openError(Display.getDefault().getActiveShell(), "Failed to export heap data", message); @@ -992,21 +1000,25 @@ public class NativeHeapPanel extends BaseHeapPanel { final Tree heapSitesTree = mDetailsTreeViewer.getTree(); final IFocusedTableActivator heapSitesActivator = new IFocusedTableActivator() { + @Override public void copy(Clipboard clipboard) { TreeItem[] items = heapSitesTree.getSelection(); copyToClipboard(items, clipboard); } + @Override public void selectAll() { heapSitesTree.selectAll(); } }; heapSitesTree.addFocusListener(new FocusListener() { + @Override public void focusLost(FocusEvent arg0) { mTableFocusListener.focusLost(heapSitesActivator); } + @Override public void focusGained(FocusEvent arg0) { mTableFocusListener.focusGained(heapSitesActivator); } @@ -1014,21 +1026,25 @@ public class NativeHeapPanel extends BaseHeapPanel { final Tree stackTraceTree = mStackTraceTreeViewer.getTree(); final IFocusedTableActivator stackTraceActivator = new IFocusedTableActivator() { + @Override public void copy(Clipboard clipboard) { TreeItem[] items = stackTraceTree.getSelection(); copyToClipboard(items, clipboard); } + @Override public void selectAll() { stackTraceTree.selectAll(); } }; stackTraceTree.addFocusListener(new FocusListener() { + @Override public void focusLost(FocusEvent arg0) { mTableFocusListener.focusLost(stackTraceActivator); } + @Override public void focusGained(FocusEvent arg0) { mTableFocusListener.focusGained(stackTraceActivator); } @@ -1068,6 +1084,7 @@ public class NativeHeapPanel extends BaseHeapPanel { mResolvedSymbolCache = new HashMap<Long, NativeStackCallInfo>(); } + @Override public void run() { for (NativeAllocationInfo callSite : mCallSites) { if (callSite.isStackCallResolved()) { @@ -1094,6 +1111,7 @@ public class NativeHeapPanel extends BaseHeapPanel { } Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { mDetailsTreeViewer.refresh(); mStackTraceTreeViewer.refresh(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java index 54982b1..c31716b 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java @@ -39,17 +39,21 @@ public final class NativeHeapProviderByAllocations implements ILazyTreeContentPr mDisplayZygoteMemory = displayZygotes; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { mNativeHeapDump = (NativeHeapSnapshot) newInput; } + @Override public Object getParent(Object arg0) { return null; } + @Override public void updateChildCount(Object element, int currentChildCount) { int childCount = 0; @@ -60,6 +64,7 @@ public final class NativeHeapProviderByAllocations implements ILazyTreeContentPr mViewer.setChildCount(element, childCount); } + @Override public void updateElement(Object parent, int index) { Object item = null; diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java index aefb38c..b786bfa 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java @@ -36,16 +36,20 @@ public class NativeHeapProviderByLibrary implements ILazyTreeContentProvider { mDisplayZygoteMemory = displayZygotes; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public Object getParent(Object element) { return null; } + @Override public void updateChildCount(Object element, int currentChildCount) { int childCount = 0; @@ -57,6 +61,7 @@ public class NativeHeapProviderByLibrary implements ILazyTreeContentProvider { mViewer.setChildCount(element, childCount); } + @Override public void updateElement(Object parent, int index) { Object item = null; int childCount = 0; diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java index 7bc2649..1722cdb 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java @@ -112,6 +112,7 @@ public final class NativeLibraryAllocationInfo { // finally, sort by total size Collections.sort(libraryAllocations, new Comparator<NativeLibraryAllocationInfo>() { + @Override public int compare(NativeLibraryAllocationInfo o1, NativeLibraryAllocationInfo o2) { return (int) (o2.getTotalSize() - o1.getTotalSize()); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java index 54001d2..9a6ddb2 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java @@ -22,16 +22,20 @@ import org.eclipse.jface.viewers.Viewer; import java.util.List; public class NativeStackContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object arg0) { return getChildren(arg0); } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof List<?>) { return ((List<?>) parentElement).toArray(); @@ -40,10 +44,12 @@ public class NativeStackContentProvider implements ITreeContentProvider { return null; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { return false; } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java index e59e787..b7428b9 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java @@ -23,10 +23,12 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.swt.graphics.Image; public class NativeStackLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object arg0, int arg1) { return null; } + @Override public String getColumnText(Object element, int index) { if (element instanceof NativeStackCallInfo) { return getResolvedStackTraceColumnText((NativeStackCallInfo) element, index); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java index 5302fcb..1a75c6e 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java @@ -100,6 +100,7 @@ public class NativeSymbolResolverTask implements IRunnableWithProgress { mNotFoundLibraries = new HashSet<String>(); } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask("Resolving symbols", IProgressMonitor.UNKNOWN); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java index 0620f76..2aef53c 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java @@ -52,6 +52,7 @@ public final class CoordinateControls { * ModifyListener for the 3 {@link Text} controls of the sexagesimal mode. */ private ModifyListener mSexagesimalListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent event) { if (mManualTextChange > 0) { return; @@ -75,6 +76,7 @@ public final class CoordinateControls { */ public void createDecimalText(Composite parent) { mDecimalText = createTextControl(parent, "-199.999999", new ModifyListener() { + @Override public void modifyText(ModifyEvent event) { if (mManualTextChange > 0) { return; diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java index 7fb37ce..da21920 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java @@ -23,10 +23,11 @@ import org.eclipse.jface.viewers.Viewer; /** * Content provider to display {@link Track} objects in a Table. - * <p/>The expected type for the input is {@link Track}<code>[]</code>. + * <p/>The expected type for the input is {@link Track}<code>[]</code>. */ public class TrackContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof Track[]) { return (Track[])inputElement; @@ -35,10 +36,12 @@ public class TrackContentProvider implements IStructuredContentProvider { return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java index 81d1f7d..50acb53 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java @@ -30,10 +30,12 @@ import java.util.Date; */ public class TrackLabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof Track) { Track track = (Track)element; @@ -62,19 +64,23 @@ public class TrackLabelProvider implements ITableLabelProvider { 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 } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java index fced777..1b7fe15 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java @@ -21,10 +21,11 @@ import org.eclipse.jface.viewers.Viewer; /** * Content provider to display {@link WayPoint} objects in a Table. - * <p/>The expected type for the input is {@link WayPoint}<code>[]</code>. + * <p/>The expected type for the input is {@link WayPoint}<code>[]</code>. */ public class WayPointContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof WayPoint[]) { return (WayPoint[])inputElement; @@ -33,10 +34,12 @@ public class WayPointContentProvider implements IStructuredContentProvider { return new Object[0]; } + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java index f5e6f1b..9f642f1 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java @@ -26,10 +26,12 @@ import org.eclipse.swt.widgets.Table; */ public class WayPointLabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof WayPoint) { WayPoint wayPoint = (WayPoint)element; @@ -54,19 +56,23 @@ public class WayPointLabelProvider implements ITableLabelProvider { 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 } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java index 26296f3..8e7c1ac 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java @@ -22,6 +22,7 @@ import com.android.ddmlib.log.EventValueDescription; import com.android.ddmlib.log.InvalidTypeException; import com.android.ddmuilib.DdmUiPreferences; import com.android.ddmuilib.TableHelper; + import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ControlAdapter; @@ -93,7 +94,7 @@ public class DisplayLog extends EventDisplay { // get the date. Calendar c = Calendar.getInstance(); - long msec = (long) event.sec * 1000L; + long msec = event.sec * 1000L; c.setTimeInMillis(msec); // convert the time into a string @@ -147,7 +148,7 @@ public class DisplayLog extends EventDisplay { // get the date. Calendar c = Calendar.getInstance(); - long msec = (long) event.sec * 1000L; + long msec = event.sec * 1000L; c.setTimeInMillis(msec); // convert the time into a string @@ -247,6 +248,7 @@ public class DisplayLog extends EventDisplay { mainComp.setLayout(gl = new GridLayout(1, false)); gl.marginHeight = gl.marginWidth = 0; mainComp.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { mLogTable = null; } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java index 7fdb403..d0d2789 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java @@ -560,6 +560,7 @@ abstract class EventDisplay { xyPlot.setDomainCrosshairLockedOnData(true); mChart.addChangeListener(new ChartChangeListener() { + @Override public void chartChanged(ChartChangeEvent event) { ChartChangeEventType type = event.getType(); if (type == ChartChangeEventType.GENERAL) { @@ -567,6 +568,7 @@ abstract class EventDisplay { // updated on the draw, but the notification happens before the draw, // we process the click in a future runnable! parent.getDisplay().asyncExec(new Runnable() { + @Override public void run() { processClick(xyPlot); } @@ -590,6 +592,7 @@ abstract class EventDisplay { true); // tooltips mChartComposite.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { mValueTypeDataSetMap.clear(); mDataSetCount = 0; diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java index d746753..b13f3f4 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java @@ -23,6 +23,7 @@ import com.android.ddmuilib.DdmUiPreferences; import com.android.ddmuilib.ImageLoader; import com.android.ddmuilib.log.event.EventDisplay.OccurrenceDisplayDescriptor; import com.android.ddmuilib.log.event.EventDisplay.ValueDisplayDescriptor; + import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; @@ -197,6 +198,7 @@ class EventDisplayOptions extends Dialog { createRightPanel(rightPanel); mShell.addListener(SWT.Close, new Listener() { + @Override public void handleEvent(Event event) { event.doit = true; } @@ -365,6 +367,7 @@ class EventDisplayOptions extends Dialog { mDisplayWidthText.setText(Integer.toString( store.getInt(EventLogPanel.PREFS_DISPLAY_WIDTH))); mDisplayWidthText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String text = mDisplayWidthText.getText().trim(); try { @@ -384,6 +387,7 @@ class EventDisplayOptions extends Dialog { mDisplayHeightText.setText(Integer.toString( store.getInt(EventLogPanel.PREFS_DISPLAY_HEIGHT))); mDisplayHeightText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String text = mDisplayHeightText.getText().trim(); try { @@ -410,6 +414,7 @@ class EventDisplayOptions extends Dialog { mDisplayNameText = new Text(mInfoGroup, SWT.BORDER | SWT.LEFT | SWT.SINGLE); mDisplayNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mDisplayNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (mProcessTextChanges) { EventDisplay eventDisplay = getCurrentEventDisplay(); @@ -466,6 +471,7 @@ class EventDisplayOptions extends Dialog { mTimeLimitText = new Text(mChartOptions, SWT.BORDER); mTimeLimitText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mTimeLimitText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { String text = mTimeLimitText.getText().trim(); EventDisplay eventDisplay = getCurrentEventDisplay(); @@ -498,6 +504,7 @@ class EventDisplayOptions extends Dialog { mHistWidthText = new Text(mHistOptions, SWT.BORDER); mHistWidthText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mHistWidthText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { String text = mHistWidthText.getText().trim(); EventDisplay eventDisplay = getCurrentEventDisplay(); @@ -540,6 +547,7 @@ class EventDisplayOptions extends Dialog { mPidText = new Text(mInfoGroup, SWT.BORDER); mPidText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mPidText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (mProcessTextChanges) { EventDisplay eventDisplay = getCurrentEventDisplay(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java index 49f9eae..4faac3a 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java @@ -128,6 +128,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, ICommonAction saveAction, ICommonAction loadAction, ICommonAction importAction) { mOptionsAction = optionsAction; mOptionsAction.setRunnable(new Runnable() { + @Override public void run() { openOptionPanel(); } @@ -135,6 +136,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, mClearAction = clearAction; mClearAction.setRunnable(new Runnable() { + @Override public void run() { clearLog(); } @@ -142,6 +144,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, mSaveAction = saveAction; mSaveAction.setRunnable(new Runnable() { + @Override public void run() { try { FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.SAVE); @@ -160,6 +163,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, mLoadAction = loadAction; mLoadAction.setRunnable(new Runnable() { + @Override public void run() { FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.OPEN); @@ -174,6 +178,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, mImportAction = importAction; mImportAction.setRunnable(new Runnable() { + @Override public void run() { FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.OPEN); @@ -325,6 +330,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, * (non-Javadoc) * @see com.android.ddmlib.AndroidDebugBridge.IClientChangeListener#clientChanged(com.android.ddmlib.Client, int) */ + @Override public void clientChanged(Client client, int changeMask) { // pass } @@ -336,6 +342,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, protected Control createControl(Composite parent) { mParent = parent; mParent.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { synchronized (mLock) { if (mCurrentLogReceiver != null) { @@ -578,6 +585,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, // run sync as we need to update right now. d.syncExec(new Runnable() { + @Override public void run() { if (mBottomParentPanel.isDisposed() == false) { resetUiFromUiThread(); @@ -680,6 +688,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, * @param entry The new log entry * @see LogReceiver.ILogListener#newEntry(LogEntry) */ + @Override @WorkerThread public void newEntry(LogEntry entry) { synchronized (mLock) { @@ -724,6 +733,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, try { Display d = mBottomParentPanel.getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { if (mBottomParentPanel.isDisposed() == false) { if (mCurrentEventLogParser != null) { @@ -741,6 +751,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, * Processes raw data coming from the log service. * @see LogReceiver.ILogListener#newData(byte[], int, int) */ + @Override public void newData(byte[] data, int offset, int length) { if (mTempFile != null) { try { @@ -861,6 +872,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, Display d = mBottomParentPanel.getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { if (mBottomParentPanel.isDisposed() == false) { for (EventDisplay eventDisplay : mEventDisplays) { @@ -882,6 +894,7 @@ public class EventLogPanel extends TablePanel implements ILogListener, } } + @Override @UiThread public void columnResized(int index, TableColumn sourceColumn) { for (EventDisplay eventDisplay : mEventDisplays) { diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java index dd32e2c..e7c5196 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java @@ -16,10 +16,10 @@ package com.android.ddmuilib.log.event; -import com.android.ddmlib.log.EventLogParser; -import com.android.ddmlib.log.EventValueDescription; import com.android.ddmlib.log.EventContainer.CompareMethod; import com.android.ddmlib.log.EventContainer.EventValueType; +import com.android.ddmlib.log.EventLogParser; +import com.android.ddmlib.log.EventValueDescription; import com.android.ddmuilib.log.event.EventDisplay.OccurrenceDisplayDescriptor; import com.android.ddmuilib.log.event.EventDisplay.ValueDisplayDescriptor; @@ -64,16 +64,16 @@ final class EventValueSelector extends Dialog { private EventLogParser mLogParser; private OccurrenceDisplayDescriptor mDescriptor; - + /** list of event integer in the order of the combo. */ private Integer[] mEventTags; - + /** list of indices in the {@link EventValueDescription} array of the current event * that are of type string. This lets us get back the {@link EventValueDescription} from the * index in the Series {@link Combo}. */ private final ArrayList<Integer> mSeriesIndices = new ArrayList<Integer>(); - + public EventValueSelector(Shell parent) { super(parent, SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL); } @@ -123,11 +123,11 @@ final class EventValueSelector extends Dialog { } loadValueDescriptor(); - + checkValidity(); // Set the dialog size. - try { + try { mShell.setMinimumSize(DLG_WIDTH, DLG_HEIGHT); Rectangle r = mParent.getBounds(); // get the center new top left. @@ -151,14 +151,14 @@ final class EventValueSelector extends Dialog { if (!display.readAndDispatch()) display.sleep(); } - + return mEditStatus; } - + OccurrenceDisplayDescriptor getDescriptor() { return mDescriptor; } - + private void createUI() { GridData gd; @@ -167,10 +167,10 @@ final class EventValueSelector extends Dialog { mShell.setText("Event Display Configuration"); mShell.setLayout(new GridLayout(2, false)); - + Label l = new Label(mShell, SWT.NONE); l.setText("Event:"); - + mEventCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY); mEventCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); @@ -183,12 +183,12 @@ final class EventValueSelector extends Dialog { if (eventInfoMap.get(i) != null) { String eventName = eventTagMap.get(i); mEventCombo.add(eventName); - + list.add(i); } } mEventTags = list.toArray(new Integer[list.size()]); - + mEventCombo.addSelectionListener(new SelectionAdapter() { /* (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) @@ -202,7 +202,7 @@ final class EventValueSelector extends Dialog { l = new Label(mShell, SWT.NONE); l.setText("Value:"); - + mValueCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY); mValueCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mValueCombo.addSelectionListener(new SelectionAdapter() { @@ -288,24 +288,25 @@ final class EventValueSelector extends Dialog { l = new Label(mShell, SWT.NONE); l.setText("Filter Value:"); - + mFilterValue = new Text(mShell, SWT.BORDER | SWT.SINGLE); mFilterValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mFilterValue.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (mDescriptor.filterValueIndex != -1) { // get the current selection in the event combo int index = mEventCombo.getSelectionIndex(); - + if (index != -1) { // match it to an event int eventTag = mEventTags[index]; mDescriptor.eventTag = eventTag; - + // get the EventValueDescription for this tag EventValueDescription valueDesc = mLogParser.getEventInfoMap() .get(eventTag)[mDescriptor.filterValueIndex]; - + // let the EventValueDescription convert the String value into an object // of the proper type. mDescriptor.filterValue = valueDesc.getObjectFromString( @@ -315,14 +316,14 @@ final class EventValueSelector extends Dialog { } } }); - + // add a separator spanning the 2 columns - + l = new Label(mShell, SWT.SEPARATOR | SWT.HORIZONTAL); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; l.setLayoutData(gd); - + // add a composite to hold the ok/cancel button, no matter what the columns size are. Composite buttonComp = new Composite(mShell, SWT.NONE); gd = new GridData(GridData.FILL_HORIZONTAL); @@ -353,7 +354,7 @@ final class EventValueSelector extends Dialog { padding = new Composite(mShell, SWT.NONE); padding.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - + Button cancelButton = new Button(buttonComp, SWT.PUSH); cancelButton.setText("Cancel"); cancelButton.setLayoutData(new GridData(GridData.CENTER)); @@ -371,8 +372,9 @@ final class EventValueSelector extends Dialog { padding = new Composite(mShell, SWT.NONE); padding.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - + mShell.addListener(SWT.Close, new Listener() { + @Override public void handleEvent(Event event) { event.doit = true; } @@ -391,21 +393,21 @@ final class EventValueSelector extends Dialog { // match it to an event int eventTag = mEventTags[index]; mDescriptor.eventTag = eventTag; - + // get the EventValueDescription for this tag EventValueDescription[] values = mLogParser.getEventInfoMap().get(eventTag); - + // fill the combo for the values mValueCombo.removeAll(); if (values != null) { if (mDescriptor instanceof ValueDisplayDescriptor) { ValueDisplayDescriptor valueDescriptor = (ValueDisplayDescriptor)mDescriptor; - + mValueCombo.setEnabled(true); for (EventValueDescription value : values) { mValueCombo.add(value.toString()); } - + if (valueDescriptor.valueIndex != -1) { mValueCombo.select(valueDescriptor.valueIndex); } else { @@ -426,7 +428,7 @@ final class EventValueSelector extends Dialog { mSeriesCombo.add(value.getName()); mSeriesCombo.setEnabled(true); mSeriesIndices.add(axisIndex); - + if (mDescriptor.seriesValueIndex != -1 && mDescriptor.seriesValueIndex == axisIndex) { selectionIndex = axisIndex; @@ -441,7 +443,7 @@ final class EventValueSelector extends Dialog { // +1 because we added another item at index 0 mSeriesCombo.select(selectionIndex + 1); - + if (selectionIndex >= 0) { mDisplayPidCheckBox.setSelection(mDescriptor.includePid); mDisplayPidCheckBox.setEnabled(true); @@ -453,7 +455,7 @@ final class EventValueSelector extends Dialog { mDisplayPidCheckBox.setSelection(false); mDisplayPidCheckBox.setEnabled(false); } - + // fill the filter combo mFilterCombo.setEnabled(true); mFilterCombo.removeAll(); @@ -461,7 +463,7 @@ final class EventValueSelector extends Dialog { for (EventValueDescription value : values) { mFilterCombo.add(value.toString()); } - + // select the current filter mFilterCombo.select(mDescriptor.filterValueIndex + 1); mFilterMethodCombo.select(getFilterMethodIndex(mDescriptor.filterCompareMethod)); @@ -483,12 +485,12 @@ final class EventValueSelector extends Dialog { } else { disableSubCombos(); } - + checkValidity(); } /** - * + * */ private void disableSubCombos() { mValueCombo.removeAll(); @@ -498,14 +500,14 @@ final class EventValueSelector extends Dialog { mSeriesCombo.removeAll(); mSeriesCombo.clearSelection(); mSeriesCombo.setEnabled(false); - + mDisplayPidCheckBox.setEnabled(false); mDisplayPidCheckBox.setSelection(false); - + mFilterCombo.removeAll(); mFilterCombo.clearSelection(); mFilterCombo.setEnabled(false); - + mFilterValue.setEnabled(false); mFilterValue.setText(""); mFilterMethodCombo.setEnabled(false); @@ -517,32 +519,32 @@ final class EventValueSelector extends Dialog { // get the current selection in the value combo int index = mValueCombo.getSelectionIndex(); valueDescriptor.valueIndex = index; - + // for now set the built-in name // get the current selection in the event combo int eventIndex = mEventCombo.getSelectionIndex(); - + // match it to an event int eventTag = mEventTags[eventIndex]; - + // get the EventValueDescription for this tag EventValueDescription[] values = mLogParser.getEventInfoMap().get(eventTag); valueDescriptor.valueName = values[index].getName(); - + checkValidity(); } private void handleSeriesComboSelection() { // get the current selection in the axis combo int index = mSeriesCombo.getSelectionIndex(); - + // get the actual value index from the list. int valueIndex = mSeriesIndices.get(index); - + mDescriptor.seriesValueIndex = valueIndex; - + if (index > 0) { mDisplayPidCheckBox.setEnabled(true); mDisplayPidCheckBox.setSelection(mDescriptor.includePid); @@ -555,13 +557,13 @@ final class EventValueSelector extends Dialog { private void handleFilterComboSelection() { // get the current selection in the axis combo int index = mFilterCombo.getSelectionIndex(); - + // decrement index by 1 since the item 0 means // no filter (index = -1), and the rest is offset by 1 index--; mDescriptor.filterValueIndex = index; - + if (index != -1) { mFilterValue.setEnabled(true); mFilterMethodCombo.setEnabled(true); @@ -574,12 +576,12 @@ final class EventValueSelector extends Dialog { mFilterMethodCombo.setEnabled(false); } } - + private void handleFilterMethodComboSelection() { // get the current selection in the axis combo int index = mFilterMethodCombo.getSelectionIndex(); CompareMethod method = CompareMethod.values()[index]; - + mDescriptor.filterCompareMethod = method; } @@ -609,7 +611,7 @@ final class EventValueSelector extends Dialog { } eventIndex++; } - + if (comboIndex == -1) { mEventCombo.clearSelection(); } else { @@ -619,7 +621,7 @@ final class EventValueSelector extends Dialog { // get the event from the descriptor handleEventComboSelection(); } - + private void checkValidity() { mOkButton.setEnabled(mEventCombo.getSelectionIndex() != -1 && (((mDescriptor instanceof ValueDisplayDescriptor) == false) || diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java index 6cd44d0..0e302ce 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java @@ -149,6 +149,7 @@ public class EditFilterDialog extends Dialog { mShell.setLayout(new GridLayout(1, false)); mShell.addListener(SWT.Close, new Listener() { + @Override public void handleEvent(Event event) { } }); @@ -171,6 +172,7 @@ public class EditFilterDialog extends Dialog { } filterNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); filterNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mName = filterNameText.getText().trim(); validate(); @@ -204,6 +206,7 @@ public class EditFilterDialog extends Dialog { tagText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); tagText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mTag = tagText.getText().trim(); validate(); @@ -228,6 +231,7 @@ public class EditFilterDialog extends Dialog { } pidText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); pidText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { mPid = pidText.getText().trim(); validate(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java index 2adbc4c..164f484 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java @@ -24,9 +24,11 @@ import java.util.List; * A JFace content provider for logcat filter list, used in {@link LogCatPanel}. */ public final class LogCatFilterContentProvider implements IStructuredContentProvider { + @Override public void dispose() { } + @Override public void inputChanged(Viewer arg0, Object arg1, Object arg2) { } @@ -35,6 +37,7 @@ public final class LogCatFilterContentProvider implements IStructuredContentProv * @param model list of {@link LogCatFilter}'s * @return array of {@link LogCatFilter} objects, or null. */ + @Override public Object[] getElements(Object model) { if (model instanceof List<?>) { return ((List<?>) model).toArray(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java index 4cc044d..59e236c 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java @@ -24,6 +24,7 @@ import org.eclipse.swt.graphics.Image; * {@link LogCatFilter}. */ public final class LogCatFilterLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public Image getColumnImage(Object arg0, int arg1) { return null; } @@ -34,6 +35,7 @@ public final class LogCatFilterLabelProvider extends LabelProvider implements IT * @param index index of the column * @return text to use in the column */ + @Override public String getColumnText(Object element, int index) { if (!(element instanceof LogCatFilter)) { return null; diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java index 955b291..f68ee05 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java @@ -133,6 +133,7 @@ public final class LogCatFilterSettingsDialog extends TitleAreaDialog { /* call validateDialog() whenever user modifies any text field */ ModifyListener m = new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { DialogStatus status = validateDialog(); mOkButton.setEnabled(status.valid); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageContentProvider.java index 27b0456..bd7b520 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageContentProvider.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageContentProvider.java @@ -23,12 +23,15 @@ import org.eclipse.jface.viewers.Viewer; * A JFace content provider for the LogCat log messages, used in the {@link LogCatPanel}. */ public final class LogCatMessageContentProvider implements IStructuredContentProvider { + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public Object[] getElements(Object model) { if (model instanceof LogCatMessageList) { Object[] e = ((LogCatMessageList) model).toArray(); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java index f910c14..43dddf1 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java @@ -20,10 +20,10 @@ import com.android.ddmlib.DdmConstants; import com.android.ddmlib.IDevice; import com.android.ddmlib.Log.LogLevel; import com.android.ddmuilib.ITableFocusListener; +import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; import com.android.ddmuilib.ImageLoader; import com.android.ddmuilib.SelectionDependentPanel; import com.android.ddmuilib.TableHelper; -import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; @@ -190,6 +190,7 @@ public final class LogCatPanel extends SelectionDependentPanel private void initializePreferenceUpdateListeners() { mPrefStore.addPropertyChangeListener(new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { String changedProperty = event.getProperty(); @@ -248,6 +249,7 @@ public final class LogCatPanel extends SelectionDependentPanel // Run this in a separate async thread to give the table some time to update after the // setInput above. Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { scrollToLatestLog(); } @@ -511,6 +513,7 @@ public final class LogCatPanel extends SelectionDependentPanel mLiveFilterText.setMessage(DEFAULT_SEARCH_MESSAGE); mLiveFilterText.setToolTipText(DEFAULT_SEARCH_TOOLTIP); mLiveFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { updateAppliedFilters(); } @@ -610,6 +613,7 @@ public final class LogCatPanel extends SelectionDependentPanel /* save messages to file in a different (non UI) thread */ Thread t = new Thread(new Runnable() { + @Override public void run() { try { BufferedWriter w = new BufferedWriter(new FileWriter(fName)); @@ -620,6 +624,7 @@ public final class LogCatPanel extends SelectionDependentPanel w.close(); } catch (final IOException e) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { MessageDialog.openError(Display.getCurrent().getActiveShell(), "Unable to export selection to file.", @@ -772,6 +777,7 @@ public final class LogCatPanel extends SelectionDependentPanel // This is not strictly necessary, except that on WinXP, the rows showed up clipped. So // we explicitly set it to be sure. mViewer.getTable().addListener(SWT.MeasureItem, new Listener() { + @Override public void handleEvent(Event event) { event.height = event.gc.getFontMetrics().getHeight(); } @@ -825,6 +831,7 @@ public final class LogCatPanel extends SelectionDependentPanel // and see if the last item has been painted since the previous scroll event. // If the last item has been painted, then we assume that we are at the bottom. mViewer.getTable().addListener(SWT.PaintItem, new Listener() { + @Override public void handleEvent(Event event) { TableItem item = (TableItem) event.item; TableItem[] items = mViewer.getTable().getItems(); @@ -1019,6 +1026,7 @@ public final class LogCatPanel extends SelectionDependentPanel * @param receivedMessages list of messages from logcat * Implements {@link ILogCatMessageEventListener#messageReceived()}. */ + @Override public void messageReceived(List<LogCatMessage> receivedMessages) { refreshLogCatTable(); @@ -1043,6 +1051,7 @@ public final class LogCatPanel extends SelectionDependentPanel private void refreshFiltersTable() { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (mFiltersTableViewer.getTable().isDisposed()) { return; @@ -1071,6 +1080,7 @@ public final class LogCatPanel extends SelectionDependentPanel } private class LogCatTableRefresherTask implements Runnable { + @Override public void run() { if (mViewer.getTable().isDisposed()) { return; @@ -1127,20 +1137,24 @@ public final class LogCatPanel extends SelectionDependentPanel final Table table = mViewer.getTable(); final IFocusedTableActivator activator = new IFocusedTableActivator() { + @Override public void copy(Clipboard clipboard) { copySelectionToClipboard(clipboard); } + @Override public void selectAll() { table.selectAll(); } }; table.addFocusListener(new FocusListener() { + @Override public void focusGained(FocusEvent e) { mTableFocusListener.focusGained(activator); } + @Override public void focusLost(FocusEvent e) { mTableFocusListener.focusLost(activator); } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java index 1ce55bd..a4455d0 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java @@ -16,11 +16,11 @@ package com.android.ddmuilib.logcat; import com.android.ddmlib.AndroidDebugBridge; +import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; +import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import com.android.ddmlib.Client; import com.android.ddmlib.ClientData; import com.android.ddmlib.IDevice; -import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener; -import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; import java.util.HashMap; import java.util.Map; @@ -55,6 +55,7 @@ public class LogCatPidToNameMapper { private IClientChangeListener constructClientChangeListener() { return new IClientChangeListener() { + @Override public void clientChanged(Client client, int changeMask) { if ((changeMask & Client.CHANGE_NAME) == Client.CHANGE_NAME) { ClientData cd = client.getClientData(); @@ -76,12 +77,15 @@ public class LogCatPidToNameMapper { private IDeviceChangeListener constructDeviceChangeListener() { return new IDeviceChangeListener() { + @Override public void deviceDisconnected(IDevice device) { } + @Override public void deviceConnected(IDevice device) { } + @Override public void deviceChanged(IDevice device, int changeMask) { if (changeMask == IDevice.CHANGE_CLIENT_LIST) { updateClientList(device); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java index 584e14a..c9606f6 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java @@ -17,6 +17,7 @@ package com.android.ddmuilib.logcat; import com.android.ddmlib.IDevice; +import com.android.ddmlib.IShellOutputReceiver; import com.android.ddmlib.Log; import com.android.ddmlib.MultiLineReceiver; @@ -86,6 +87,7 @@ public final class LogCatReceiver { mCurrentLogCatOutputReceiver = new LogCatOutputReceiver(); Thread t = new Thread(new Runnable() { + @Override public void run() { /* wait while the device comes online */ while (!mCurrentDevice.isOnline()) { @@ -131,6 +133,7 @@ public final class LogCatReceiver { } /** Implements {@link IShellOutputReceiver#isCancelled() }. */ + @Override public boolean isCancelled() { return mIsCancelled; } diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java index a545790..5617988 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java @@ -37,13 +37,16 @@ public class LogCatReceiverFactory { /** Private constructor: cannot instantiate. */ private LogCatReceiverFactory() { AndroidDebugBridge.addDeviceChangeListener(new IDeviceChangeListener() { + @Override public void deviceDisconnected(IDevice device) { removeReceiverFor(device); } + @Override public void deviceConnected(IDevice device) { } + @Override public void deviceChanged(IDevice device, int changeMask) { } }); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java index 80ed6e9..d60bae8 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java @@ -19,15 +19,15 @@ package com.android.ddmuilib.logcat; import com.android.ddmlib.AdbCommandRejectedException; import com.android.ddmlib.IDevice; import com.android.ddmlib.Log; +import com.android.ddmlib.Log.LogLevel; import com.android.ddmlib.MultiLineReceiver; import com.android.ddmlib.ShellCommandUnresponsiveException; import com.android.ddmlib.TimeoutException; -import com.android.ddmlib.Log.LogLevel; import com.android.ddmuilib.DdmUiPreferences; import com.android.ddmuilib.ITableFocusListener; +import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; import com.android.ddmuilib.SelectionDependentPanel; import com.android.ddmuilib.TableHelper; -import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; import com.android.ddmuilib.actions.ICommonAction; import org.eclipse.jface.preference.IPreferenceStore; @@ -233,6 +233,7 @@ public class LogPanel extends SelectionDependentPanel { } } + @Override public boolean isCancelled() { return isCancelled; } @@ -261,6 +262,7 @@ public class LogPanel extends SelectionDependentPanel { mTabItem = tabItem; } + @Override public boolean isCancelled() { return mDone; } @@ -301,7 +303,8 @@ public class LogPanel extends SelectionDependentPanel { // update the tab Display d = mFolders.getDisplay(); d.asyncExec(new Runnable() { - public void run() { + @Override + public void run() { mTabItem.setText(name); } }); @@ -437,6 +440,7 @@ public class LogPanel extends SelectionDependentPanel { final Text filterText = new Text(bottom, SWT.SINGLE | SWT.BORDER); filterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); filterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateFilteringWith(filterText.getText()); } @@ -824,10 +828,12 @@ public class LogPanel extends SelectionDependentPanel { private void addTableToFocusListener(final Table table) { // create the activator for this table final IFocusedTableActivator activator = new IFocusedTableActivator() { + @Override public void copy(Clipboard clipboard) { copyTable(clipboard, table); } + @Override public void selectAll() { table.selectAll(); } @@ -835,10 +841,12 @@ public class LogPanel extends SelectionDependentPanel { // add the focus listener on the table to notify the global listener table.addFocusListener(new FocusListener() { + @Override public void focusGained(FocusEvent e) { mGlobalListener.focusGained(activator); } + @Override public void focusLost(FocusEvent e) { mGlobalListener.focusLost(activator); } @@ -946,9 +954,11 @@ public class LogPanel extends SelectionDependentPanel { ControlListener listener = null; if (mColumnMode == COLUMN_MODE_AUTO) { listener = new ControlListener() { + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { Rectangle r = t.getClientArea(); @@ -1045,6 +1055,7 @@ public class LogPanel extends SelectionDependentPanel { // run sync as we need to update right now. d.syncExec(new Runnable() { + @Override public void run() { mFolders.dispose(); mParent.pack(true); @@ -1062,6 +1073,7 @@ public class LogPanel extends SelectionDependentPanel { // run sync as we need to update right now. d.syncExec(new Runnable() { + @Override public void run() { if (mFolders.isDisposed() == false) { emptyTables(); @@ -1149,6 +1161,7 @@ public class LogPanel extends SelectionDependentPanel { // run in sync because this will update the buffer start/end indices display.asyncExec(new Runnable() { + @Override public void run() { asyncRefresh(); } diff --git a/eclipse/buildConfig/build.properties b/eclipse/buildConfig/build.properties index 4466ab7..ae3be41 100644 --- a/eclipse/buildConfig/build.properties +++ b/eclipse/buildConfig/build.properties @@ -224,10 +224,10 @@ javacVerbose=true #compilerArg= # Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties -javacSource=1.5 +javacSource=1.6 # Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties. -javacTarget=1.5 +javacTarget=1.6 ################### CUSTOM PROPERTIES ####################################### # repository location for update site 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); diff --git a/eclipse/scripts/rcp/build.properties b/eclipse/scripts/rcp/build.properties index 493665e..3e69a96 100644 --- a/eclipse/scripts/rcp/build.properties +++ b/eclipse/scripts/rcp/build.properties @@ -45,5 +45,5 @@ logExtension=.log javacDebugInfo=false javacFailOnError=true javacVerbose=true -javacSource=1.5 -javacTarget=1.5 +javacSource=1.6 +javacTarget=1.6 diff --git a/ide_common/.settings/org.eclipse.jdt.core.prefs b/ide_common/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/ide_common/.settings/org.eclipse.jdt.core.prefs +++ b/ide_common/.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/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java index 1dab87d..1c9eff3 100644 --- a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java +++ b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java @@ -27,10 +27,10 @@ import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.RenderSession; import com.android.ide.common.rendering.api.ResourceValue; import com.android.ide.common.rendering.api.Result; -import com.android.ide.common.rendering.api.SessionParams; -import com.android.ide.common.rendering.api.ViewInfo; import com.android.ide.common.rendering.api.Result.Status; +import com.android.ide.common.rendering.api.SessionParams; import com.android.ide.common.rendering.api.SessionParams.RenderingMode; +import com.android.ide.common.rendering.api.ViewInfo; import com.android.ide.common.rendering.legacy.ILegacyPullParser; import com.android.ide.common.rendering.legacy.LegacyCallback; import com.android.ide.common.resources.ResourceResolver; @@ -38,10 +38,10 @@ import com.android.ide.common.sdk.LoadStatus; import com.android.layoutlib.api.ILayoutBridge; import com.android.layoutlib.api.ILayoutLog; import com.android.layoutlib.api.ILayoutResult; +import com.android.layoutlib.api.ILayoutResult.ILayoutViewInfo; import com.android.layoutlib.api.IProjectCallback; import com.android.layoutlib.api.IResourceValue; import com.android.layoutlib.api.IXmlPullParser; -import com.android.layoutlib.api.ILayoutResult.ILayoutViewInfo; import com.android.resources.ResourceType; import java.awt.image.BufferedImage; @@ -467,14 +467,17 @@ public class LayoutLibrary { final LayoutLog log = params.getLog(); ILayoutLog logWrapper = new ILayoutLog() { + @Override public void warning(String message) { log.warning(null, message, null /*data*/); } + @Override public void error(Throwable t) { log.error(null, "error!", t, null /*data*/); } + @Override public void error(String message) { log.error(null, message, null /*data*/); } diff --git a/ide_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java b/ide_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java index 144a196..67e6a7b 100644 --- a/ide_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java +++ b/ide_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java @@ -35,10 +35,12 @@ public abstract class LegacyCallback implements // ------ implementation of the old interface using the new interface. + @Override public final Integer getResourceValue(String type, String name) { return getResourceId(ResourceType.getEnum(type), name); } + @Override public final String[] resolveResourceValue(int id) { Pair<ResourceType, String> info = resolveResourceId(id); if (info != null) { @@ -48,6 +50,7 @@ public abstract class LegacyCallback implements return null; } + @Override public final String resolveResourceValue(int[] id) { return resolveResourceId(id); } diff --git a/ide_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java b/ide_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java index e4b6730..6c72dbf 100644 --- a/ide_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java +++ b/ide_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java @@ -220,6 +220,7 @@ public final class IdGeneratingResourceFile extends ResourceFile return name; } + @Override public void addResourceValue(ResourceValue value) { // Just overwrite collisions. We're only interested in the unique // IDs declared diff --git a/ide_common/src/com/android/ide/common/resources/MultiResourceFile.java b/ide_common/src/com/android/ide/common/resources/MultiResourceFile.java index b95a98c..cff1869 100644 --- a/ide_common/src/com/android/ide/common/resources/MultiResourceFile.java +++ b/ide_common/src/com/android/ide/common/resources/MultiResourceFile.java @@ -179,6 +179,7 @@ public final class MultiResourceFile extends ResourceFile implements IValueResou * Adds a resource item to the list * @param value The value of the resource. */ + @Override public void addResourceValue(ResourceValue value) { ResourceType resType = value.getResourceType(); diff --git a/ide_common/src/com/android/ide/common/resources/ResourceFile.java b/ide_common/src/com/android/ide/common/resources/ResourceFile.java index bc5b750..378602a 100644 --- a/ide_common/src/com/android/ide/common/resources/ResourceFile.java +++ b/ide_common/src/com/android/ide/common/resources/ResourceFile.java @@ -41,6 +41,7 @@ public abstract class ResourceFile implements Configurable { protected abstract void update(ScanningContext context); protected abstract void dispose(ScanningContext context); + @Override public FolderConfiguration getConfiguration() { return mFolder.getConfiguration(); } diff --git a/ide_common/src/com/android/ide/common/resources/ResourceFolder.java b/ide_common/src/com/android/ide/common/resources/ResourceFolder.java index b8e0cda..03b6eb4 100644 --- a/ide_common/src/com/android/ide/common/resources/ResourceFolder.java +++ b/ide_common/src/com/android/ide/common/resources/ResourceFolder.java @@ -181,6 +181,7 @@ public final class ResourceFolder implements Configurable { return list; } + @Override public FolderConfiguration getConfiguration() { return mConfiguration; } diff --git a/ide_common/src/com/android/ide/common/resources/ResourceItem.java b/ide_common/src/com/android/ide/common/resources/ResourceItem.java index dd28a9a..49396eb 100644 --- a/ide_common/src/com/android/ide/common/resources/ResourceItem.java +++ b/ide_common/src/com/android/ide/common/resources/ResourceItem.java @@ -37,6 +37,7 @@ import java.util.List; public class ResourceItem implements Comparable<ResourceItem> { private final static Comparator<ResourceFile> sComparator = new Comparator<ResourceFile>() { + @Override public int compare(ResourceFile file1, ResourceFile file2) { // get both FolderConfiguration and compare them FolderConfiguration fc1 = file1.getFolder().getConfiguration(); @@ -72,6 +73,7 @@ public class ResourceItem implements Comparable<ResourceItem> { * Compares the {@link ResourceItem} to another. * @param other the ResourceItem to be compared to. */ + @Override public int compareTo(ResourceItem other) { return mName.compareTo(other.mName); } diff --git a/ide_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java b/ide_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java index cda30c5..f12ed8f 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java @@ -641,6 +641,7 @@ public final class FolderConfiguration implements Comparable<FolderConfiguration return result == null ? null : result.toString(); } + @Override public int compareTo(FolderConfiguration folderConfig) { // default are always at the top. if (isDefault()) { diff --git a/ide_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java b/ide_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java index 6abac4e..9f0b07f 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java @@ -115,6 +115,7 @@ public abstract class ResourceQualifier implements Comparable<ResourceQualifier> @Override public abstract int hashCode(); + @Override public final int compareTo(ResourceQualifier o) { return toString().compareTo(o.toString()); } diff --git a/layoutlib_api/.settings/org.eclipse.jdt.core.prefs b/layoutlib_api/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/layoutlib_api/.settings/org.eclipse.jdt.core.prefs +++ b/layoutlib_api/.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/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java b/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java index 9481246..ddcdbd5 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java @@ -75,6 +75,7 @@ public class AdapterBinding implements Iterable<DataBindingItem> { return mFooters.get(index); } + @Override public Iterator<DataBindingItem> iterator() { return mItems.iterator(); } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java index 93569bd..2a93f15 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java @@ -89,6 +89,7 @@ public class DataBindingItem implements Iterable<DataBindingItem> { return Collections.emptyList(); } + @Override public Iterator<DataBindingItem> iterator() { List<DataBindingItem> list = getChildren(); return list.iterator(); diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java index f63f16f..5add715 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java @@ -41,6 +41,7 @@ public class DensityBasedResourceValue extends ResourceValue implements IDensity /** Legacy method, do not call * @deprecated use {@link #getResourceDensity()} instead. */ + @Override @Deprecated public Density getDensity() { return Density.getEnum(mDensity.getDpiValue()); diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java index bb7dab4..dceb7c5 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java @@ -46,6 +46,7 @@ public class ResourceValue extends ResourceReference implements IResourceValue { * Returns the type of the resource. For instance "drawable", "color", etc... * @deprecated use {@link #getResourceType()} instead. */ + @Override @Deprecated public String getType() { return mType.getName(); @@ -54,6 +55,7 @@ public class ResourceValue extends ResourceReference implements IResourceValue { /** * Returns the value of the resource, as defined in the XML. This can be <code>null</code> */ + @Override public final String getValue() { return mValue; } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java index 9d1e65d..2daa7f9 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java @@ -44,6 +44,7 @@ public final class StyleResourceValue extends ResourceValue implements IStyleRes /** * Returns the parent style name or <code>null</code> if unknown. */ + @Override public String getParentStyle() { return mParentStyle; } @@ -75,6 +76,7 @@ public final class StyleResourceValue extends ResourceValue implements IStyleRes * Legacy method. * @deprecated use {@link #getValue()} */ + @Override @Deprecated public IResourceValue findItem(String name) { return mItems.get(name); diff --git a/lint/cli/.settings/org.eclipse.jdt.core.prefs b/lint/cli/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/lint/cli/.settings/org.eclipse.jdt.core.prefs +++ b/lint/cli/.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/lint/cli/src/com/android/tools/lint/HtmlReporter.java b/lint/cli/src/com/android/tools/lint/HtmlReporter.java index 258359c..43984f4 100644 --- a/lint/cli/src/com/android/tools/lint/HtmlReporter.java +++ b/lint/cli/src/com/android/tools/lint/HtmlReporter.java @@ -433,6 +433,7 @@ class HtmlReporter extends Reporter { if (urls.size() > 0) { // Sort in order Collections.sort(urls, new Comparator<String>() { + @Override public int compare(String s1, String s2) { return getDpiRank(s1) - getDpiRank(s2); } diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index 37491e5..489ac81 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -460,6 +460,7 @@ public class Main extends LintClient { List<Issue> issues = registry.getIssues(); List<Issue> sorted = new ArrayList<Issue>(issues); Collections.sort(sorted, new Comparator<Issue>() { + @Override public int compare(Issue issue1, Issue issue2) { int d = issue1.getCategory().compareTo(issue2.getCategory()); if (d != 0) { @@ -882,6 +883,7 @@ public class Main extends LintClient { } private class ProgressPrinter implements LintListener { + @Override public void update(EventType type, Context context) { switch (type) { case SCANNING_PROJECT: diff --git a/lint/cli/src/com/android/tools/lint/PositionXmlParser.java b/lint/cli/src/com/android/tools/lint/PositionXmlParser.java index c6c4574..7efdd57 100644 --- a/lint/cli/src/com/android/tools/lint/PositionXmlParser.java +++ b/lint/cli/src/com/android/tools/lint/PositionXmlParser.java @@ -61,6 +61,7 @@ public class PositionXmlParser implements IDomParser { // ---- Implements IDomParser ---- + @Override public Document parseXml(XmlContext context) { return parse(context, context.getContents(), true); } @@ -156,6 +157,7 @@ public class PositionXmlParser implements IDomParser { return (OffsetPosition) node.getUserData(POS_KEY); } + @Override public Location getLocation(XmlContext context, Node node) { OffsetPosition pos = (OffsetPosition) getPositions(node); if (pos != null) { @@ -165,6 +167,7 @@ public class PositionXmlParser implements IDomParser { return null; } + @Override public Handle createLocationHandle(XmlContext context, Node node) { return new LocationHandle(context.file, node); } @@ -383,6 +386,7 @@ public class PositionXmlParser implements IDomParser { } } + @Override public void dispose(XmlContext context, Document document) { } @@ -396,6 +400,7 @@ public class PositionXmlParser implements IDomParser { mNode = node; } + @Override public Location resolve() { OffsetPosition pos = (OffsetPosition) getPositions(mNode); if (pos != null) { diff --git a/lint/cli/src/com/android/tools/lint/Warning.java b/lint/cli/src/com/android/tools/lint/Warning.java index 19138bc..b6326f8 100644 --- a/lint/cli/src/com/android/tools/lint/Warning.java +++ b/lint/cli/src/com/android/tools/lint/Warning.java @@ -53,6 +53,7 @@ class Warning implements Comparable<Warning> { } // ---- Implements Comparable<Warning> ---- + @Override public int compareTo(Warning other) { // Sort by category, then by priority, then by id, // then by file, then by line diff --git a/lint/libs/lint_api/.settings/org.eclipse.jdt.core.prefs b/lint/libs/lint_api/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/lint/libs/lint_api/.settings/org.eclipse.jdt.core.prefs +++ b/lint/libs/lint_api/.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/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java index 6713a7f..5ab0940 100644 --- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java +++ b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java @@ -112,6 +112,7 @@ public final class Category implements Comparable<Category> { } } + @Override public int compareTo(Category other) { if (other.mPriority == mPriority) { if (mParent == other) { diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java index 5c1dd48..fd1ae3d 100644 --- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java +++ b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java @@ -192,6 +192,7 @@ public final class Issue implements Comparable<Issue> { * * @param other the {@link Issue} to compare this issue to */ + @Override public int compareTo(Issue other) { return getId().compareTo(other.getId()); } diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java index 10f1d6b..da79244 100644 --- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java +++ b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java @@ -308,6 +308,7 @@ public class Location { mEndOffset = endOffset; } + @Override public Location resolve() { return Location.create(mFile, mContents, mStartOffset, mEndOffset); } diff --git a/lint/libs/lint_checks/.settings/org.eclipse.jdt.core.prefs b/lint/libs/lint_checks/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/lint/libs/lint_checks/.settings/org.eclipse.jdt.core.prefs +++ b/lint/libs/lint_checks/.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/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java index 56941bb..db394d3 100644 --- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java +++ b/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java @@ -495,6 +495,7 @@ public class IconDetector extends Detector implements Detector.XmlScanner { } // Sort overall partitions by the first item in each list Collections.sort(lists, new Comparator<List<File>>() { + @Override public int compare(List<File> list1, List<File> list2) { return list1.get(0).compareTo(list2.get(0)); } @@ -677,6 +678,7 @@ public class IconDetector extends Detector implements Detector.XmlScanner { } Collections.sort(entries, new Comparator<Map.Entry<File, Dimension>>() { + @Override public int compare(Entry<File, Dimension> e1, Entry<File, Dimension> e2) { Dimension d1 = e1.getValue(); diff --git a/rule_api/.settings/org.eclipse.jdt.core.prefs b/rule_api/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/rule_api/.settings/org.eclipse.jdt.core.prefs +++ b/rule_api/.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/rule_api/src/com/android/ide/common/api/AbstractViewRule.java b/rule_api/src/com/android/ide/common/api/AbstractViewRule.java index e915e2c..86e7896 100644 --- a/rule_api/src/com/android/ide/common/api/AbstractViewRule.java +++ b/rule_api/src/com/android/ide/common/api/AbstractViewRule.java @@ -29,13 +29,16 @@ import java.util.List; */ @Beta public class AbstractViewRule implements IViewRule { + @Override public boolean onInitialize(String fqcn, IClientRulesEngine engine) { return true; } + @Override public void onDispose() { } + @Override public String getDisplayName() { // Default is to not override the selection display name. return null; @@ -43,17 +46,21 @@ public class AbstractViewRule implements IViewRule { // ==== Selection ==== + @Override public List<String> getSelectionHint(INode parentNode, INode childNode) { return null; } + @Override public void addLayoutActions(List<RuleAction> actions, INode parentNode, List<? extends INode> children) { } + @Override public void addContextMenuActions(List<RuleAction> actions, INode node) { } + @Override public void paintSelectionFeedback(IGraphics graphics, INode parentNode, List<? extends INode> childNodes, Object view) { } @@ -61,19 +68,23 @@ public class AbstractViewRule implements IViewRule { // ==== Drag & drop support ==== // By default Views do not accept drag'n'drop. + @Override public DropFeedback onDropEnter(INode targetNode, Object targetView, IDragElement[] elements) { return null; } + @Override public DropFeedback onDropMove(INode targetNode, IDragElement[] elements, DropFeedback feedback, Point p) { return null; } + @Override public void onDropLeave(INode targetNode, IDragElement[] elements, DropFeedback feedback) { // ignore } + @Override public void onDropped( INode targetNode, IDragElement[] elements, @@ -83,31 +94,38 @@ public class AbstractViewRule implements IViewRule { } + @Override public void onPaste(INode targetNode, Object targetView, IDragElement[] pastedElements) { } // ==== Create/Remove hooks ==== + @Override public void onCreate(INode node, INode parent, InsertType insertType) { } + @Override public void onChildInserted(INode child, INode parent, InsertType insertType) { } + @Override public void onRemovingChildren(List<INode> deleted, INode parent) { } // ==== Resizing ==== + @Override public DropFeedback onResizeBegin(INode child, INode parent, SegmentType horizontalEdge, SegmentType verticalEdge, Object childView, Object parentView) { return null; } + @Override public void onResizeUpdate(DropFeedback feedback, INode child, INode parent, Rect newBounds, int modifierMask) { } + @Override public void onResizeEnd(DropFeedback feedback, INode child, final INode parent, final Rect newBounds) { } diff --git a/rule_api/src/com/android/ide/common/api/RuleAction.java b/rule_api/src/com/android/ide/common/api/RuleAction.java index 71a6ac9..5b6dc7f 100755 --- a/rule_api/src/com/android/ide/common/api/RuleAction.java +++ b/rule_api/src/com/android/ide/common/api/RuleAction.java @@ -397,6 +397,7 @@ public class RuleAction implements Comparable<RuleAction> { } // Implements Comparable<MenuAciton> + @Override public int compareTo(RuleAction other) { if (mSortPriority != other.mSortPriority) { return mSortPriority - other.mSortPriority; diff --git a/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs +++ b/sdkmanager/app/.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/sdkmanager/app/src/com/android/sdkmanager/Main.java b/sdkmanager/app/src/com/android/sdkmanager/Main.java index 0129766..d86ba8d 100644 --- a/sdkmanager/app/src/com/android/sdkmanager/Main.java +++ b/sdkmanager/app/src/com/android/sdkmanager/Main.java @@ -22,19 +22,19 @@ import com.android.io.FileWrapper; import com.android.prefs.AndroidLocation; import com.android.prefs.AndroidLocation.AndroidLocationException; import com.android.sdklib.IAndroidTarget; +import com.android.sdklib.IAndroidTarget.IOptionalLibrary; import com.android.sdklib.ISdkLog; import com.android.sdklib.ISystemImage; import com.android.sdklib.SdkConstants; import com.android.sdklib.SdkManager; -import com.android.sdklib.IAndroidTarget.IOptionalLibrary; import com.android.sdklib.internal.avd.AvdInfo; import com.android.sdklib.internal.avd.AvdManager; import com.android.sdklib.internal.avd.HardwareProperties; import com.android.sdklib.internal.avd.HardwareProperties.HardwareProperty; import com.android.sdklib.internal.build.MakeIdentity; import com.android.sdklib.internal.project.ProjectCreator; -import com.android.sdklib.internal.project.ProjectProperties; import com.android.sdklib.internal.project.ProjectCreator.OutputLevel; +import com.android.sdklib.internal.project.ProjectProperties; import com.android.sdklib.internal.project.ProjectProperties.PropertyType; import com.android.sdklib.internal.repository.PlatformToolPackage; import com.android.sdklib.internal.repository.ToolPackage; @@ -48,8 +48,8 @@ import com.android.sdkuilib.internal.repository.UpdaterPage; import com.android.sdkuilib.internal.repository.sdkman2.PackagesPage; import com.android.sdkuilib.internal.widgets.MessageBoxLog; import com.android.sdkuilib.repository.AvdManagerWindow; -import com.android.sdkuilib.repository.SdkUpdaterWindow; import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext; +import com.android.sdkuilib.repository.SdkUpdaterWindow; import com.android.sdkuilib.repository.SdkUpdaterWindow.SdkInvocationContext; import com.android.util.Pair; @@ -127,6 +127,7 @@ public class Main { */ private void createLogger() { mSdkLog = new ISdkLog() { + @Override public void error(Throwable t, String errorFormat, Object... args) { if (errorFormat != null) { System.err.printf("Error: " + errorFormat, args); @@ -139,6 +140,7 @@ public class Main { } } + @Override public void warning(String warningFormat, Object... args) { if (mSdkCommandLine.isVerbose()) { System.out.printf("Warning: " + warningFormat, args); @@ -148,6 +150,7 @@ public class Main { } } + @Override public void printf(String msgFormat, Object... args) { System.out.printf(msgFormat, args); } @@ -1500,6 +1503,7 @@ public class Main { final AtomicBoolean keepErasing = new AtomicBoolean(true); Thread eraser = new Thread(new Runnable() { + @Override public void run() { while (keepErasing.get()) { System.err.print("\b "); //$NON-NLS-1$. \b=Backspace diff --git a/sdkmanager/app/src/com/android/sdkmanager/internal/repository/SettingsPage.java b/sdkmanager/app/src/com/android/sdkmanager/internal/repository/SettingsPage.java index 3a92870..f567d8b 100755 --- a/sdkmanager/app/src/com/android/sdkmanager/internal/repository/SettingsPage.java +++ b/sdkmanager/app/src/com/android/sdkmanager/internal/repository/SettingsPage.java @@ -58,6 +58,7 @@ public class SettingsPage extends UpdaterPage implements ISettingsPage { };
private ModifyListener mApplyOnModified = new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
applyNewSettings(); //$hide$
}
@@ -149,6 +150,7 @@ public class SettingsPage extends UpdaterPage implements ISettingsPage { }
/** Loads settings from the given {@link Properties} container and update the page UI. */
+ @Override
public void loadSettings(Properties in_settings) {
mProxyServerText.setText(in_settings.getProperty(KEY_HTTP_PROXY_HOST, "")); //$NON-NLS-1$
mProxyPortText.setText( in_settings.getProperty(KEY_HTTP_PROXY_PORT, "")); //$NON-NLS-1$
@@ -158,6 +160,7 @@ public class SettingsPage extends UpdaterPage implements ISettingsPage { /** Called by the application to retrieve settings from the UI and store them in
* the given {@link Properties} container. */
+ @Override
public void retrieveSettings(Properties out_settings) {
out_settings.setProperty(KEY_HTTP_PROXY_HOST, mProxyServerText.getText());
out_settings.setProperty(KEY_HTTP_PROXY_PORT, mProxyPortText.getText());
@@ -172,6 +175,7 @@ public class SettingsPage extends UpdaterPage implements ISettingsPage { * settings must be applied. The page does not apply the settings itself, instead
* it notifies the application.
*/
+ @Override
public void setOnSettingsChanged(SettingsChangedCallback settingsChangedCallback) {
mSettingsChangedCallback = settingsChangedCallback;
}
diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs +++ b/sdkmanager/libs/sdklib/.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/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java index 06b1f81..b30e0cc 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java @@ -47,18 +47,22 @@ final class AddOnTarget implements IAndroidTarget { mDescription = description; } + @Override public String getJarName() { return mJarName; } + @Override public String getJarPath() { return mJarPath; } + @Override public String getName() { return mName; } + @Override public String getDescription() { return mDescription; } @@ -136,14 +140,17 @@ final class AddOnTarget implements IAndroidTarget { } } + @Override public String getLocation() { return mLocation; } + @Override public String getName() { return mName; } + @Override public ISystemImage getSystemImage(String abiType) { for (ISystemImage sysImg : mSystemImages) { if (sysImg.getAbiType().equals(abiType)) { @@ -153,51 +160,63 @@ final class AddOnTarget implements IAndroidTarget { return null; } + @Override public ISystemImage[] getSystemImages() { return mSystemImages; } + @Override public String getVendor() { return mVendor; } + @Override public String getFullName() { return String.format("%1$s (%2$s)", mName, mVendor); } + @Override public String getClasspathName() { return String.format("%1$s [%2$s]", mName, mBasePlatform.getClasspathName()); } + @Override public String getShortClasspathName() { return String.format("%1$s [%2$s]", mName, mBasePlatform.getVersionName()); } + @Override public String getDescription() { return mDescription; } + @Override public AndroidVersion getVersion() { // this is always defined by the base platform return mBasePlatform.getVersion(); } + @Override public String getVersionName() { return mBasePlatform.getVersionName(); } + @Override public int getRevision() { return mRevision; } + @Override public boolean isPlatform() { return false; } + @Override public IAndroidTarget getParent() { return mBasePlatform; } + @Override public String getPath(int pathId) { switch (pathId) { case SKINS: @@ -232,6 +251,7 @@ final class AddOnTarget implements IAndroidTarget { File sampleLoc = new File(mLocation, SdkConstants.FD_SAMPLES); if (sampleLoc.isDirectory()) { File[] files = sampleLoc.listFiles(new FileFilter() { + @Override public boolean accept(File pathname) { return pathname.isDirectory(); } @@ -247,18 +267,22 @@ final class AddOnTarget implements IAndroidTarget { } } + @Override public boolean hasRenderingLibrary() { return mHasRenderingLibrary || mHasRenderingResources; } + @Override public String[] getSkins() { return mSkins; } + @Override public String getDefaultSkin() { return mDefaultSkin; } + @Override public IOptionalLibrary[] getOptionalLibraries() { return mLibraries; } @@ -268,30 +292,37 @@ final class AddOnTarget implements IAndroidTarget { * * {@inheritDoc} */ + @Override public String[] getPlatformLibraries() { return mBasePlatform.getPlatformLibraries(); } + @Override public String getProperty(String name) { return mBasePlatform.getProperty(name); } + @Override public Integer getProperty(String name, Integer defaultValue) { return mBasePlatform.getProperty(name, defaultValue); } + @Override public Boolean getProperty(String name, Boolean defaultValue) { return mBasePlatform.getProperty(name, defaultValue); } + @Override public Map<String, String> getProperties() { return mBasePlatform.getProperties(); } + @Override public int getUsbVendorId() { return mVendorId; } + @Override public boolean canRunOn(IAndroidTarget target) { // basic test if (target == this) { @@ -326,6 +357,7 @@ final class AddOnTarget implements IAndroidTarget { } + @Override public String hashString() { return String.format(ADD_ON_FORMAT, mVendor, mName, mBasePlatform.getVersion().getApiString()); @@ -354,6 +386,7 @@ final class AddOnTarget implements IAndroidTarget { * (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ + @Override public int compareTo(IAndroidTarget target) { // quick check. if (this == target) { diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java index 903e1ad..996aee4 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java @@ -259,6 +259,7 @@ public final class AndroidVersion implements Comparable<AndroidVersion> { * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ + @Override public int compareTo(AndroidVersion o) { return compareTo(o.mApiLevel, o.mCodename); } diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java index fb4813b..09f49e2 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java @@ -29,14 +29,17 @@ public class NullSdkLog implements ISdkLog { return sThis; } + @Override public void error(Throwable t, String errorFormat, Object... args) { // ignore } + @Override public void printf(String msgFormat, Object... args) { // ignore } + @Override public void warning(String warningFormat, Object... args) { // ignore } diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java index 3db0d89..02688c0 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java @@ -139,6 +139,7 @@ final class PlatformTarget implements IAndroidTarget { return mLayoutlibVersion; } + @Override public ISystemImage getSystemImage(String abiType) { for (ISystemImage sysImg : mSystemImages) { if (sysImg.getAbiType().equals(abiType)) { @@ -148,10 +149,12 @@ final class PlatformTarget implements IAndroidTarget { return null; } + @Override public ISystemImage[] getSystemImages() { return mSystemImages; } + @Override public String getLocation() { return mRootFolderOsPath; } @@ -163,22 +166,27 @@ final class PlatformTarget implements IAndroidTarget { * * @see com.android.sdklib.IAndroidTarget#getVendor() */ + @Override public String getVendor() { return PLATFORM_VENDOR; } + @Override public String getName() { return mName; } + @Override public String getFullName() { return mName; } + @Override public String getClasspathName() { return mName; } + @Override public String getShortClasspathName() { return mName; } @@ -190,30 +198,37 @@ final class PlatformTarget implements IAndroidTarget { * * @see com.android.sdklib.IAndroidTarget#getDescription() */ + @Override public String getDescription() { return String.format("Standard Android platform %s", mVersionName); } + @Override public AndroidVersion getVersion() { return mVersion; } + @Override public String getVersionName() { return mVersionName; } + @Override public int getRevision() { return mRevision; } + @Override public boolean isPlatform() { return true; } + @Override public IAndroidTarget getParent() { return null; } + @Override public String getPath(int pathId) { return mPaths.get(pathId); } @@ -221,15 +236,18 @@ final class PlatformTarget implements IAndroidTarget { /** * Returns whether the target is able to render layouts. This is always true for platforms. */ + @Override public boolean hasRenderingLibrary() { return true; } + @Override public String[] getSkins() { return mSkins; } + @Override public String getDefaultSkin() { // only one skin? easy. if (mSkins.length == 1) { @@ -257,6 +275,7 @@ final class PlatformTarget implements IAndroidTarget { * {@inheritDoc} * @see com.android.sdklib.IAndroidTarget#getOptionalLibraries() */ + @Override public IOptionalLibrary[] getOptionalLibraries() { return null; } @@ -267,6 +286,7 @@ final class PlatformTarget implements IAndroidTarget { * TODO change the fixed library list to be build-dependent later. * {@inheritDoc} */ + @Override public String[] getPlatformLibraries() { return new String[] { SdkConstants.ANDROID_TEST_RUNNER_LIB }; } @@ -275,10 +295,12 @@ final class PlatformTarget implements IAndroidTarget { * The platform has no USB Vendor Id: always return {@link IAndroidTarget#NO_USB_ID}. * {@inheritDoc} */ + @Override public int getUsbVendorId() { return NO_USB_ID; } + @Override public boolean canRunOn(IAndroidTarget target) { // basic test if (target == this) { @@ -296,6 +318,7 @@ final class PlatformTarget implements IAndroidTarget { return target.getVersion().getApiLevel() >= mVersion.getApiLevel(); } + @Override public String hashString() { return String.format(PLATFORM_HASH, mVersion.getApiString()); } @@ -322,6 +345,7 @@ final class PlatformTarget implements IAndroidTarget { * (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ + @Override public int compareTo(IAndroidTarget target) { // quick check. if (this == target) { @@ -357,10 +381,12 @@ final class PlatformTarget implements IAndroidTarget { getRevision()); } + @Override public String getProperty(String name) { return mProperties.get(name); } + @Override public Integer getProperty(String name, Integer defaultValue) { try { String value = getProperty(name); @@ -374,6 +400,7 @@ final class PlatformTarget implements IAndroidTarget { return defaultValue; } + @Override public Boolean getProperty(String name, Boolean defaultValue) { String value = getProperty(name); if (value != null) { @@ -383,6 +410,7 @@ final class PlatformTarget implements IAndroidTarget { return defaultValue; } + @Override public Map<String, String> getProperties() { return mProperties; // mProperties is unmodifiable. } diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java index eab2dbe..df3defc 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java @@ -111,6 +111,7 @@ public class SdkManager { return mRevision; } + @Override public int compareTo(LayoutlibVersion rhs) { boolean useRev = this.mRevision > NOT_SPECIFIED && rhs.mRevision > NOT_SPECIFIED; int lhsValue = (this.mApi << 16) + (useRev ? this.mRevision : 0); diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java index 71ce0ad..5b1e237 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java @@ -26,6 +26,7 @@ package com.android.sdklib; */ public class StdSdkLog implements ISdkLog { + @Override public void error(Throwable t, String errorFormat, Object... args) { if (errorFormat != null) { String msg = String.format("Error: " + errorFormat, args); @@ -48,6 +49,7 @@ public class StdSdkLog implements ISdkLog { } } + @Override public void warning(String warningFormat, Object... args) { String msg = String.format("Warning: " + warningFormat, args); @@ -65,6 +67,7 @@ public class StdSdkLog implements ISdkLog { } } + @Override public void printf(String msgFormat, Object... args) { String msg = String.format(msgFormat, args); diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java index 2188329..422ae90 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java @@ -121,11 +121,13 @@ public class SystemImage implements ISystemImage { } /** Returns the actual location of an installed system image. */ + @Override public File getLocation() { return mLocation; } /** Indicates the location strategy for this system image in the SDK. */ + @Override public LocationType getLocationType() { return mLocationtype; } @@ -135,10 +137,12 @@ public class SystemImage implements ISystemImage { * {@link SdkConstants#ABI_ARMEABI_V7A} or {@link SdkConstants#ABI_INTEL_ATOM}. * Cannot be null nor empty. */ + @Override public String getAbiType() { return mAbiType; } + @Override public int compareTo(ISystemImage other) { // Sort by ABI name only. This is what matters from a user point of view. return this.getAbiType().compareToIgnoreCase(other.getAbiType()); diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java index 774d9f4..5c95b81 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java @@ -18,9 +18,9 @@ package com.android.sdklib.build; import com.android.sdklib.SdkConstants; import com.android.sdklib.internal.build.DebugKeyProvider; -import com.android.sdklib.internal.build.SignedJarBuilder; import com.android.sdklib.internal.build.DebugKeyProvider.IKeyGenOutput; import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException; +import com.android.sdklib.internal.build.SignedJarBuilder; import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter; import java.io.File; @@ -63,6 +63,7 @@ public final class ApkBuilder implements IArchiveBuilder { mInputFile = inputFile; } + @Override public boolean checkEntry(String archivePath) throws ZipAbortException { verbosePrintln("=> %s", archivePath); @@ -88,6 +89,7 @@ public final class ApkBuilder implements IArchiveBuilder { private boolean mNativeLibsConflict = false; private File mInputFile; + @Override public boolean checkEntry(String archivePath) throws ZipAbortException { // split the path into segments. String[] segments = archivePath.split("/"); @@ -193,10 +195,12 @@ public final class ApkBuilder implements IArchiveBuilder { mNativeLibsConflict = nativeLibsConflict; } + @Override public List<String> getNativeLibs() { return mLibs; } + @Override public boolean hasNativeLibsConflicts() { return mNativeLibsConflict; } @@ -251,10 +255,12 @@ public final class ApkBuilder implements IArchiveBuilder { IKeyGenOutput keygenOutput = null; if (verboseStream != null) { keygenOutput = new IKeyGenOutput() { + @Override public void out(String message) { verboseStream.println(message); } + @Override public void err(String message) { verboseStream.println(message); } @@ -482,6 +488,7 @@ public final class ApkBuilder implements IArchiveBuilder { * @throws DuplicateFileException if a file conflicts with another already added to the APK * at the same location inside the APK archive. */ + @Override public void addFile(File file, String archivePath) throws ApkCreationException, SealedApkException, DuplicateFileException { if (mIsSealed) { diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java index 0004153..805b74a 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java @@ -143,6 +143,7 @@ public final class ApkBuilderMain { for (File jarFile : jarFiles) { if (jarFile.isDirectory()) { String[] filenames = jarFile.list(new FilenameFilter() { + @Override public boolean accept(File dir, String name) { return PATTERN_JAR_EXT.matcher(name).matches(); } diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java index 0b9a261..78c069a 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java @@ -288,6 +288,7 @@ public final class AvdInfo implements Comparable<AvdInfo> { * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ + @Override public int compareTo(AvdInfo o) { // first handle possible missing targets (if the AVD failed to load for unresolved targets) if (mTarget == null && o != null && o.mTarget == null) { diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java index ac899c4..f6610c0 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java @@ -899,6 +899,7 @@ public class AvdManager { if (folder.isDirectory()) { String[] list = folder.list(new FilenameFilter() { + @Override public boolean accept(File dir, String name) { return IMAGE_NAME_PATTERN.matcher(name).matches(); } @@ -1217,6 +1218,7 @@ public class AvdManager { } File[] avds = folder.listFiles(new FilenameFilter() { + @Override public boolean accept(File parent, String name) { if (INI_NAME_PATTERN.matcher(name).matches()) { // check it's a file and not a folder diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java index 385bd73..09bf3c9 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java @@ -20,9 +20,9 @@ import com.android.annotations.VisibleForTesting; import com.android.annotations.VisibleForTesting.Visibility;
import com.android.sdklib.AndroidVersion;
import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SdkManager;
-import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
import com.android.sdklib.internal.repository.Archive.Arch;
import com.android.sdklib.internal.repository.Archive.Os;
import com.android.sdklib.repository.PkgProps;
@@ -218,6 +218,7 @@ public class AddonPackage extends Package archiveOsPath);
}
+ @Override
public int getExactApiLevel() {
return mVersion.getApiLevel();
}
@@ -287,6 +288,7 @@ public class AddonPackage extends Package * <p/>
* An add-on has the same {@link AndroidVersion} as the platform it depends on.
*/
+ @Override
public AndroidVersion getVersion() {
return mVersion;
}
@@ -308,6 +310,7 @@ public class AddonPackage extends Package *
* @since sdk-addon-2.xsd
*/
+ @Override
public Pair<Integer, Integer> getLayoutlibVersion() {
return mLayoutlibVersion.getLayoutlibVersion();
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java index 62cc9a4..919a30e 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java @@ -260,12 +260,15 @@ public class AddonsListFetcher { // We don't want the default handler which prints errors to stderr.
builder.setErrorHandler(new ErrorHandler() {
+ @Override
public void warning(SAXParseException e) throws SAXException {
// pass
}
+ @Override
public void fatalError(SAXParseException e) throws SAXException {
throw e;
}
+ @Override
public void error(SAXParseException e) throws SAXException {
throw e;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java index f56d202..52d9221 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Archive.java @@ -343,6 +343,7 @@ public class Archive implements IDescription, Comparable<Archive> { /**
* Generates a short description for this archive.
*/
+ @Override
public String getShortDescription() {
return String.format("Archive for %1$s", getOsDescription());
}
@@ -350,6 +351,7 @@ public class Archive implements IDescription, Comparable<Archive> { /**
* Generates a longer description for this archive.
*/
+ @Override
public String getLongDescription() {
long size = getSize();
String sizeStr;
@@ -390,6 +392,7 @@ public class Archive implements IDescription, Comparable<Archive> { *
* @see Package#compareTo(Package)
*/
+ @Override
public int compareTo(Archive rhs) {
if (mPackage != null && rhs != null) {
return mPackage.compareTo(rhs.getParentPackage());
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ArchiveReplacement.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ArchiveReplacement.java index 8ac0188..6dcd9bb 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ArchiveReplacement.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ArchiveReplacement.java @@ -16,9 +16,6 @@ package com.android.sdklib.internal.repository;
-import com.android.sdklib.internal.repository.Archive;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.Package;
/**
* Represents an archive that we want to install and the archive that it is
@@ -66,6 +63,7 @@ public class ArchiveReplacement implements IDescription { * Returns the long description of the parent package of the new archive, if not null.
* Otherwise returns an empty string.
*/
+ @Override
public String getLongDescription() {
if (mNewArchive != null) {
Package p = mNewArchive.getParentPackage();
@@ -80,6 +78,7 @@ public class ArchiveReplacement implements IDescription { * Returns the short description of the parent package of the new archive, if not null.
* Otherwise returns an empty string.
*/
+ @Override
public String getShortDescription() {
if (mNewArchive != null) {
Package p = mNewArchive.getParentPackage();
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/BrokenPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/BrokenPackage.java index a8236ea..3e6b2e9 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/BrokenPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/BrokenPackage.java @@ -89,6 +89,7 @@ public class BrokenPackage extends Package * Returns the minimal API level required by this package, if > 0,
* or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
*/
+ @Override
public int getMinApiLevel() {
return mMinApiLevel;
}
@@ -97,6 +98,7 @@ public class BrokenPackage extends Package * Returns the exact API level required by this package, if > 0,
* or {@link #API_LEVEL_INVALID} if the value was missing.
*/
+ @Override
public int getExactApiLevel() {
return mExactApiLevel;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java index ee24d6e..a64d151 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java @@ -121,6 +121,7 @@ public class DocPackage extends Package implements IPackageVersion { * Returns the version, for platform, add-on and doc packages.
* Can be 0 if this is a local package of unknown api-level.
*/
+ @Override
public AndroidVersion getVersion() {
return mVersion;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java index 698861a..4bcaa6d 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java @@ -254,6 +254,7 @@ public class ExtraPackage extends MinToolsPackage * Returns the minimal API level required by this extra package, if > 0,
* or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
*/
+ @Override
public int getMinApiLevel() {
return mMinApiLevel;
}
@@ -381,7 +382,7 @@ public class ExtraPackage extends MinToolsPackage if (name != null) {
name = name.replaceAll("[ _\t\f-]+", " ").trim(); //$NON-NLS-1$ //$NON-NLS-2$
}
- if (name == null || name.length() == 0) { //$NON-NLS-1$
+ if (name == null || name.length() == 0) {
name = "Unkown Extra";
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LayoutlibVersionMixin.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LayoutlibVersionMixin.java index 6cbf789..eb819d7 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LayoutlibVersionMixin.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LayoutlibVersionMixin.java @@ -95,6 +95,7 @@ public class LayoutlibVersionMixin implements ILayoutlibVersion { *
* @since sdk-repository-4.xsd and sdk-addon-2.xsd
*/
+ @Override
public Pair<Integer, Integer> getLayoutlibVersion() {
return mLayoutlibVersion;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/MinToolsPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/MinToolsPackage.java index 351a421..9a9f416 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/MinToolsPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/MinToolsPackage.java @@ -87,6 +87,7 @@ public abstract class MinToolsPackage extends Package implements IMinToolsDepend * The minimal revision of the tools package required by this extra package, if > 0,
* or {@link #MIN_TOOLS_REV_NOT_SPECIFIED} if there is no such requirement.
*/
+ @Override
public int getMinToolsRevision() {
return mMinToolsRevision;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java index 55049ca..ac40f57 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java @@ -45,68 +45,83 @@ public class NullTaskMonitor implements ITaskMonitor { mLog = log;
}
+ @Override
public void setDescription(String format, Object...args) {
// pass
}
+ @Override
public void log(String format, Object...args) {
mLog.printf(format, args);
}
+ @Override
public void logError(String format, Object...args) {
mLog.error(null /*throwable*/, format, args);
}
+ @Override
public void logVerbose(String format, Object...args) {
mLog.printf(format, args);
}
+ @Override
public void setProgressMax(int max) {
// pass
}
+ @Override
public int getProgressMax() {
return 0;
}
+ @Override
public void incProgress(int delta) {
// pass
}
/** Always return 1. */
+ @Override
public int getProgress() {
return 1;
}
/** Always return false. */
+ @Override
public boolean isCancelRequested() {
return false;
}
+ @Override
public ITaskMonitor createSubMonitor(int tickCount) {
return this;
}
/** Always return false. */
+ @Override
public boolean displayPrompt(final String title, final String message) {
return false;
}
/** Always return null. */
+ @Override
public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
return null;
}
// --- ISdkLog ---
+ @Override
public void error(Throwable t, String errorFormat, Object... args) {
mLog.error(t, errorFormat, args);
}
+ @Override
public void warning(String warningFormat, Object... args) {
mLog.warning(warningFormat, args);
}
+ @Override
public void printf(String msgFormat, Object... args) {
mLog.printf(msgFormat, args);
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java index 01f713a..2091cb7 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/Package.java @@ -447,12 +447,14 @@ public abstract class Package implements IDescription, Comparable<Package> { * Returns a short description for an {@link IDescription}.
* Can be empty but not null.
*/
+ @Override
public abstract String getShortDescription();
/**
* Returns a long description for an {@link IDescription}.
* Can be empty but not null.
*/
+ @Override
public String getLongDescription() {
StringBuilder sb = new StringBuilder();
@@ -622,6 +624,7 @@ public abstract class Package implements IDescription, Comparable<Package> { * <em>Important</em>: Derived classes should consider overriding {@link #comparisonKey()}
* instead of this method.
*/
+ @Override
public int compareTo(Package other) {
String s1 = this.comparisonKey();
String s2 = other.comparisonKey();
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/PlatformPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/PlatformPackage.java index 270007e..937a4b4 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/PlatformPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/PlatformPackage.java @@ -142,6 +142,7 @@ public class PlatformPackage extends MinToolsPackage implements IPackageVersion, }
/** Returns the package version, for platform, add-on and doc packages. */
+ @Override
public AndroidVersion getVersion() {
return mVersion;
}
@@ -168,6 +169,7 @@ public class PlatformPackage extends MinToolsPackage implements IPackageVersion, *
* @since sdk-repository-4.xsd
*/
+ @Override
public Pair<Integer, Integer> getLayoutlibVersion() {
return mLayoutlibVersion.getLayoutlibVersion();
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SamplePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SamplePackage.java index 002561e..0462a9d 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SamplePackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SamplePackage.java @@ -17,10 +17,10 @@ package com.android.sdklib.internal.repository;
import com.android.sdklib.AndroidVersion;
+import com.android.sdklib.AndroidVersion.AndroidVersionException;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SdkManager;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
import com.android.sdklib.internal.repository.Archive.Arch;
import com.android.sdklib.internal.repository.Archive.Os;
import com.android.sdklib.repository.PkgProps;
@@ -169,11 +169,13 @@ public class SamplePackage extends MinToolsPackage * Returns the minimal API level required by this extra package, if > 0,
* or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
*/
+ @Override
public int getMinApiLevel() {
return mMinApiLevel;
}
/** Returns the matching platform version. */
+ @Override
public AndroidVersion getVersion() {
return mVersion;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java index 112cf49..f757bfb 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSource.java @@ -164,6 +164,7 @@ public abstract class SdkSource implements IDescription, Comparable<SdkSource> { * Implementation of the {@link Comparable} interface.
* Simply compares the URL using the string's default ordering.
*/
+ @Override
public int compareTo(SdkSource rhs) {
return this.getUrl().compareTo(rhs.getUrl());
}
@@ -222,6 +223,7 @@ public abstract class SdkSource implements IDescription, Comparable<SdkSource> { return super.toString();
}
+ @Override
public String getShortDescription() {
if (mUiName != null && mUiName.length() > 0) {
@@ -240,6 +242,7 @@ public abstract class SdkSource implements IDescription, Comparable<SdkSource> { return mUrl;
}
+ @Override
public String getLongDescription() {
// Note: in a normal workflow, mDescription is filled by setDefaultDescription().
// However for packages made by unit tests or such, this can be null.
@@ -664,12 +667,15 @@ public abstract class SdkSource implements IDescription, Comparable<SdkSource> { // We don't want the default handler which prints errors to stderr.
builder.setErrorHandler(new ErrorHandler() {
+ @Override
public void warning(SAXParseException e) throws SAXException {
// pass
}
+ @Override
public void fatalError(SAXParseException e) throws SAXException {
throw e;
}
+ @Override
public void error(SAXParseException e) throws SAXException {
throw e;
}
@@ -761,12 +767,15 @@ public abstract class SdkSource implements IDescription, Comparable<SdkSource> { // We don't want the default handler, which by default dumps errors to stderr.
validator.setErrorHandler(new ErrorHandler() {
+ @Override
public void warning(SAXParseException e) throws SAXException {
// pass
}
+ @Override
public void fatalError(SAXParseException e) throws SAXException {
throw e;
}
+ @Override
public void error(SAXParseException e) throws SAXException {
throw e;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSourceCategory.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSourceCategory.java index 3afa086..546e991 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSourceCategory.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkSourceCategory.java @@ -75,10 +75,12 @@ public enum SdkSourceCategory implements IDescription { return mAlwaysDisplay;
}
+ @Override
public String getLongDescription() {
return getUiName();
}
+ @Override
public String getShortDescription() {
return getUiName();
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SourcePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SourcePackage.java index c33d949..ad92294 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SourcePackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SourcePackage.java @@ -19,9 +19,9 @@ package com.android.sdklib.internal.repository; import com.android.annotations.VisibleForTesting;
import com.android.annotations.VisibleForTesting.Visibility;
import com.android.sdklib.AndroidVersion;
+import com.android.sdklib.AndroidVersion.AndroidVersionException;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SdkManager;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
import com.android.sdklib.internal.repository.Archive.Arch;
import com.android.sdklib.internal.repository.Archive.Os;
import com.android.sdklib.repository.SdkRepoConstants;
@@ -177,6 +177,7 @@ public class SourcePackage extends Package implements IPackageVersion { /**
* Returns the android version of this package.
*/
+ @Override
public AndroidVersion getVersion() {
return mVersion;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java index 877a1d1..5457a35 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java @@ -19,10 +19,10 @@ package com.android.sdklib.internal.repository; import com.android.annotations.VisibleForTesting;
import com.android.annotations.VisibleForTesting.Visibility;
import com.android.sdklib.AndroidVersion;
+import com.android.sdklib.AndroidVersion.AndroidVersionException;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SdkManager;
import com.android.sdklib.SystemImage;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
import com.android.sdklib.internal.repository.Archive.Arch;
import com.android.sdklib.internal.repository.Archive.Os;
import com.android.sdklib.repository.PkgProps;
@@ -212,6 +212,7 @@ public class SystemImagePackage extends Package * <p/>
* A system-image has the same {@link AndroidVersion} as the platform it depends on.
*/
+ @Override
public AndroidVersion getVersion() {
return mVersion;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ToolPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ToolPackage.java index 8670378..ee7265f 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ToolPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ToolPackage.java @@ -150,6 +150,7 @@ public class ToolPackage extends Package implements IMinPlatformToolsDependency * <p/>
* This attribute is mandatory and should not be normally missing.
*/
+ @Override
public int getMinPlatformToolsRevision() {
return mMinPlatformToolsRevision;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java index efab4ad..9f8d600 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java @@ -91,6 +91,7 @@ public class FileOp implements IFileOp { * Files that cannot be deleted right away are marked for deletion on exit.
* The argument can be null.
*/
+ @Override
public void deleteFileOrFolder(File fileOrFolder) {
if (fileOrFolder != null) {
if (isDirectory(fileOrFolder)) {
@@ -147,6 +148,7 @@ public class FileOp implements IFileOp { * @param file The file to set permissions on.
* @throws IOException If an I/O error occurs
*/
+ @Override
public void setExecutablePermission(File file) throws IOException {
if (sFileSetExecutable != null) {
@@ -175,6 +177,7 @@ public class FileOp implements IFileOp { * @throws FileNotFoundException if the source file doesn't exist.
* @throws IOException if there's a problem reading or writing the file.
*/
+ @Override
public void copyFile(File source, File dest) throws IOException {
byte[] buffer = new byte[8192];
@@ -215,6 +218,7 @@ public class FileOp implements IFileOp { * @throws FileNotFoundException if the source files don't exist.
* @throws IOException if there's a problem reading the files.
*/
+ @Override
public boolean isSameFile(File source, File destination) throws IOException {
if (source.length() != destination.length()) {
@@ -270,21 +274,25 @@ public class FileOp implements IFileOp { }
/** Invokes {@link File#isFile()} on the given {@code file}. */
+ @Override
public boolean isFile(File file) {
return file.isFile();
}
/** Invokes {@link File#isDirectory()} on the given {@code file}. */
+ @Override
public boolean isDirectory(File file) {
return file.isDirectory();
}
/** Invokes {@link File#exists()} on the given {@code file}. */
+ @Override
public boolean exists(File file) {
return file.exists();
}
/** Invokes {@link File#length()} on the given {@code file}. */
+ @Override
public long length(File file) {
return file.length();
}
@@ -293,26 +301,31 @@ public class FileOp implements IFileOp { * Invokes {@link File#delete()} on the given {@code file}.
* Note: for a recursive folder version, consider {@link #deleteFileOrFolder(File)}.
*/
+ @Override
public boolean delete(File file) {
return file.delete();
}
/** Invokes {@link File#mkdirs()} on the given {@code file}. */
+ @Override
public boolean mkdirs(File file) {
return file.mkdirs();
}
/** Invokes {@link File#listFiles()} on the given {@code file}. */
+ @Override
public File[] listFiles(File file) {
return file.listFiles();
}
/** Invokes {@link File#renameTo(File)} on the given files. */
+ @Override
public boolean renameTo(File oldFile, File newFile) {
return oldFile.renameTo(newFile);
}
/** Creates a new {@link FileOutputStream} for the given {@code file}. */
+ @Override
public OutputStream newFileOutputStream(File file) throws FileNotFoundException {
return new FileOutputStream(file);
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/xml/AndroidXPathFactory.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/xml/AndroidXPathFactory.java index 641cd81..8373d8a 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/xml/AndroidXPathFactory.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/xml/AndroidXPathFactory.java @@ -60,6 +60,7 @@ public class AndroidXPathFactory { mAndroidPrefixes.add(mAndroidPrefix); } + @Override public String getNamespaceURI(String prefix) { if (prefix != null) { if (prefix.equals(mAndroidPrefix)) { @@ -70,6 +71,7 @@ public class AndroidXPathFactory { return XMLConstants.NULL_NS_URI; } + @Override public String getPrefix(String namespaceURI) { if (SdkConstants.NS_RESOURCES.equals(namespaceURI)) { return mAndroidPrefix; @@ -78,6 +80,7 @@ public class AndroidXPathFactory { return null; } + @Override public Iterator<?> getPrefixes(String namespaceURI) { if (SdkConstants.NS_RESOURCES.equals(namespaceURI)) { return mAndroidPrefixes.iterator(); diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java index f680909..ead66ee 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java @@ -105,10 +105,12 @@ public class DebugKeyProviderTest extends TestCase { private String mOut = ""; //$NON-NLS-1$ private String mErr = ""; //$NON-NLS-1$ + @Override public void out(String message) { mOut += message + "\n"; //$NON-NLS-1$ } + @Override public void err(String message) { mErr += message + "\n"; //$NON-NLS-1$ } diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java index 3b742ac..cdf7bcc 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java @@ -19,9 +19,9 @@ package com.android.sdklib.internal.repository; import com.android.sdklib.AndroidVersion;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.ISystemImage;
+import com.android.sdklib.ISystemImage.LocationType;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SystemImage;
-import com.android.sdklib.ISystemImage.LocationType;
import com.android.sdklib.io.FileOp;
import java.util.Map;
@@ -80,26 +80,32 @@ public class MockAddonPackage extends AddonPackage { mRevision = revision;
}
+ @Override
public String getClasspathName() {
return getName();
}
+ @Override
public String getShortClasspathName() {
return getName();
}
+ @Override
public String getDefaultSkin() {
return null;
}
+ @Override
public String getDescription() {
return getName();
}
+ @Override
public String getFullName() {
return getName();
}
+ @Override
public ISystemImage[] getSystemImages() {
if (mSystemImages == null) {
SystemImage si = new SystemImage(
@@ -111,6 +117,7 @@ public class MockAddonPackage extends AddonPackage { return mSystemImages;
}
+ @Override
public ISystemImage getSystemImage(String abiType) {
if (SdkConstants.ABI_ARMEABI.equals(abiType)) {
return getSystemImages()[0];
@@ -118,87 +125,108 @@ public class MockAddonPackage extends AddonPackage { return null;
}
+ @Override
public String getLocation() {
return "/sdk/add-ons/addon-" + mName;
}
+ @Override
public IOptionalLibrary[] getOptionalLibraries() {
return null;
}
+ @Override
public IAndroidTarget getParent() {
return mParentTarget;
}
+ @Override
public String getPath(int pathId) {
throw new UnsupportedOperationException("Implement this as needed for tests");
}
+ @Override
public String[] getPlatformLibraries() {
return null;
}
+ @Override
public String getProperty(String name) {
return null;
}
+ @Override
public Integer getProperty(String name, Integer defaultValue) {
return defaultValue;
}
+ @Override
public Boolean getProperty(String name, Boolean defaultValue) {
return defaultValue;
}
+ @Override
public Map<String, String> getProperties() {
return null;
}
+ @Override
public int getRevision() {
return mRevision;
}
+ @Override
public String[] getSkins() {
return null;
}
+ @Override
public int getUsbVendorId() {
return 0;
}
+ @Override
public AndroidVersion getVersion() {
return mParentTarget.getVersion();
}
+ @Override
public String getName() {
return mName;
}
+ @Override
public String getVendor() {
return mParentTarget.getVendor();
}
+ @Override
public String getVersionName() {
return String.format("mock-addon-%1$d", getVersion().getApiLevel());
}
+ @Override
public String hashString() {
return getVersionName();
}
/** Returns false for an addon. */
+ @Override
public boolean isPlatform() {
return false;
}
+ @Override
public boolean canRunOn(IAndroidTarget target) {
throw new UnsupportedOperationException("Implement this as needed for tests");
}
+ @Override
public int compareTo(IAndroidTarget o) {
throw new UnsupportedOperationException("Implement this as needed for tests");
}
+ @Override
public boolean hasRenderingLibrary() {
return false;
}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java index 30c03bc..42ba916 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java @@ -44,57 +44,72 @@ public class MockMonitor implements ITaskMonitor { return mCapturedDescriptions;
}
+ @Override
public void log(String format, Object... args) {
mCapturedLog += String.format(format, args) + "\n"; //$NON-NLS-1$
}
+ @Override
public void logError(String format, Object... args) {
mCapturedErrorLog += String.format(format, args) + "\n"; //$NON-NLS-1$
}
+ @Override
public void logVerbose(String format, Object... args) {
mCapturedVerboseLog += String.format(format, args) + "\n"; //$NON-NLS-1$
}
+ @Override
public void setProgressMax(int max) {
}
+ @Override
public int getProgressMax() {
return 0;
}
+ @Override
public void setDescription(String format, Object... args) {
mCapturedDescriptions += String.format(format, args) + "\n"; //$NON-NLS-1$
}
+ @Override
public boolean isCancelRequested() {
return false;
}
+ @Override
public void incProgress(int delta) {
}
+ @Override
public int getProgress() {
return 0;
}
+ @Override
public boolean displayPrompt(String title, String message) {
return false;
}
+ @Override
public ITaskMonitor createSubMonitor(int tickCount) {
return null;
}
+ @Override
public void error(Throwable t, String errorFormat, Object... args) {
}
+ @Override
public void printf(String msgFormat, Object... args) {
}
+ @Override
public void warning(String warningFormat, Object... args) {
}
+ @Override
public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
return null;
}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java index 28026ed..903a276 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java @@ -19,9 +19,9 @@ package com.android.sdklib.internal.repository; import com.android.sdklib.AndroidVersion;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.ISystemImage;
+import com.android.sdklib.ISystemImage.LocationType;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.SystemImage;
-import com.android.sdklib.ISystemImage.LocationType;
import com.android.sdklib.io.FileOp;
import java.util.Map;
@@ -41,26 +41,32 @@ class MockPlatformTarget implements IAndroidTarget { mRevision = revision;
}
+ @Override
public String getClasspathName() {
return getName();
}
+ @Override
public String getShortClasspathName() {
return getName();
}
+ @Override
public String getDefaultSkin() {
return null;
}
+ @Override
public String getDescription() {
return getName();
}
+ @Override
public String getFullName() {
return getName();
}
+ @Override
public ISystemImage[] getSystemImages() {
if (mSystemImages == null) {
SystemImage si = new SystemImage(
@@ -72,6 +78,7 @@ class MockPlatformTarget implements IAndroidTarget { return mSystemImages;
}
+ @Override
public ISystemImage getSystemImage(String abiType) {
if (SdkConstants.ABI_ARMEABI.equals(abiType)) {
return getSystemImages()[0];
@@ -79,50 +86,62 @@ class MockPlatformTarget implements IAndroidTarget { return null;
}
+ @Override
public String getLocation() {
return "/sdk/platforms/android-" + getVersion().getApiString();
}
+ @Override
public IOptionalLibrary[] getOptionalLibraries() {
return null;
}
+ @Override
public IAndroidTarget getParent() {
return null;
}
+ @Override
public String getPath(int pathId) {
throw new UnsupportedOperationException("Implement this as needed for tests");
}
+ @Override
public String[] getPlatformLibraries() {
return null;
}
+ @Override
public String getProperty(String name) {
return null;
}
+ @Override
public Integer getProperty(String name, Integer defaultValue) {
return defaultValue;
}
+ @Override
public Boolean getProperty(String name, Boolean defaultValue) {
return defaultValue;
}
+ @Override
public Map<String, String> getProperties() {
return null;
}
+ @Override
public int getRevision() {
return mRevision;
}
+ @Override
public String[] getSkins() {
return null;
}
+ @Override
public int getUsbVendorId() {
return 0;
}
@@ -132,6 +151,7 @@ class MockPlatformTarget implements IAndroidTarget { * This works well in Unit Tests where we'll typically have different
* platforms as unique identifiers.
*/
+ @Override
public String getVendor() {
return "vendor " + Integer.toString(mApiLevel);
}
@@ -139,35 +159,43 @@ class MockPlatformTarget implements IAndroidTarget { /**
* Create a synthetic name using the target API level.
*/
+ @Override
public String getName() {
return "platform r" + Integer.toString(mApiLevel);
}
+ @Override
public AndroidVersion getVersion() {
return new AndroidVersion(mApiLevel, null /*codename*/);
}
+ @Override
public String getVersionName() {
return String.format("android-%1$d", mApiLevel);
}
+ @Override
public String hashString() {
return getVersionName();
}
/** Returns true for a platform. */
+ @Override
public boolean isPlatform() {
return true;
}
+ @Override
public boolean canRunOn(IAndroidTarget target) {
throw new UnsupportedOperationException("Implement this as needed for tests");
}
+ @Override
public int compareTo(IAndroidTarget o) {
throw new UnsupportedOperationException("Implement this as needed for tests");
}
+ @Override
public boolean hasRenderingLibrary() {
return false;
}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java index 564dfed..bd784e4 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java @@ -57,14 +57,17 @@ public class SdkRepoSourceTest extends TestCase { final StringBuilder output = new StringBuilder();
Document doc = super.findAlternateToolsXml(xml, new ErrorHandler() {
+ @Override
public void warning(SAXParseException exception) throws SAXException {
output.append("WARN: " + exception.getMessage()).append('\n');
}
+ @Override
public void fatalError(SAXParseException exception) throws SAXException {
output.append("FATAL: " + exception.getMessage()).append('\n');
}
+ @Override
public void error(SAXParseException exception) throws SAXException {
output.append("ERROR: " + exception.getMessage()).append('\n');
}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java index 7e2e94c..c4d4254 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java @@ -151,6 +151,7 @@ public class MockFileOp implements IFileOp { * Files that cannot be deleted right away are marked for deletion on exit.
* The argument can be null.
*/
+ @Override
public void deleteFileOrFolder(File fileOrFolder) {
if (fileOrFolder != null) {
if (isDirectory(fileOrFolder)) {
@@ -176,6 +177,7 @@ public class MockFileOp implements IFileOp { * @param file The file to set permissions on.
* @throws IOException If an I/O error occurs
*/
+ @Override
public void setExecutablePermission(File file) throws IOException {
// pass
}
@@ -188,6 +190,7 @@ public class MockFileOp implements IFileOp { * @throws FileNotFoundException if the source file doesn't exist.
* @throws IOException if there's a problem reading or writing the file.
*/
+ @Override
public void copyFile(File source, File dest) throws IOException {
// pass
}
@@ -200,17 +203,20 @@ public class MockFileOp implements IFileOp { * @throws FileNotFoundException if the source files don't exist.
* @throws IOException if there's a problem reading the files.
*/
+ @Override
public boolean isSameFile(File source, File destination) throws IOException {
throw new UnsupportedOperationException("MockFileUtils.isSameFile is not supported."); //$NON-NLS-1$
}
/** Invokes {@link File#isFile()} on the given {@code file}. */
+ @Override
public boolean isFile(File file) {
String path = getAgnosticAbsPath(file);
return mExistinfFiles.contains(path);
}
/** Invokes {@link File#isDirectory()} on the given {@code file}. */
+ @Override
public boolean isDirectory(File file) {
String path = getAgnosticAbsPath(file);
if (mExistinfFolders.contains(path)) {
@@ -238,15 +244,18 @@ public class MockFileOp implements IFileOp { }
/** Invokes {@link File#exists()} on the given {@code file}. */
+ @Override
public boolean exists(File file) {
return isFile(file) || isDirectory(file);
}
/** Invokes {@link File#length()} on the given {@code file}. */
+ @Override
public long length(File file) {
throw new UnsupportedOperationException("MockFileUtils.length is not supported."); //$NON-NLS-1$
}
+ @Override
public boolean delete(File file) {
String path = getAgnosticAbsPath(file);
@@ -276,6 +285,7 @@ public class MockFileOp implements IFileOp { }
/** Invokes {@link File#mkdirs()} on the given {@code file}. */
+ @Override
public boolean mkdirs(File file) {
for (; file != null; file = file.getParentFile()) {
String path = getAgnosticAbsPath(file);
@@ -288,6 +298,7 @@ public class MockFileOp implements IFileOp { * Invokes {@link File#listFiles()} on the given {@code file}.
* The returned list is sorted by alphabetic absolute path string.
*/
+ @Override
public File[] listFiles(File file) {
TreeSet<File> files = new TreeSet<File>();
@@ -310,6 +321,7 @@ public class MockFileOp implements IFileOp { }
/** Invokes {@link File#renameTo(File)} on the given files. */
+ @Override
public boolean renameTo(File oldFile, File newFile) {
boolean renamed = false;
@@ -352,6 +364,7 @@ public class MockFileOp implements IFileOp { * Returns an OutputStream that will capture the bytes written and associate
* them with the given file.
*/
+ @Override
public OutputStream newFileOutputStream(File file) throws FileNotFoundException {
StringOutputStream os = new StringOutputStream(file);
mOutputStreams.add(os);
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java index 3ef0140..937a648 100644 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java @@ -33,14 +33,17 @@ public class MockLog implements ISdkLog { mMessages.add(new Formatter().format(code + format, args).toString()); } + @Override public void warning(String format, Object... args) { add("W ", format, args); } + @Override public void printf(String format, Object... args) { add("P ", format, args); } + @Override public void error(Throwable t, String format, Object... args) { if (t != null) { add("T", "%s", t.toString()); diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java index 2e63f9a..b3315c3 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java @@ -56,6 +56,7 @@ class CaptureErrorHandler implements ErrorHandler { /**
* @throws SAXException
*/
+ @Override
public void error(SAXParseException ex) throws SAXException {
mErrors += "Error: " + ex.getMessage() + "\n";
}
@@ -63,6 +64,7 @@ class CaptureErrorHandler implements ErrorHandler { /**
* @throws SAXException
*/
+ @Override
public void fatalError(SAXParseException ex) throws SAXException {
mErrors += "Fatal Error: " + ex.getMessage() + "\n";
}
@@ -70,6 +72,7 @@ class CaptureErrorHandler implements ErrorHandler { /**
* @throws SAXException
*/
+ @Override
public void warning(SAXParseException ex) throws SAXException {
mWarnings += "Warning: " + ex.getMessage() + "\n";
}
diff --git a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs index e755df2..9c7cb00 100644 --- a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs +++ b/sdkmanager/libs/sdkuilib/.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/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java index 88c27c4..d98af7e 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java @@ -150,6 +150,7 @@ class ArchiveInfo extends ArchiveReplacement implements Comparable<ArchiveInfo> *
* @see Archive#compareTo(Archive)
*/
+ @Override
public int compareTo(ArchiveInfo rhs) {
if (getNewArchive() != null && rhs != null) {
return getNewArchive().compareTo(rhs.getNewArchive());
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java index 51c7899..f7bd97f 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java @@ -35,14 +35,17 @@ public abstract class MenuBarWrapper { public MenuBarWrapper(String appName, Menu menu) {
MenuBarEnhancer.setupMenu(appName, menu, new IMenuBarCallback() {
+ @Override
public void onPreferencesMenuSelected() {
MenuBarWrapper.this.onPreferencesMenuSelected();
}
+ @Override
public void onAboutMenuSelected() {
MenuBarWrapper.this.onAboutMenuSelected();
}
+ @Override
public void printError(String format, Object... args) {
MenuBarWrapper.this.printError(format, args);
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java index 65c3e59..8577da4 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java @@ -739,14 +739,17 @@ final class SdkUpdaterChooserDialog extends GridDialog { private class NewArchivesContentProvider implements IStructuredContentProvider {
+ @Override
public void dispose() {
// pass
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Ignore. The input is always mArchives
}
+ @Override
public Object[] getElements(Object inputElement) {
return mArchives.toArray();
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java index 60c0909..4f35b26 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java @@ -1270,6 +1270,7 @@ class SdkUpdaterLogic { final boolean forceHttp = mUpdaterData.getSettingsController().getForceHttp();
mUpdaterData.getTaskFactory().start("Refresh Sources", new ITask() {
+ @Override
public void run(ITaskMonitor monitor) {
for (SdkSource remoteSrc : remoteSources) {
Package[] pkgs = remoteSrc.getPackages();
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java index 26dd5c5..7b94c94 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java @@ -155,10 +155,12 @@ public class SdkUpdaterNoWindow { * provides {@link ConsoleTaskMonitor} objects. */ private class ConsoleTaskFactory implements ITaskFactory { + @Override public void start(String title, ITask task) { start(title, null /*parentMonitor*/, task); } + @Override public void start(String title, ITaskMonitor parentMonitor, ITask task) { if (parentMonitor == null) { task.run(new ConsoleTaskMonitor(title, task)); @@ -205,6 +207,7 @@ public class SdkUpdaterNoWindow { /** * Sets the description in the current task dialog. */ + @Override public void setDescription(String format, Object...args) { String last = mLastDesc; @@ -241,28 +244,34 @@ public class SdkUpdaterNoWindow { mSdkLog.printf("%s", line); //$NON-NLS-1$ } + @Override public void log(String format, Object...args) { setDescription(" " + format, args); //$NON-NLS-1$ } + @Override public void logError(String format, Object...args) { setDescription(format, args); } + @Override public void logVerbose(String format, Object...args) { // The ConsoleTask does not display verbose log messages. } // --- ISdkLog --- + @Override public void error(Throwable t, String errorFormat, Object... args) { mSdkLog.error(t, errorFormat, args); } + @Override public void warning(String warningFormat, Object... args) { mSdkLog.warning(warningFormat, args); } + @Override public void printf(String msgFormat, Object... args) { mSdkLog.printf(msgFormat, args); } @@ -274,6 +283,7 @@ public class SdkUpdaterNoWindow { * *after* {@link #incProgress(int)}: we don't try to adjust it on the * fly. */ + @Override public void setProgressMax(int max) { assert max > 0; // Always set the dialog's progress max to 10k since it only handles @@ -283,6 +293,7 @@ public class SdkUpdaterNoWindow { assert mIncCoef > 0; } + @Override public int getProgressMax() { return mIncCoef > 0 ? (int) (MAX_COUNT / mIncCoef) : 0; } @@ -290,6 +301,7 @@ public class SdkUpdaterNoWindow { /** * Increments the current value of the progress bar. */ + @Override public void incProgress(int delta) { if (delta > 0 && mIncCoef > 0) { internalIncProgress(delta * mIncCoef); @@ -308,6 +320,7 @@ public class SdkUpdaterNoWindow { * Returns the current value of the progress bar, * between 0 and up to {@link #setProgressMax(int)} - 1. */ + @Override public int getProgress() { assert mIncCoef > 0; return mIncCoef > 0 ? (int)(mValue / mIncCoef) : 0; @@ -316,6 +329,7 @@ public class SdkUpdaterNoWindow { /** * Returns true if the "Cancel" button was selected. */ + @Override public boolean isCancelRequested() { return false; } @@ -330,6 +344,7 @@ public class SdkUpdaterNoWindow { * @param message The error message * @return true if YES was clicked. */ + @Override public boolean displayPrompt(final String title, final String message) { // TODO Make it interactive if mForce==false mSdkLog.printf("\n%s\n%s\n[y/n] => %s\n", @@ -363,6 +378,7 @@ public class SdkUpdaterNoWindow { * be filled with empty strings. * @see ITaskMonitor#displayLoginCredentialsPrompt(String, String) */ + @Override public UserCredentials displayLoginCredentialsPrompt(String title, String message) { String login = ""; //$NON-NLS-1$ String password = ""; //$NON-NLS-1$ @@ -422,6 +438,7 @@ public class SdkUpdaterNoWindow { * Creates a sub-monitor that will use up to tickCount on the progress bar. * tickCount must be 1 or more. */ + @Override public ITaskMonitor createSubMonitor(int tickCount) { assert mIncCoef > 0; assert tickCount > 0; @@ -462,47 +479,57 @@ public class SdkUpdaterNoWindow { mSubValue = start; } + @Override public boolean isCancelRequested() { return mRoot.isCancelRequested(); } + @Override public void setDescription(String format, Object... args) { mRoot.setDescription(format, args); } + @Override public void log(String format, Object... args) { mRoot.log(format, args); } + @Override public void logError(String format, Object... args) { mRoot.logError(format, args); } + @Override public void logVerbose(String format, Object... args) { mRoot.logVerbose(format, args); } + @Override public void setProgressMax(int max) { assert max > 0; mSubCoef = max > 0 ? mSpan / max : 0; assert mSubCoef > 0; } + @Override public int getProgressMax() { return mSubCoef > 0 ? (int) (mSpan / mSubCoef) : 0; } + @Override public int getProgress() { assert mSubCoef > 0; return mSubCoef > 0 ? (int)((mSubValue - mStart) / mSubCoef) : 0; } + @Override public void incProgress(int delta) { if (delta > 0 && mSubCoef > 0) { subIncProgress(delta * mSubCoef); } } + @Override public void subIncProgress(double realDelta) { mSubValue += realDelta; if (mParent != null) { @@ -512,14 +539,17 @@ public class SdkUpdaterNoWindow { } } + @Override public boolean displayPrompt(String title, String message) { return mRoot.displayPrompt(title, message); } + @Override public UserCredentials displayLoginCredentialsPrompt(String title, String message) { return mRoot.displayLoginCredentialsPrompt(title, message); } + @Override public ITaskMonitor createSubMonitor(int tickCount) { assert mSubCoef > 0; assert tickCount > 0; @@ -531,14 +561,17 @@ public class SdkUpdaterNoWindow { // --- ISdkLog --- + @Override public void error(Throwable t, String errorFormat, Object... args) { mRoot.error(t, errorFormat, args); } + @Override public void warning(String warningFormat, Object... args) { mRoot.warning(warningFormat, args); } + @Override public void printf(String msgFormat, Object... args) { mRoot.printf(msgFormat, args); } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java index 449e6e3..672feed 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java @@ -147,6 +147,7 @@ public class SettingsController { settingsPage.loadSettings(mProperties);
settingsPage.setOnSettingsChanged(new ISettingsPage.SettingsChangedCallback() {
+ @Override
public void onSettingsChanged(ISettingsPage page) {
SettingsController.this.onSettingsChanged();
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java index 0a89585..4f39b71 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java @@ -130,6 +130,7 @@ public class UpdaterData implements IUpdaterData { mTaskFactory = taskFactory;
}
+ @Override
public ITaskFactory getTaskFactory() {
return mTaskFactory;
}
@@ -142,6 +143,7 @@ public class UpdaterData implements IUpdaterData { return mLocalSdkParser;
}
+ @Override
public ISdkLog getSdkLog() {
return mSdkLog;
}
@@ -150,18 +152,22 @@ public class UpdaterData implements IUpdaterData { mImageFactory = imageFactory;
}
+ @Override
public ImageFactory getImageFactory() {
return mImageFactory;
}
+ @Override
public SdkManager getSdkManager() {
return mSdkManager;
}
+ @Override
public AvdManager getAvdManager() {
return mAvdManager;
}
+ @Override
public SettingsController getSettingsController() {
return mSettingsController;
}
@@ -182,6 +188,7 @@ public class UpdaterData implements IUpdaterData { mWindowShell = windowShell;
}
+ @Override
public Shell getWindowShell() {
return mWindowShell;
}
@@ -366,6 +373,7 @@ public class UpdaterData implements IUpdaterData { Collections.sort(archives, new InstallOrderComparator());
mTaskFactory.start("Installing Archives", new ITask() {
+ @Override
public void run(ITaskMonitor monitor) {
final int progressPerArchive = 2 * ArchiveInstaller.NUM_MONITOR_INC;
@@ -535,6 +543,7 @@ public class UpdaterData implements IUpdaterData { private final Map<ArchiveInfo, Integer> mOrders = new HashMap<ArchiveInfo, Integer>();
+ @Override
public int compare(ArchiveInfo o1, ArchiveInfo o2) {
int n1 = getDependencyOrder(o1);
int n2 = getDependencyOrder(o2);
@@ -589,6 +598,7 @@ public class UpdaterData implements IUpdaterData { final Shell shell = getWindowShell();
if (shell != null && !shell.isDisposed()) {
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!shell.isDisposed()) {
canRestart[0] = MessageDialog.openQuestion(shell,
@@ -630,6 +640,7 @@ public class UpdaterData implements IUpdaterData { final Shell shell = getWindowShell();
if (msg2 != null && shell != null && !shell.isDisposed()) {
shell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!shell.isDisposed()) {
MessageDialog.openInformation(shell,
@@ -977,6 +988,7 @@ public class UpdaterData implements IUpdaterData { final boolean forceHttp = getSettingsController().getForceHttp();
mTaskFactory.start("Refresh Sources", new ITask() {
+ @Override
public void run(ITaskMonitor monitor) {
if (mStateFetchRemoteAddonsList <= 0) {
@@ -1008,6 +1020,7 @@ public class UpdaterData implements IUpdaterData { }
mTaskFactory.start("Load Add-ons List", monitor, new ITask() {
+ @Override
public void run(ITaskMonitor subMonitor) {
loadRemoteAddonsListInTask(subMonitor);
}
@@ -1063,6 +1076,7 @@ public class UpdaterData implements IUpdaterData { public void broadcastOnSdkLoaded() {
if (mWindowShell != null && mListeners.size() > 0) {
mWindowShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
for (ISdkChangeListener listener : mListeners) {
try {
@@ -1083,6 +1097,7 @@ public class UpdaterData implements IUpdaterData { private void broadcastOnSdkReload() {
if (mWindowShell != null && mListeners.size() > 0) {
mWindowShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
for (ISdkChangeListener listener : mListeners) {
try {
@@ -1103,6 +1118,7 @@ public class UpdaterData implements IUpdaterData { private void broadcastPreInstallHook() {
if (mWindowShell != null && mListeners.size() > 0) {
mWindowShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
for (ISdkChangeListener listener : mListeners) {
try {
@@ -1123,6 +1139,7 @@ public class UpdaterData implements IUpdaterData { private void broadcastPostInstallHook() {
if (mWindowShell != null && mListeners.size() > 0) {
mWindowShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
for (ISdkChangeListener listener : mListeners) {
try {
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman1/AvdManagerPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman1/AvdManagerPage.java index 56fda08..84a549b 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman1/AvdManagerPage.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman1/AvdManagerPage.java @@ -100,18 +100,22 @@ public class AvdManagerPage extends UpdaterPage implements ISdkChangeListener { // --- Implementation of ISdkChangeListener ---
+ @Override
public void onSdkLoaded() {
onSdkReload();
}
+ @Override
public void onSdkReload() {
mAvdSelector.refresh(false /*reload*/);
}
+ @Override
public void preInstallHook() {
// nothing to be done for now.
}
+ @Override
public void postInstallHook() {
// nothing to be done for now.
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java index 48cf9f7..a600ad3 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java @@ -108,6 +108,7 @@ public class AddonSitesDialog extends SwtBaseDialog { mTableViewer = new TableViewer(shell, SWT.BORDER | SWT.FULL_SELECTION); mTableViewer.addPostSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { on_TableViewer_selectionChanged(event); } @@ -224,6 +225,7 @@ public class AddonSitesDialog extends SwtBaseDialog { msg, initialValue, new IInputValidator() { + @Override public String isValid(String newText) { newText = newText == null ? null : newText.trim(); @@ -360,14 +362,17 @@ public class AddonSitesDialog extends SwtBaseDialog { private static class SourcesContentProvider implements IStructuredContentProvider { + @Override public void dispose() { // pass } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // pass } + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof SdkSource[]) { return (Object[]) inputElement; diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AdtUpdateDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AdtUpdateDialog.java index 6e7c611..ca1159d 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AdtUpdateDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AdtUpdateDialog.java @@ -45,8 +45,8 @@ import org.eclipse.swt.widgets.Shell; import java.io.File;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
/**
* This is a private implementation of UpdateWindow for ADT,
@@ -229,6 +229,7 @@ public class AdtUpdateDialog extends SwtBaseDialog { mPackageMananger.loadPackagesWithInstallTask(
mPackageFilter.installFlags(),
new IAutoInstallTask() {
+ @Override
public Package[] filterLoadedSource(SdkSource source, Package[] packages) {
for (Package pkg : packages) {
mPackageFilter.visit(pkg);
@@ -236,17 +237,20 @@ public class AdtUpdateDialog extends SwtBaseDialog { return packages;
}
+ @Override
public boolean acceptPackage(Package pkg) {
// Is this the package we want to install?
return mPackageFilter.accept(pkg);
}
+ @Override
public void setResult(boolean success, Map<Package, File> installPaths) {
// Capture the result from the installation.
mResultCode = Boolean.valueOf(success);
mResultPaths = installPaths;
}
+ @Override
public void taskCompleted() {
// We can close that window now.
close();
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java index 61f0140..23fde3f 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AvdManagerWindowImpl1.java @@ -28,9 +28,9 @@ import com.android.sdkuilib.internal.repository.UpdaterPage; import com.android.sdkuilib.internal.repository.UpdaterPage.Purpose;
import com.android.sdkuilib.internal.repository.icons.ImageFactory;
import com.android.sdkuilib.internal.repository.sdkman1.AvdManagerPage;
+import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext;
import com.android.sdkuilib.repository.ISdkChangeListener;
import com.android.sdkuilib.repository.SdkUpdaterWindow;
-import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext;
import com.android.sdkuilib.ui.GridDataBuilder;
import com.android.sdkuilib.ui.GridLayoutBuilder;
import com.android.sdkuilib.ui.SwtBaseDialog;
@@ -159,6 +159,7 @@ public class AvdManagerWindowImpl1 { mShell = new Shell(mParentShell, style);
mShell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
ShellSizeAndPos.saveSizeAndPos(mShell, SIZE_POS_PREFIX);
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/LogWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/LogWindow.java index d2de5f9..3e6cc3d 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/LogWindow.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/LogWindow.java @@ -197,8 +197,10 @@ class LogWindow implements ILogUiProvider { * Sets the description in the current task dialog.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setDescription(final String description) {
syncExec(mLogDescription, new Runnable() {
+ @Override
public void run() {
mLogDescription.setText(description);
@@ -217,9 +219,11 @@ class LogWindow implements ILogUiProvider { * Logs a "normal" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void log(final String log) {
if (acceptLog(log, false /*isDescription*/)) {
syncExec(mLogDescription, new Runnable() {
+ @Override
public void run() {
appendLine(TextStyle.DEFAULT, log);
}
@@ -235,9 +239,11 @@ class LogWindow implements ILogUiProvider { * Logs an "error" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logError(final String log) {
if (acceptLog(log, false /*isDescription*/)) {
syncExec(mLogDescription, new Runnable() {
+ @Override
public void run() {
appendLine(TextStyle.ERROR, log);
}
@@ -254,9 +260,11 @@ class LogWindow implements ILogUiProvider { * not that useful for the end-user and might be hidden until explicitly shown.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logVerbose(final String log) {
if (acceptLog(log, false /*isDescription*/)) {
syncExec(mLogDescription, new Runnable() {
+ @Override
public void run() {
appendLine(TextStyle.DEFAULT, " " + log); //$NON-NLS-1$
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackageLoader.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackageLoader.java index fdef221..af7ce2c 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackageLoader.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackageLoader.java @@ -21,8 +21,8 @@ import com.android.sdklib.internal.repository.ITask; import com.android.sdklib.internal.repository.ITaskMonitor; import com.android.sdklib.internal.repository.NullTaskMonitor; import com.android.sdklib.internal.repository.Package; -import com.android.sdklib.internal.repository.SdkSource; import com.android.sdklib.internal.repository.Package.UpdateInfo; +import com.android.sdklib.internal.repository.SdkSource; import com.android.sdkuilib.internal.repository.UpdaterData; import org.eclipse.swt.widgets.Display; @@ -151,6 +151,7 @@ class PackageLoader { } mUpdaterData.getTaskFactory().start("Loading Sources", new ITask() { + @Override public void run(ITaskMonitor monitor) { monitor.setProgressMax(10); @@ -239,6 +240,7 @@ class PackageLoader { List<Archive> mArchivesToInstall = new ArrayList<Archive>(); Map<Package, File> mInstallPaths = new HashMap<Package, File>(); + @Override public boolean onUpdateSource(SdkSource source, Package[] packages) { packages = installTask.filterLoadedSource(source, packages); if (packages == null || packages.length == 0) { @@ -277,6 +279,7 @@ class PackageLoader { return true; } + @Override public void onLoadCompleted() { if (!mArchivesToInstall.isEmpty()) { installArchives(mArchivesToInstall); @@ -306,6 +309,7 @@ class PackageLoader { Shell shell = mUpdaterData.getWindowShell(); if (shell != null && !shell.isDisposed()) { shell.getDisplay().syncExec(new Runnable() {; + @Override public void run() { List<Archive> archives = mUpdaterData.updateOrInstallAll_WithGUI( diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesDiffLogic.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesDiffLogic.java index beef56f..e72c128 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesDiffLogic.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesDiffLogic.java @@ -686,6 +686,7 @@ class PackagesDiffLogic { synchronized (getCategories()) { Collections.sort(getCategories(), new Comparator<PkgCategory>() { + @Override public int compare(PkgCategory cat1, PkgCategory cat2) { assert cat1 instanceof PkgCategoryApi; assert cat2 instanceof PkgCategoryApi; @@ -781,6 +782,7 @@ class PackagesDiffLogic { synchronized (getCategories()) { Collections.sort(getCategories(), new Comparator<PkgCategory>() { + @Override public int compare(PkgCategory cat1, PkgCategory cat2) { assert cat1 instanceof PkgCategorySource; assert cat2 instanceof PkgCategorySource; diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesPage.java index c3b3568..58d7daa 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesPage.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PackagesPage.java @@ -173,6 +173,7 @@ public class PackagesPage extends UpdaterPage postCreate(); //$hide$ } + @Override public void onPageSelected() { List<PkgCategory> cats = mDiffLogic.getCategories(isSortByApi()); if (cats == null || cats.isEmpty()) { @@ -210,12 +211,14 @@ public class PackagesPage extends UpdaterPage }); mTreeViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { onTreeCheckStateChanged(event); //$hide$ } }); mTreeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { onTreeDoubleClick(event); //$hide$ } @@ -539,6 +542,7 @@ public class PackagesPage extends UpdaterPage mTreeFontItalic = new Font(mTree.getDisplay(), fontData); mTree.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { mTreeFontItalic.dispose(); mTreeFontItalic = null; @@ -593,6 +597,7 @@ public class PackagesPage extends UpdaterPage mDiffLogic.updateStart(); mDiffLogic.getPackageLoader().loadPackages(new ISourceLoadedCallback() { + @Override public boolean onUpdateSource(SdkSource source, Package[] newPackages) { // This runs in a thread and must not access UI directly. final boolean changed = mDiffLogic.updateSourcePackages( @@ -600,6 +605,7 @@ public class PackagesPage extends UpdaterPage if (!mGroupPackages.isDisposed()) { mGroupPackages.getDisplay().syncExec(new Runnable() { + @Override public void run() { if (changed || mTreeViewer.getInput() != mDiffLogic.getCategories(isSortByApi())) { @@ -615,12 +621,14 @@ public class PackagesPage extends UpdaterPage return !mGroupPackages.isDisposed(); } + @Override public void onLoadCompleted() { // This runs in a thread and must not access UI directly. final boolean changed = mDiffLogic.updateEnd(displaySortByApi); if (!mGroupPackages.isDisposed()) { mGroupPackages.getDisplay().syncExec(new Runnable() { + @Override public void run() { if (changed || mTreeViewer.getInput() != mDiffLogic.getCategories(isSortByApi())) { @@ -1152,6 +1160,7 @@ public class PackagesPage extends UpdaterPage beginOperationPending(); mUpdaterData.getTaskFactory().start("Delete Package", new ITask() { + @Override public void run(ITaskMonitor monitor) { monitor.setProgressMax(archives.size() + 1); for (Archive a : archives) { @@ -1532,6 +1541,7 @@ public class PackagesPage extends UpdaterPage // -- ITableFontProvider + @Override public Font getFont(Object element, int columnIndex) { if (element instanceof PkgItem) { if (((PkgItem) element).getState() == PkgState.NEW) { @@ -1586,6 +1596,7 @@ public class PackagesPage extends UpdaterPage private class PkgContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof ArrayList<?>) { return ((ArrayList<?>) parentElement).toArray(); @@ -1616,6 +1627,7 @@ public class PackagesPage extends UpdaterPage return new Object[0]; } + @Override @SuppressWarnings("unchecked") public Object getParent(Object element) { // This operation is expensive, so we do the minimum @@ -1635,6 +1647,7 @@ public class PackagesPage extends UpdaterPage return null; } + @Override public boolean hasChildren(Object parentElement) { if (parentElement instanceof ArrayList<?>) { return true; @@ -1663,15 +1676,18 @@ public class PackagesPage extends UpdaterPage return false; } + @Override public Object[] getElements(Object inputElement) { return getChildren(inputElement); } + @Override public void dispose() { // unused } + @Override public void inputChanged(Viewer arg0, Object arg1, Object arg2) { // unused } @@ -1679,20 +1695,24 @@ public class PackagesPage extends UpdaterPage // --- Implementation of ISdkChangeListener --- + @Override public void onSdkLoaded() { onSdkReload(); } + @Override public void onSdkReload() { // The sdkmanager finished reloading its data. We must not call localReload() from here // since we don't want to alter the sdkmanager's data that just finished loading. loadPackages(); } + @Override public void preInstallHook() { // nothing to be done for now. } + @Override public void postInstallHook() { // nothing to be done for now. } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgItem.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgItem.java index 0f9dbc3..2c8b2d2 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgItem.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgItem.java @@ -19,8 +19,8 @@ package com.android.sdkuilib.internal.repository.sdkman2; import com.android.sdklib.internal.repository.Archive; import com.android.sdklib.internal.repository.IPackageVersion; import com.android.sdklib.internal.repository.Package; -import com.android.sdklib.internal.repository.SdkSource; import com.android.sdklib.internal.repository.Package.UpdateInfo; +import com.android.sdklib.internal.repository.SdkSource; /** * A {@link PkgItem} represents one main {@link Package} combined with its state @@ -119,6 +119,7 @@ public class PkgItem implements Comparable<PkgItem> { return mMainPkg.getArchives(); } + @Override public int compareTo(PkgItem pkg) { return getMainPackage().compareTo(pkg.getMainPackage()); } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkLogAdapter.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkLogAdapter.java index 6ce8b1e..969d930 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkLogAdapter.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkLogAdapter.java @@ -41,6 +41,7 @@ public final class SdkLogAdapter implements ILogUiProvider { * Sets the description in the current task dialog.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setDescription(final String description) {
if (acceptLog(description)) {
mSdkLog.printf("%1$s", description); //$NON-NLS-1$
@@ -51,6 +52,7 @@ public final class SdkLogAdapter implements ILogUiProvider { * Logs a "normal" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void log(String log) {
if (acceptLog(log)) {
mSdkLog.printf(" %1$s", log); //$NON-NLS-1$
@@ -61,6 +63,7 @@ public final class SdkLogAdapter implements ILogUiProvider { * Logs an "error" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logError(String log) {
if (acceptLog(log)) {
mSdkLog.error(null, " %1$s", log); //$NON-NLS-1$
@@ -72,6 +75,7 @@ public final class SdkLogAdapter implements ILogUiProvider { * not that useful for the end-user and might be hidden until explicitly shown.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logVerbose(String log) {
if (acceptLog(log)) {
mSdkLog.printf(" %1$s", log); //$NON-NLS-1$
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java index 7873700..5801aca 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java @@ -139,6 +139,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { * Opens the window.
* @wbp.parser.entryPoint
*/
+ @Override
public void open() {
if (mParentShell == null) {
Display.setAppName(APP_NAME); //$hide$ (hide from SWT designer)
@@ -174,6 +175,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { mShell = new Shell(mParentShell, style);
mShell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
ShellSizeAndPos.saveSizeAndPos(mShell, SIZE_POS_PREFIX);
onAndroidSdkUpdaterDispose(); //$hide$ (hide from SWT designer)
@@ -219,6 +221,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { "Click to abort the current task",
""); //$NON-NLS-1$ nothing to abort
mButtonStop.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
onStopSelected();
}
@@ -230,6 +233,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { "Click to show the log window", // tooltip for state hidden=>shown
"Click to hide the log window"); // tooltip for state shown=>hidden
mButtonShowLog.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
onToggleLogWindow();
}
@@ -400,6 +404,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { * @param pageClass The {@link Composite}-derived class that will implement the page.
* @param purpose The purpose of this page, e.g. an about box, settings page or generic.
*/
+ @Override
@SuppressWarnings("unchecked")
public void registerPage(Class<? extends UpdaterPage> pageClass,
Purpose purpose) {
@@ -415,6 +420,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { * This must be called before the call to {@link #open()}.
* If null or if the page class is not found, the first page will be selected.
*/
+ @Override
public void setInitialPage(Class<? extends Composite> pageClass) {
// Unused in this case. This window display only one page.
}
@@ -424,6 +430,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { * <p/>
* This must be called before the call to {@link #open()}.
*/
+ @Override
public void setRequestAutoUpdate(boolean requestAutoUpdate) {
mRequestAutoUpdate = requestAutoUpdate;
}
@@ -431,6 +438,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { /**
* Adds a new listener to be notified when a change is made to the content of the SDK.
*/
+ @Override
public void addListener(ISdkChangeListener listener) {
mUpdaterData.addListeners(listener);
}
@@ -439,6 +447,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { * Removes a new listener to be notified anymore when a change is made to the content of
* the SDK.
*/
+ @Override
public void removeListener(ISdkChangeListener listener) {
mUpdaterData.removeListener(listener);
}
@@ -469,18 +478,22 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { // and filters errors to make sure the window is visible when
// an error is logged.
ILogUiProvider logAdapter = new ILogUiProvider() {
+ @Override
public void setDescription(String description) {
mLogWindow.setDescription(description);
}
+ @Override
public void log(String log) {
mLogWindow.log(log);
}
+ @Override
public void logVerbose(String log) {
mLogWindow.logVerbose(log);
}
+ @Override
public void logError(String log) {
mLogWindow.logError(log);
@@ -490,6 +503,7 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow { // have a lot of error logging, so this should be acceptable. If not, we could
// cache the visibility state.
mShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mLogWindow.isVisible()) {
// Don't toggle the window visibility directly.
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java index dc4f3ba..4e2c131 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java @@ -37,6 +37,7 @@ interface IProgressUiProvider extends ILogUiProvider { * Sets the description in the current task dialog. * This method can be invoked from a non-UI thread. */ + @Override public abstract void setDescription(String description); /** diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java index d01466b..c6ba8b7 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java @@ -168,6 +168,7 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { // Hide everything down-below from SWT designer
//$hide>>$
+ @Override
public boolean isCancelRequested() {
return mCancelMode != CancelMode.ACTIVE;
}
@@ -183,6 +184,7 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { // and lock on the cancel button mode.
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
synchronized (mCancelMode) {
if (mCancelMode == CancelMode.ACTIVE) {
@@ -213,6 +215,7 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { // and lock on the cancel button mode.
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
synchronized (mCancelMode) {
if (mCancelMode != CancelMode.CLOSE_MANUAL &&
@@ -277,8 +280,10 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { * Sets the description in the current task dialog.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setDescription(final String description) {
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mLabel.isDisposed()) {
mLabel.setText(description);
@@ -291,9 +296,11 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { * Adds to the log in the current task dialog.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void log(final String info) {
if (!mDialogShell.isDisposed()) {
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mResultText.isDisposed()) {
mResultText.setVisible(true);
@@ -311,10 +318,12 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { }
}
+ @Override
public void logError(String info) {
log(info);
}
+ @Override
public void logVerbose(String info) {
log(info);
}
@@ -325,9 +334,11 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { *
* @see ProgressBar#setMaximum(int)
*/
+ @Override
public void setProgressMax(final int max) {
if (!mDialogShell.isDisposed()) {
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mProgressBar.isDisposed()) {
mProgressBar.setMaximum(max);
@@ -341,9 +352,11 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { * Sets the current value of the progress bar.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setProgress(final int value) {
if (!mDialogShell.isDisposed()) {
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mProgressBar.isDisposed()) {
mProgressBar.setSelection(value);
@@ -358,11 +371,13 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { * between 0 and up to {@link #setProgressMax(int)} - 1.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public int getProgress() {
final int[] result = new int[] { 0 };
if (!mDialogShell.isDisposed()) {
mDialogShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mProgressBar.isDisposed()) {
result[0] = mProgressBar.getSelection();
@@ -384,12 +399,14 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { * @param message The error message
* @return true if YES was clicked.
*/
+ @Override
public boolean displayPrompt(final String title, final String message) {
Display display = mDialogShell.getDisplay();
// we need to ask the user what he wants to do.
final boolean[] result = new boolean[] { false };
display.syncExec(new Runnable() {
+ @Override
public void run() {
result[0] = MessageDialog.openQuestion(mDialogShell, title, message);
}
@@ -411,6 +428,7 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { * If operation is <b>canceled</b> by user the return value must be <b>null</b>.
* @see ITaskMonitor#displayLoginCredentialsPrompt(String, String)
*/
+ @Override
public UserCredentials displayLoginCredentialsPrompt(
final String title, final String message) {
Display display = mDialogShell.getDisplay();
@@ -438,6 +456,7 @@ final class ProgressTaskDialog extends Dialog implements IProgressUiProvider { mMessage = message;
}
+ @Override
public void run() {
AuthenticationDialog authenticationDialog = new AuthenticationDialog(mShell,
mTitle, mMessage);
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java index d80e8c2..ac0bc30 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java @@ -34,10 +34,12 @@ public final class ProgressTaskFactory implements ITaskFactory { mShell = shell;
}
+ @Override
public void start(String title, ITask task) {
start(title, null /*parentMonitor*/, task);
}
+ @Override
public void start(String title, ITaskMonitor parentMonitor, ITask task) {
if (parentMonitor == null) {
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java index 3361a58..3090884 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java @@ -86,6 +86,7 @@ public final class ProgressView implements IProgressUiProvider { mStopButton = stopButton;
if (mStopButton != null) {
mStopButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (mState == State.ACTIVE) {
changeState(State.STOP_PENDING);
@@ -113,6 +114,7 @@ public final class ProgressView implements IProgressUiProvider { }
Runnable r = new Runnable() {
+ @Override
public void run() {
if (parentMonitor == null) {
task.run(new TaskMonitorImpl(ProgressView.this));
@@ -179,6 +181,7 @@ public final class ProgressView implements IProgressUiProvider { private void syncExec(final Widget widget, final Runnable runnable) {
if (widget != null && !widget.isDisposed()) {
widget.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
// Check again whether the widget got disposed between the time where
// we requested the syncExec and the time it actually happened.
@@ -196,6 +199,7 @@ public final class ProgressView implements IProgressUiProvider { }
syncExec(mStopButton, new Runnable() {
+ @Override
public void run() {
mStopButton.setEnabled(mState == State.ACTIVE);
}
@@ -205,6 +209,7 @@ public final class ProgressView implements IProgressUiProvider { // --- Implementation of ITaskUiProvider ---
+ @Override
public boolean isCancelRequested() {
return mState != State.ACTIVE;
}
@@ -213,8 +218,10 @@ public final class ProgressView implements IProgressUiProvider { * Sets the description in the current task dialog.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setDescription(final String description) {
syncExec(mLabel, new Runnable() {
+ @Override
public void run() {
mLabel.setText(description);
}
@@ -227,6 +234,7 @@ public final class ProgressView implements IProgressUiProvider { * Logs a "normal" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void log(String log) {
mLog.log(log);
}
@@ -235,6 +243,7 @@ public final class ProgressView implements IProgressUiProvider { * Logs an "error" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logError(String log) {
mLog.logError(log);
}
@@ -244,6 +253,7 @@ public final class ProgressView implements IProgressUiProvider { * not that useful for the end-user and might be hidden until explicitly shown.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logVerbose(String log) {
mLog.logVerbose(log);
}
@@ -254,8 +264,10 @@ public final class ProgressView implements IProgressUiProvider { *
* @see ProgressBar#setMaximum(int)
*/
+ @Override
public void setProgressMax(final int max) {
syncExec(mProgressBar, new Runnable() {
+ @Override
public void run() {
mProgressBar.setMaximum(max);
}
@@ -266,8 +278,10 @@ public final class ProgressView implements IProgressUiProvider { * Sets the current value of the progress bar.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setProgress(final int value) {
syncExec(mProgressBar, new Runnable() {
+ @Override
public void run() {
mProgressBar.setSelection(value);
}
@@ -279,11 +293,13 @@ public final class ProgressView implements IProgressUiProvider { * between 0 and up to {@link #setProgressMax(int)} - 1.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public int getProgress() {
final int[] result = new int[] { 0 };
if (!mProgressBar.isDisposed()) {
mProgressBar.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if (!mProgressBar.isDisposed()) {
result[0] = mProgressBar.getSelection();
@@ -295,10 +311,12 @@ public final class ProgressView implements IProgressUiProvider { return result[0];
}
+ @Override
public boolean displayPrompt(final String title, final String message) {
final boolean[] result = new boolean[] { false };
syncExec(mProgressBar, new Runnable() {
+ @Override
public void run() {
Shell shell = mProgressBar.getShell();
result[0] = MessageDialog.openQuestion(shell, title, message);
@@ -317,11 +335,13 @@ public final class ProgressView implements IProgressUiProvider { * If operation is <b>canceled</b> by user the return value must be <b>null</b>.
* @see ITaskMonitor#displayLoginCredentialsPrompt(String, String)
*/
+ @Override
public UserCredentials
displayLoginCredentialsPrompt(final String title, final String message) {
final String[] resultArray = new String[] {"", "", "", ""};
// open dialog and request login and password
syncExec(mProgressBar, new Runnable() {
+ @Override
public void run() {
Shell shell = mProgressBar.getShell();
AuthenticationDialog authenticationDialog = new AuthenticationDialog(shell,
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java index db9fd7c..1d39c59 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java @@ -35,10 +35,12 @@ public final class ProgressViewFactory implements ITaskFactory { mProgressView = progressView;
}
+ @Override
public void start(String title, ITask task) {
start(title, null /*monitor*/, task);
}
+ @Override
public void start(String title, ITaskMonitor parentMonitor, ITask task) {
assert mProgressView != null;
mProgressView.startTask(title, parentMonitor, task);
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java index ff207c5..9a796b7 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java @@ -62,6 +62,7 @@ class TaskMonitorImpl implements ITaskMonitor { * Sets the description in the current task dialog.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void setDescription(String format, Object... args) {
final String text = String.format(format, args);
mUi.setDescription(text);
@@ -71,6 +72,7 @@ class TaskMonitorImpl implements ITaskMonitor { * Logs a "normal" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void log(String format, Object... args) {
String text = String.format(format, args);
mUi.log(text);
@@ -80,6 +82,7 @@ class TaskMonitorImpl implements ITaskMonitor { * Logs an "error" information line.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logError(String format, Object... args) {
String text = String.format(format, args);
mUi.logError(text);
@@ -90,6 +93,7 @@ class TaskMonitorImpl implements ITaskMonitor { * not that useful for the end-user and might be hidden until explicitly shown.
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void logVerbose(String format, Object... args) {
String text = String.format(format, args);
mUi.logVerbose(text);
@@ -103,6 +107,7 @@ class TaskMonitorImpl implements ITaskMonitor { * *after* {@link #incProgress(int)}: we don't try to adjust it on the
* fly.
*/
+ @Override
public void setProgressMax(int max) {
assert max > 0;
// Always set the dialog's progress max to 10k since it only handles
@@ -113,6 +118,7 @@ class TaskMonitorImpl implements ITaskMonitor { assert mIncCoef > 0;
}
+ @Override
public int getProgressMax() {
return mIncCoef > 0 ? (int) (MAX_COUNT / mIncCoef) : 0;
}
@@ -122,6 +128,7 @@ class TaskMonitorImpl implements ITaskMonitor { *
* This method can be invoked from a non-UI thread.
*/
+ @Override
public void incProgress(int delta) {
if (delta > 0 && mIncCoef > 0) {
internalIncProgress(delta * mIncCoef);
@@ -139,6 +146,7 @@ class TaskMonitorImpl implements ITaskMonitor { *
* This method can be invoked from a non-UI thread.
*/
+ @Override
public int getProgress() {
// mIncCoef is 0 if setProgressMax hasn't been used yet.
return mIncCoef > 0 ? (int)(mUi.getProgress() / mIncCoef) : 0;
@@ -148,6 +156,7 @@ class TaskMonitorImpl implements ITaskMonitor { * Returns true if the "Cancel" button was selected.
* It is up to the task thread to pool this and exit.
*/
+ @Override
public boolean isCancelRequested() {
return mUi.isCancelRequested();
}
@@ -162,6 +171,7 @@ class TaskMonitorImpl implements ITaskMonitor { * @param message The error message
* @return true if YES was clicked.
*/
+ @Override
public boolean displayPrompt(final String title, final String message) {
return mUi.displayPrompt(title, message);
}
@@ -177,6 +187,7 @@ class TaskMonitorImpl implements ITaskMonitor { * element and Password is always the second. If any error occurs a
* pair with empty strings is returned.
*/
+ @Override
public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
return mUi.displayLoginCredentialsPrompt(title, message);
}
@@ -185,6 +196,7 @@ class TaskMonitorImpl implements ITaskMonitor { * Creates a sub-monitor that will use up to tickCount on the progress bar.
* tickCount must be 1 or more.
*/
+ @Override
public ITaskMonitor createSubMonitor(int tickCount) {
assert mIncCoef > 0;
assert tickCount > 0;
@@ -193,6 +205,7 @@ class TaskMonitorImpl implements ITaskMonitor { // ----- ISdkLog interface ----
+ @Override
public void error(Throwable throwable, String errorFormat, Object... arg) {
if (errorFormat != null) {
logError("Error: " + errorFormat, arg);
@@ -203,10 +216,12 @@ class TaskMonitorImpl implements ITaskMonitor { }
}
+ @Override
public void warning(String warningFormat, Object... arg) {
log("Warning: " + warningFormat, arg);
}
+ @Override
public void printf(String msgFormat, Object... arg) {
log(msgFormat, arg);
}
@@ -242,48 +257,58 @@ class TaskMonitorImpl implements ITaskMonitor { mSubValue = start;
}
+ @Override
public boolean isCancelRequested() {
return mRoot.isCancelRequested();
}
+ @Override
public void setDescription(String format, Object... args) {
mRoot.setDescription(format, args);
}
+ @Override
public void log(String format, Object... args) {
mRoot.log(format, args);
}
+ @Override
public void logError(String format, Object... args) {
mRoot.logError(format, args);
}
+ @Override
public void logVerbose(String format, Object... args) {
mRoot.logVerbose(format, args);
}
+ @Override
public void setProgressMax(int max) {
assert max > 0;
mSubCoef = max > 0 ? mSpan / max : 0;
assert mSubCoef > 0;
}
+ @Override
public int getProgressMax() {
return mSubCoef > 0 ? (int) (mSpan / mSubCoef) : 0;
}
+ @Override
public int getProgress() {
// subCoef can be 0 if setProgressMax() and incProgress() haven't been called yet
assert mSubValue == mStart || mSubCoef > 0;
return mSubCoef > 0 ? (int)((mSubValue - mStart) / mSubCoef) : 0;
}
+ @Override
public void incProgress(int delta) {
if (delta > 0 && mSubCoef > 0) {
subIncProgress(delta * mSubCoef);
}
}
+ @Override
public void subIncProgress(double realDelta) {
mSubValue += realDelta;
if (mParent != null) {
@@ -293,14 +318,17 @@ class TaskMonitorImpl implements ITaskMonitor { }
}
+ @Override
public boolean displayPrompt(String title, String message) {
return mRoot.displayPrompt(title, message);
}
+ @Override
public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
return mRoot.displayLoginCredentialsPrompt(title, message);
}
+ @Override
public ITaskMonitor createSubMonitor(int tickCount) {
assert mSubCoef > 0;
assert tickCount > 0;
@@ -312,14 +340,17 @@ class TaskMonitorImpl implements ITaskMonitor { // ----- ISdkLog interface ----
+ @Override
public void error(Throwable throwable, String errorFormat, Object... arg) {
mRoot.error(throwable, errorFormat, arg);
}
+ @Override
public void warning(String warningFormat, Object... arg) {
mRoot.warning(warningFormat, arg);
}
+ @Override
public void printf(String msgFormat, Object... arg) {
mRoot.printf(msgFormat, arg);
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java index 2359add..4e54da0 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java @@ -25,8 +25,8 @@ import com.android.sdklib.SdkConstants; import com.android.sdklib.SdkManager; import com.android.sdklib.internal.avd.AvdInfo; import com.android.sdklib.internal.avd.AvdManager; -import com.android.sdklib.internal.avd.HardwareProperties; import com.android.sdklib.internal.avd.AvdManager.AvdConflict; +import com.android.sdklib.internal.avd.HardwareProperties; import com.android.sdklib.internal.avd.HardwareProperties.HardwareProperty; import com.android.sdklib.internal.project.ProjectProperties; import com.android.sdkuilib.internal.repository.icons.ImageFactory; @@ -75,8 +75,8 @@ import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import java.util.TreeMap; import java.util.Map.Entry; +import java.util.TreeMap; import java.util.regex.Matcher; /** @@ -141,6 +141,7 @@ final class AvdCreationDialog extends GridDialog { * {@link VerifyListener} for {@link Text} widgets that should only contains numbers. */ private final VerifyListener mDigitVerifier = new VerifyListener() { + @Override public void verifyText(VerifyEvent event) { int count = event.text.length(); for (int i = 0 ; i < count ; i++) { @@ -159,6 +160,7 @@ final class AvdCreationDialog extends GridDialog { * When editing an existing AVD, it's OK for the name to match the existing AVD. */ private class CreateNameModifyListener implements ModifyListener { + @Override public void modifyText(ModifyEvent e) { String name = mAvdName.getText().trim(); if (mEditAvdInfo == null || !name.equals(mEditAvdInfo.getName())) { @@ -193,6 +195,7 @@ final class AvdCreationDialog extends GridDialog { * {@link ModifyListener} used for live-validation of the fields content. */ private class ValidateListener extends SelectionAdapter implements ModifyListener { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -553,6 +556,7 @@ final class AvdCreationDialog extends GridDialog { // -- Table viewer mHardwareViewer = new TableViewer(hardwareTable); mHardwareViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { // it's a single selection mode, we can just access the selection index // from the table directly. @@ -562,14 +566,17 @@ final class AvdCreationDialog extends GridDialog { // only a content provider. Use viewers per column below (for editing support) mHardwareViewer.setContentProvider(new IStructuredContentProvider() { + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // we can just ignore this. we just use mProperties directly. } + @Override public Object[] getElements(Object arg0) { return mProperties.keySet().toArray(); } + @Override public void dispose() { // pass } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java index 637a109..e2e148b 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java @@ -22,8 +22,8 @@ import com.android.sdklib.ISdkLog; import com.android.sdklib.NullSdkLog; import com.android.sdklib.SdkConstants; import com.android.sdklib.internal.avd.AvdInfo; -import com.android.sdklib.internal.avd.AvdManager; import com.android.sdklib.internal.avd.AvdInfo.AvdStatus; +import com.android.sdklib.internal.avd.AvdManager; import com.android.sdklib.internal.repository.ITask; import com.android.sdklib.internal.repository.ITaskMonitor; import com.android.sdkuilib.internal.repository.SettingsController; @@ -170,10 +170,12 @@ public final class AvdSelector { mTarget = target; } + @Override public void prepare() { // nothing to prepare } + @Override public boolean accept(AvdInfo avd) { if (avd != null) { return mTarget.canRunOn(avd.getTarget()); @@ -182,6 +184,7 @@ public final class AvdSelector { return false; } + @Override public void cleanup() { // nothing to clean up } @@ -227,6 +230,7 @@ public final class AvdSelector { group.setLayoutData(new GridData(GridData.FILL_BOTH)); group.setFont(parent.getFont()); group.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent arg0) { mImageFactory.dispose(); } @@ -664,6 +668,7 @@ public final class AvdSelector { * Handles single-click selection on the table. * {@inheritDoc} */ + @Override public void widgetSelected(SelectionEvent e) { if (e.item instanceof TableItem) { TableItem i = (TableItem) e.item; @@ -685,6 +690,7 @@ public final class AvdSelector { * * {@inheritDoc} */ + @Override public void widgetDefaultSelected(SelectionEvent e) { if (e.item instanceof TableItem) { TableItem i = (TableItem) e.item; @@ -756,6 +762,7 @@ public final class AvdSelector { if (avds != null && avds.length > 0) { Arrays.sort(avds, new Comparator<AvdInfo>() { + @Override public int compare(AvdInfo o1, AvdInfo o2) { return o1.compareTo(o2); } @@ -904,6 +911,7 @@ public final class AvdSelector { // check if the AVD is running if (avdInfo.isRunning()) { display.asyncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); MessageDialog.openError(shell, @@ -919,6 +927,7 @@ public final class AvdSelector { // Confirm you want to delete this AVD final boolean[] result = new boolean[1]; display.syncExec(new Runnable() { + @Override public void run() { Shell shell = display.getActiveShell(); result[0] = MessageDialog.openQuestion(shell, @@ -1075,6 +1084,7 @@ public final class AvdSelector { new ProgressTask(mTable.getShell(), "Starting Android Emulator", new ITask() { + @Override public void run(ITaskMonitor monitor) { try { monitor.setDescription( diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java index 7731dc1..edecb17 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java @@ -154,6 +154,7 @@ final class AvdStartDialog extends GridDialog { mScreenSize.setText(getScreenSize()); mScreenSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); mScreenSize.addVerifyListener(new VerifyListener() { + @Override public void verifyText(VerifyEvent event) { // combine the current content and the new text String text = mScreenSize.getText(); @@ -164,6 +165,7 @@ final class AvdStartDialog extends GridDialog { } }); mScreenSize.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent event) { onScaleChange(); } @@ -180,6 +182,7 @@ final class AvdStartDialog extends GridDialog { mMonitorDpi.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL)); gd.widthHint = 50; mMonitorDpi.addVerifyListener(new VerifyListener() { + @Override public void verifyText(VerifyEvent event) { // check for digit only. for (int i = 0 ; i < event.text.length(); i++) { @@ -192,6 +195,7 @@ final class AvdStartDialog extends GridDialog { } }); mMonitorDpi.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent event) { onScaleChange(); } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java index 457d13f..4849e50 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java @@ -62,6 +62,7 @@ public final class MessageBoxLog implements ISdkLog { mLogErrorsOnly = logErrorsOnly; } + @Override public void error(Throwable throwable, String errorFormat, Object... arg) { if (errorFormat != null) { logMessages.add(String.format("Error: " + errorFormat, arg)); @@ -72,12 +73,14 @@ public final class MessageBoxLog implements ISdkLog { } } + @Override public void warning(String warningFormat, Object... arg) { if (!mLogErrorsOnly) { logMessages.add(String.format("Warning: " + warningFormat, arg)); } } + @Override public void printf(String msgFormat, Object... arg) { if (!mLogErrorsOnly) { logMessages.add(String.format(msgFormat, arg)); @@ -110,6 +113,7 @@ public final class MessageBoxLog implements ISdkLog { // dialog box only run in ui thread.. if (mDisplay != null && !mDisplay.isDisposed()) { mDisplay.asyncExec(new Runnable() { + @Override public void run() { // This is typically displayed at the end, so make sure the UI // instances are not disposed. diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java index 3ea09a5..beb9254 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java @@ -153,6 +153,7 @@ public class SdkTargetSelector { mTargets = targets; if (mTargets != null) { Arrays.sort(mTargets, new Comparator<IAndroidTarget>() { + @Override public int compare(IAndroidTarget o1, IAndroidTarget o2) { return o1.compareTo(o2); } @@ -282,6 +283,7 @@ public class SdkTargetSelector { // Add a selection listener that will check/uncheck items when they are double-clicked table.addSelectionListener(new SelectionListener() { /** Default selection means double-click on "most" platforms */ + @Override public void widgetDefaultSelected(SelectionEvent e) { if (e.item instanceof TableItem) { TableItem i = (TableItem) e.item; @@ -295,6 +297,7 @@ public class SdkTargetSelector { } } + @Override public void widgetSelected(SelectionEvent e) { if (e.item instanceof TableItem) { TableItem i = (TableItem) e.item; @@ -382,6 +385,7 @@ public class SdkTargetSelector { */ final Listener listener = new Listener() { + @Override public void handleEvent(Event event) { switch(event.type) { diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java index 06a8c4b..24138bc 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java @@ -52,10 +52,12 @@ public class ToggleButton extends CLabel { updateImageAndTooltip();
addMouseListener(new MouseListener() {
+ @Override
public void mouseDown(MouseEvent e) {
// pass
}
+ @Override
public void mouseUp(MouseEvent e) {
// We select on mouse-up, as it should be properly done since this is the
// only way a user can cancel a button click by moving out of the button.
@@ -64,6 +66,7 @@ public class ToggleButton extends CLabel { }
}
+ @Override
public void mouseDoubleClick(MouseEvent e) {
if (mMouseIn && e.button == 1) {
notifyListeners(SWT.DefaultSelection, new Event());
@@ -72,6 +75,7 @@ public class ToggleButton extends CLabel { });
addMouseTrackListener(new MouseTrackListener() {
+ @Override
public void mouseExit(MouseEvent e) {
if (mMouseIn) {
mMouseIn = false;
@@ -79,6 +83,7 @@ public class ToggleButton extends CLabel { }
}
+ @Override
public void mouseEnter(MouseEvent e) {
if (!mMouseIn) {
mMouseIn = true;
@@ -86,6 +91,7 @@ public class ToggleButton extends CLabel { }
}
+ @Override
public void mouseHover(MouseEvent e) {
// pass
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java index fedb513..07e65b7 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java @@ -92,6 +92,7 @@ public class AuthenticationDialog extends GridDialog { mTxtLogin.setFocus(); mTxtLogin.setText(sLogin); mTxtLogin.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { sLogin = mTxtLogin.getText().trim(); } @@ -108,6 +109,7 @@ public class AuthenticationDialog extends GridDialog { mTxtPassword.setLayoutData(data); mTxtPassword.setText(sPassword); mTxtPassword.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { sPassword = mTxtPassword.getText(); } @@ -131,6 +133,7 @@ public class AuthenticationDialog extends GridDialog { mTxtWorkstation.setLayoutData(data); mTxtWorkstation.setText(sWorkstation); mTxtWorkstation.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { sWorkstation = mTxtWorkstation.getText().trim(); } @@ -147,6 +150,7 @@ public class AuthenticationDialog extends GridDialog { mTxtDomain.setLayoutData(data); mTxtDomain.setText(sDomain); mTxtDomain.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent arg0) { sDomain = mTxtDomain.getText().trim(); } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java index 6bb0cdd..6377ef7 100755 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java @@ -122,6 +122,7 @@ public abstract class SwtBaseDialog extends Dialog { mShell.setText(getText()); } mShell.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { saveSize(); } diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java index 897e012..fff0814 100755 --- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java +++ b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java @@ -86,10 +86,12 @@ public class MockUpdaterData extends UpdaterData { //------------ private class MockTaskFactory implements ITaskFactory { + @Override public void start(String title, ITask task) { start(title, null /*parentMonitor*/, task); } + @Override public void start(String title, ITaskMonitor parentMonitor, ITask task) { new MockTask(task); } diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java index 1bf7799..5d735e3 100755 --- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java +++ b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java @@ -44,30 +44,37 @@ public class UpdaterLogicTest extends TestCase { private static class NullUpdaterData implements IUpdaterData {
+ @Override
public AvdManager getAvdManager() {
return null;
}
+ @Override
public ImageFactory getImageFactory() {
return null;
}
+ @Override
public ISdkLog getSdkLog() {
return null;
}
+ @Override
public SdkManager getSdkManager() {
return null;
}
+ @Override
public SettingsController getSettingsController() {
return null;
}
+ @Override
public ITaskFactory getTaskFactory() {
return null;
}
+ @Override
public Shell getWindowShell() {
return null;
}
|