com.android.ide.eclipse.ddms_22.6.2.201403212018

16:34:11.524 INFO  jd.cli.Main - Decompiling com.android.ide.eclipse.ddms_22.6.2.201403212018.jar
package com.android.ide.eclipse.ddms;

import com.android.ddmuilib.actions.ICommonAction;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;

public class CommonAction
  extends Action
  implements ICommonAction
{
  private Runnable mRunnable;
  
  public CommonAction() {}
  
  public CommonAction(String paramString)
  {
    super(paramString);
  }
  
  public CommonAction(String paramString, ImageDescriptor paramImageDescriptor)
  {
    super(paramString, paramImageDescriptor);
  }
  
  public CommonAction(String paramString, int paramInt)
  {
    super(paramString, paramInt);
  }
  
  public void run()
  {
    if (mRunnable != null) {
      mRunnable.run();
    }
  }
  
  public void setRunnable(Runnable paramRunnable)
  {
    mRunnable = paramRunnable;
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.CommonAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import org.eclipse.ui.console.MessageConsoleStream;

class DdmsPlugin$1
  implements Runnable
{
  DdmsPlugin$1(DdmsPlugin paramDdmsPlugin, MessageConsoleStream paramMessageConsoleStream) {}
  
  public void run()
  {
    val$errorConsoleStream.setColor(DdmsPlugin.access$0(this$0));
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.Log.LogLevel;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

class DdmsPlugin$2$1
  implements Runnable
{
  DdmsPlugin$2$1(DdmsPlugin.2 param2, Display paramDisplay, Log.LogLevel paramLogLevel, String paramString1, String paramString2) {}
  
  public void run()
  {
    Shell localShell = val$display.getActiveShell();
    if (val$logLevel == Log.LogLevel.ERROR) {
      MessageDialog.openError(localShell, val$tag, val$message);
    } else {
      MessageDialog.openWarning(localShell, val$tag, val$message);
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.2.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.console.MessageConsoleStream;

class DdmsPlugin$2
  implements Log.ILogOutput
{
  DdmsPlugin$2(DdmsPlugin paramDdmsPlugin, MessageConsoleStream paramMessageConsoleStream1, MessageConsoleStream paramMessageConsoleStream2, Display paramDisplay) {}
  
  public void printLog(Log.LogLevel paramLogLevel, String paramString1, String paramString2)
  {
    if (paramLogLevel.getPriority() >= Log.LogLevel.ERROR.getPriority())
    {
      DdmsPlugin.access$1(val$errorConsoleStream, paramString1, paramString2);
      DdmsPlugin.access$3(this$0, DdmsPlugin.access$2(this$0));
    }
    else
    {
      DdmsPlugin.access$1(val$consoleStream, paramString1, paramString2);
    }
  }
  
  public void printAndPromptLog(final Log.LogLevel paramLogLevel, final String paramString1, final String paramString2)
  {
    printLog(paramLogLevel, paramString1, paramString2);
    val$display.asyncExec(new Runnable()
    {
      public void run()
      {
        Shell localShell = val$display.getActiveShell();
        if (paramLogLevel == Log.LogLevel.ERROR) {
          MessageDialog.openError(localShell, paramString1, paramString2);
        } else {
          MessageDialog.openWarning(localShell, paramString1, paramString2);
        }
      }
    });
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmuilib.console.IDdmConsole;
import org.eclipse.ui.console.MessageConsoleStream;

class DdmsPlugin$3
  implements IDdmConsole
{
  DdmsPlugin$3(DdmsPlugin paramDdmsPlugin, MessageConsoleStream paramMessageConsoleStream1, MessageConsoleStream paramMessageConsoleStream2) {}
  
  public void printErrorToConsole(String paramString)
  {
    DdmsPlugin.access$1(val$errorConsoleStream, null, paramString);
    DdmsPlugin.access$3(this$0, DdmsPlugin.access$2(this$0));
  }
  
  public void printErrorToConsole(String[] paramArrayOfString)
  {
    String[] arrayOfString;
    int j = (arrayOfString = paramArrayOfString).length;
    for (int i = 0; i < j; i++)
    {
      String str = arrayOfString[i];
      DdmsPlugin.access$1(val$errorConsoleStream, null, str);
    }
    DdmsPlugin.access$3(this$0, DdmsPlugin.access$2(this$0));
  }
  
  public void printToConsole(String paramString)
  {
    DdmsPlugin.access$1(val$consoleStream, null, paramString);
  }
  
  public void printToConsole(String[] paramArrayOfString)
  {
    String[] arrayOfString;
    int j = (arrayOfString = paramArrayOfString).length;
    for (int i = 0; i < j; i++)
    {
      String str = arrayOfString[i];
      DdmsPlugin.access$1(val$consoleStream, null, str);
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.DdmPreferences;
import com.android.ddmuilib.DdmUiPreferences;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class DdmsPlugin$4
  implements IPropertyChangeListener
{
  DdmsPlugin$4(DdmsPlugin paramDdmsPlugin, IPreferenceStore paramIPreferenceStore) {}
  
  public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
  {
    String str = paramPropertyChangeEvent.getProperty();
    if ("com.android.ide.eclipse.ddms.adbDebugBasePort".equals(str)) {
      DdmPreferences.setDebugPortBase(val$eclipseStore.getInt("com.android.ide.eclipse.ddms.adbDebugBasePort"));
    } else if ("com.android.ide.eclipse.ddms.debugSelectedPort".equals(str)) {
      DdmPreferences.setSelectedDebugPort(val$eclipseStore.getInt("com.android.ide.eclipse.ddms.debugSelectedPort"));
    } else if ("com.android.ide.eclipse.ddms.threadStatusInterval".equals(str)) {
      DdmUiPreferences.setThreadRefreshInterval(val$eclipseStore.getInt("com.android.ide.eclipse.ddms.threadStatusInterval"));
    } else if ("com.android.ide.eclipse.ddms.logLevel".equals(str)) {
      DdmPreferences.setLogLevel(val$eclipseStore.getString("com.android.ide.eclipse.ddms.logLevel"));
    } else if ("com.android.ide.eclipse.ddms.timeOut".equals(str)) {
      DdmPreferences.setTimeOut(val$eclipseStore.getInt("com.android.ide.eclipse.ddms.timeOut"));
    } else if ("com.android.ide.eclipse.ddms.useAdbHost".equals(str)) {
      DdmPreferences.setUseAdbHost(val$eclipseStore.getBoolean("com.android.ide.eclipse.ddms.useAdbHost"));
    } else if ("com.android.ide.eclipse.ddms.adbHostValue".equals(str)) {
      DdmPreferences.setAdbHostValue(val$eclipseStore.getString("com.android.ide.eclipse.ddms.adbHostValue"));
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.AndroidDebugBridge;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;

class DdmsPlugin$5
  extends Job
{
  DdmsPlugin$5(DdmsPlugin paramDdmsPlugin, String paramString, IConfigurationElement[] paramArrayOfIConfigurationElement)
  {
    super(paramString);
  }
  
  protected IStatus run(IProgressMonitor paramIProgressMonitor)
  {
    try
    {
      AndroidDebugBridge.init(true);
      IConfigurationElement[] arrayOfIConfigurationElement = this$0.findConfigElements("com.android.ide.eclipse.ddms.toolsLocator");
      IToolsLocator[] arrayOfIToolsLocator1 = DdmsPlugin.access$4(this$0, arrayOfIConfigurationElement);
      IToolsLocator[] arrayOfIToolsLocator2;
      int j = (arrayOfIToolsLocator2 = arrayOfIToolsLocator1).length;
      int i = 0;
      while (i < j)
      {
        IToolsLocator localIToolsLocator = arrayOfIToolsLocator2[i];
        try
        {
          String str1 = localIToolsLocator.getAdbLocation();
          String str2 = localIToolsLocator.getTraceViewLocation();
          String str3 = localIToolsLocator.getHprofConvLocation();
          if ((str1 != null) && (str2 != null) && (str3 != null) && (DdmsPlugin.access$5(str1, str3, str2))) {
            AndroidDebugBridge.createBridge(DdmsPlugin.access$6(), true);
          }
        }
        catch (Throwable localThrowable)
        {
          i++;
        }
      }
      DdmsPlugin.access$8(this$0, DdmsPlugin.access$7(this$0, val$dcce));
      arrayOfIConfigurationElement = this$0.findConfigElements("com.android.ide.eclipse.ddms.traceviewLauncher");
      DdmsPlugin.access$10(this$0, DdmsPlugin.access$9(this$0, arrayOfIConfigurationElement));
      return Status.OK_STATUS;
    }
    catch (CoreException localCoreException)
    {
      return localCoreException.getStatus();
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.5
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.AndroidDebugBridge;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Status;

class DdmsPlugin$6
  extends Thread
{
  public void run()
  {
    try
    {
      AndroidDebugBridge.createBridge(DdmsPlugin.access$6(), false);
    }
    catch (Throwable localThrowable)
    {
      Status localStatus = new Status(4, "com.android.ide.eclipse.ddms", "Failed to create AndroidDebugBridge", localThrowable);
      DdmsPlugin.getDefault().getLog().log(localStatus);
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.6
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.IDevice;
import java.util.ArrayList;
import java.util.Iterator;

class DdmsPlugin$7
  implements Runnable
{
  DdmsPlugin$7(DdmsPlugin paramDdmsPlugin, IDevice paramIDevice) {}
  
  public void run()
  {
    int i = 0;
    Object localObject;
    if (DdmsPlugin.access$11(this$0) != val$device)
    {
      DdmsPlugin.access$12(this$0, val$device);
      i = 1;
      Iterator localIterator = DdmsPlugin.access$13(this$0).iterator();
      while (localIterator.hasNext())
      {
        localObject = (DdmsPlugin.ISelectionListener)localIterator.next();
        ((DdmsPlugin.ISelectionListener)localObject).selectionChanged(DdmsPlugin.access$11(this$0));
      }
    }
    if (val$device != null)
    {
      if ((i != 0) || (DdmsPlugin.access$14(this$0) == null))
      {
        localObject = val$device.getClients();
        if (localObject.length > 0) {
          DdmsPlugin.access$15(this$0, localObject[0]);
        } else {
          DdmsPlugin.access$15(this$0, null);
        }
      }
    }
    else {
      DdmsPlugin.access$15(this$0, null);
    }
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.7
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.Client;
import com.android.ddmlib.IDevice;

public abstract interface DdmsPlugin$ISelectionListener
{
  public abstract void selectionChanged(Client paramClient);
  
  public abstract void selectionChanged(IDevice paramIDevice);
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin.ISelectionListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.annotations.NonNull;
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.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmuilib.DdmUiPreferences;
import com.android.ddmuilib.DevicePanel.IUiSelectionListener;
import com.android.ddmuilib.StackTracePanel;
import com.android.ddmuilib.StackTracePanel.ISourceRevealer;
import com.android.ddmuilib.console.DdmConsole;
import com.android.ddmuilib.console.IDdmConsole;
import com.android.ide.eclipse.ddms.i18n.Messages;
import com.android.ide.eclipse.ddms.preferences.PreferenceInitializer;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public final class DdmsPlugin
  extends AbstractUIPlugin
  implements AndroidDebugBridge.IDeviceChangeListener, DevicePanel.IUiSelectionListener, StackTracePanel.ISourceRevealer
{
  public static final String PLUGIN_ID = "com.android.ide.eclipse.ddms";
  private static DdmsPlugin sPlugin;
  private static String sAdbLocation;
  private static String sToolsFolder;
  private static String sHprofConverter;
  private boolean mHasDebuggerConnectors;
  private IDebuggerConnector[] mDebuggerConnectors;
  private ITraceviewLauncher[] mTraceviewLaunchers;
  private List<IClientAction> mClientSpecificActions = null;
  private MessageConsole mDdmsConsole;
  private IDevice mCurrentDevice;
  private Client mCurrentClient;
  private boolean mListeningToUiSelection = false;
  private final ArrayList<ISelectionListener> mListeners = new ArrayList();
  private Color mRed;
  private LogCatMonitor mLogCatMonitor;
  
  public DdmsPlugin()
  {
    sPlugin = this;
  }
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    final Display localDisplay = getDisplay();
    final IPreferenceStore localIPreferenceStore = getPreferenceStore();
    AndroidDebugBridge.addDeviceChangeListener(this);
    DdmUiPreferences.setStore(localIPreferenceStore);
    mDdmsConsole = new MessageConsole("DDMS", null);
    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { mDdmsConsole });
    final MessageConsoleStream localMessageConsoleStream1 = mDdmsConsole.newMessageStream();
    final MessageConsoleStream localMessageConsoleStream2 = mDdmsConsole.newMessageStream();
    mRed = new Color(localDisplay, 255, 0, 0);
    localDisplay.asyncExec(new Runnable()
    {
      public void run()
      {
        localMessageConsoleStream2.setColor(mRed);
      }
    });
    Log.setLogOutput(new Log.ILogOutput()
    {
      public void printLog(Log.LogLevel paramAnonymousLogLevel, String paramAnonymousString1, String paramAnonymousString2)
      {
        if (paramAnonymousLogLevel.getPriority() >= Log.LogLevel.ERROR.getPriority())
        {
          DdmsPlugin.printToStream(localMessageConsoleStream2, paramAnonymousString1, paramAnonymousString2);
          DdmsPlugin.this.showConsoleView(mDdmsConsole);
        }
        else
        {
          DdmsPlugin.printToStream(localMessageConsoleStream1, paramAnonymousString1, paramAnonymousString2);
        }
      }
      
      public void printAndPromptLog(final Log.LogLevel paramAnonymousLogLevel, final String paramAnonymousString1, final String paramAnonymousString2)
      {
        printLog(paramAnonymousLogLevel, paramAnonymousString1, paramAnonymousString2);
        localDisplay.asyncExec(new Runnable()
        {
          public void run()
          {
            Shell localShell = val$display.getActiveShell();
            if (paramAnonymousLogLevel == Log.LogLevel.ERROR) {
              MessageDialog.openError(localShell, paramAnonymousString1, paramAnonymousString2);
            } else {
              MessageDialog.openWarning(localShell, paramAnonymousString1, paramAnonymousString2);
            }
          }
        });
      }
    });
    DdmConsole.setConsole(new IDdmConsole()
    {
      public void printErrorToConsole(String paramAnonymousString)
      {
        DdmsPlugin.printToStream(localMessageConsoleStream2, null, paramAnonymousString);
        DdmsPlugin.this.showConsoleView(mDdmsConsole);
      }
      
      public void printErrorToConsole(String[] paramAnonymousArrayOfString)
      {
        String[] arrayOfString;
        int j = (arrayOfString = paramAnonymousArrayOfString).length;
        for (int i = 0; i < j; i++)
        {
          String str = arrayOfString[i];
          DdmsPlugin.printToStream(localMessageConsoleStream2, null, str);
        }
        DdmsPlugin.this.showConsoleView(mDdmsConsole);
      }
      
      public void printToConsole(String paramAnonymousString)
      {
        DdmsPlugin.printToStream(localMessageConsoleStream1, null, paramAnonymousString);
      }
      
      public void printToConsole(String[] paramAnonymousArrayOfString)
      {
        String[] arrayOfString;
        int j = (arrayOfString = paramAnonymousArrayOfString).length;
        for (int i = 0; i < j; i++)
        {
          String str = arrayOfString[i];
          DdmsPlugin.printToStream(localMessageConsoleStream1, null, str);
        }
      }
    });
    localIPreferenceStore.addPropertyChangeListener(new IPropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent paramAnonymousPropertyChangeEvent)
      {
        String str = paramAnonymousPropertyChangeEvent.getProperty();
        if ("com.android.ide.eclipse.ddms.adbDebugBasePort".equals(str)) {
          DdmPreferences.setDebugPortBase(localIPreferenceStore.getInt("com.android.ide.eclipse.ddms.adbDebugBasePort"));
        } else if ("com.android.ide.eclipse.ddms.debugSelectedPort".equals(str)) {
          DdmPreferences.setSelectedDebugPort(localIPreferenceStore.getInt("com.android.ide.eclipse.ddms.debugSelectedPort"));
        } else if ("com.android.ide.eclipse.ddms.threadStatusInterval".equals(str)) {
          DdmUiPreferences.setThreadRefreshInterval(localIPreferenceStore.getInt("com.android.ide.eclipse.ddms.threadStatusInterval"));
        } else if ("com.android.ide.eclipse.ddms.logLevel".equals(str)) {
          DdmPreferences.setLogLevel(localIPreferenceStore.getString("com.android.ide.eclipse.ddms.logLevel"));
        } else if ("com.android.ide.eclipse.ddms.timeOut".equals(str)) {
          DdmPreferences.setTimeOut(localIPreferenceStore.getInt("com.android.ide.eclipse.ddms.timeOut"));
        } else if ("com.android.ide.eclipse.ddms.useAdbHost".equals(str)) {
          DdmPreferences.setUseAdbHost(localIPreferenceStore.getBoolean("com.android.ide.eclipse.ddms.useAdbHost"));
        } else if ("com.android.ide.eclipse.ddms.adbHostValue".equals(str)) {
          DdmPreferences.setAdbHostValue(localIPreferenceStore.getString("com.android.ide.eclipse.ddms.adbHostValue"));
        }
      }
    });
    PreferenceInitializer.setupPreferences();
    StackTracePanel.setSourceRevealer(this);
    final IConfigurationElement[] arrayOfIConfigurationElement = findConfigElements("com.android.ide.eclipse.ddms.debuggerConnector");
    mHasDebuggerConnectors = (arrayOfIConfigurationElement.length > 0);
    new Job(Messages.DdmsPlugin_DDMS_Post_Create_Init)
    {
      protected IStatus run(IProgressMonitor paramAnonymousIProgressMonitor)
      {
        try
        {
          AndroidDebugBridge.init(true);
          IConfigurationElement[] arrayOfIConfigurationElement = findConfigElements("com.android.ide.eclipse.ddms.toolsLocator");
          IToolsLocator[] arrayOfIToolsLocator1 = DdmsPlugin.this.instantiateToolsLocators(arrayOfIConfigurationElement);
          IToolsLocator[] arrayOfIToolsLocator2;
          int j = (arrayOfIToolsLocator2 = arrayOfIToolsLocator1).length;
          int i = 0;
          while (i < j)
          {
            IToolsLocator localIToolsLocator = arrayOfIToolsLocator2[i];
            try
            {
              String str1 = localIToolsLocator.getAdbLocation();
              String str2 = localIToolsLocator.getTraceViewLocation();
              String str3 = localIToolsLocator.getHprofConvLocation();
              if ((str1 != null) && (str2 != null) && (str3 != null) && (DdmsPlugin.setToolsLocation(str1, str3, str2))) {
                AndroidDebugBridge.createBridge(DdmsPlugin.sAdbLocation, true);
              }
            }
            catch (Throwable localThrowable)
            {
              i++;
            }
          }
          mDebuggerConnectors = DdmsPlugin.this.instantiateDebuggerConnectors(arrayOfIConfigurationElement);
          arrayOfIConfigurationElement = findConfigElements("com.android.ide.eclipse.ddms.traceviewLauncher");
          mTraceviewLaunchers = DdmsPlugin.this.instantiateTraceviewLauncher(arrayOfIConfigurationElement);
          return Status.OK_STATUS;
        }
        catch (CoreException localCoreException)
        {
          return localCoreException.getStatus();
        }
      }
    }.schedule();
  }
  
  private void showConsoleView(MessageConsole paramMessageConsole)
  {
    ConsolePlugin.getDefault().getConsoleManager().showConsoleView(paramMessageConsole);
  }
  
  IConfigurationElement[] findConfigElements(String paramString)
  {
    IExtensionRegistry localIExtensionRegistry = Platform.getExtensionRegistry();
    IExtensionPoint localIExtensionPoint = localIExtensionRegistry.getExtensionPoint(paramString);
    if (localIExtensionPoint != null) {
      return localIExtensionPoint.getConfigurationElements();
    }
    return new IConfigurationElement[0];
  }
  
  private IToolsLocator[] instantiateToolsLocators(IConfigurationElement[] paramArrayOfIConfigurationElement)
    throws CoreException
  {
    ArrayList localArrayList = new ArrayList();
    if (paramArrayOfIConfigurationElement.length > 0)
    {
      IConfigurationElement localIConfigurationElement = paramArrayOfIConfigurationElement[0];
      Object localObject = localIConfigurationElement.createExecutableExtension("class");
      if ((localObject instanceof IToolsLocator)) {
        localArrayList.add((IToolsLocator)localObject);
      }
    }
    return (IToolsLocator[])localArrayList.toArray(new IToolsLocator[localArrayList.size()]);
  }
  
  private IDebuggerConnector[] instantiateDebuggerConnectors(IConfigurationElement[] paramArrayOfIConfigurationElement)
    throws CoreException
  {
    ArrayList localArrayList = new ArrayList();
    if (paramArrayOfIConfigurationElement.length > 0)
    {
      IConfigurationElement localIConfigurationElement = paramArrayOfIConfigurationElement[0];
      Object localObject = localIConfigurationElement.createExecutableExtension("class");
      if ((localObject instanceof IDebuggerConnector)) {
        localArrayList.add((IDebuggerConnector)localObject);
      }
    }
    return (IDebuggerConnector[])localArrayList.toArray(new IDebuggerConnector[localArrayList.size()]);
  }
  
  private ITraceviewLauncher[] instantiateTraceviewLauncher(IConfigurationElement[] paramArrayOfIConfigurationElement)
    throws CoreException
  {
    ArrayList localArrayList = new ArrayList();
    if (paramArrayOfIConfigurationElement.length > 0)
    {
      IConfigurationElement localIConfigurationElement = paramArrayOfIConfigurationElement[0];
      Object localObject = localIConfigurationElement.createExecutableExtension("class");
      if ((localObject instanceof ITraceviewLauncher)) {
        localArrayList.add((ITraceviewLauncher)localObject);
      }
    }
    return (ITraceviewLauncher[])localArrayList.toArray(new ITraceviewLauncher[localArrayList.size()]);
  }
  
  private List<IClientAction> instantiateClientSpecificActions(IConfigurationElement[] paramArrayOfIConfigurationElement)
    throws CoreException
  {
    if ((paramArrayOfIConfigurationElement == null) || (paramArrayOfIConfigurationElement.length == 0)) {
      return Collections.emptyList();
    }
    ArrayList localArrayList = new ArrayList(1);
    IConfigurationElement[] arrayOfIConfigurationElement;
    int j = (arrayOfIConfigurationElement = paramArrayOfIConfigurationElement).length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement localIConfigurationElement = arrayOfIConfigurationElement[i];
      Object localObject = localIConfigurationElement.createExecutableExtension("class");
      if ((localObject instanceof IClientAction)) {
        localArrayList.add((IClientAction)localObject);
      }
    }
    return localArrayList;
  }
  
  public static Display getDisplay()
  {
    IWorkbench localIWorkbench = sPlugin.getWorkbench();
    if (localIWorkbench != null) {
      return localIWorkbench.getDisplay();
    }
    return null;
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    AndroidDebugBridge.removeDeviceChangeListener(this);
    AndroidDebugBridge.terminate();
    mRed.dispose();
    sPlugin = null;
    super.stop(paramBundleContext);
  }
  
  public static DdmsPlugin getDefault()
  {
    return sPlugin;
  }
  
  public static String getAdb()
  {
    return sAdbLocation;
  }
  
  public static File getPlatformToolsFolder()
  {
    return new File(sAdbLocation).getParentFile();
  }
  
  public static String getToolsFolder()
  {
    return sToolsFolder;
  }
  
  public static String getHprofConverter()
  {
    return sHprofConverter;
  }
  
  private static boolean setToolsLocation(String paramString1, String paramString2, String paramString3)
  {
    File localFile1 = new File(paramString1);
    File localFile2 = new File(paramString2);
    File localFile3 = new File(paramString3);
    String str1 = "";
    if (!localFile1.isFile()) {
      str1 = str1 + localFile1.getAbsolutePath() + " ";
    }
    if (!localFile2.isFile()) {
      str1 = str1 + localFile2.getAbsolutePath() + " ";
    }
    if (!localFile3.isFile()) {
      str1 = str1 + localFile3.getAbsolutePath() + " ";
    }
    if (str1.length() > 0)
    {
      String str2 = String.format("DDMS files not found: %1$s", new Object[] { str1 });
      Log.e("DDMS", str2);
      Status localStatus = new Status(4, "com.android.ide.eclipse.ddms", str2, null);
      getDefault().getLog().log(localStatus);
      return false;
    }
    sAdbLocation = paramString1;
    sHprofConverter = localFile2.getAbsolutePath();
    DdmUiPreferences.setTraceviewLocation(localFile3.getAbsolutePath());
    sToolsFolder = localFile3.getParent();
    return true;
  }
  
  public static void setToolsLocation(String paramString1, boolean paramBoolean, String paramString2, String paramString3)
  {
    if ((setToolsLocation(paramString1, paramString2, paramString3)) && (paramBoolean)) {
      new Thread()
      {
        public void run()
        {
          try
          {
            AndroidDebugBridge.createBridge(DdmsPlugin.sAdbLocation, false);
          }
          catch (Throwable localThrowable)
          {
            Status localStatus = new Status(4, "com.android.ide.eclipse.ddms", "Failed to create AndroidDebugBridge", localThrowable);
            DdmsPlugin.getDefault().getLog().log(localStatus);
          }
        }
      }.start();
    }
  }
  
  public boolean hasDebuggerConnectors()
  {
    return mHasDebuggerConnectors;
  }
  
  public IDebuggerConnector[] getDebuggerConnectors()
  {
    return mDebuggerConnectors;
  }
  
  public synchronized void addSelectionListener(ISelectionListener paramISelectionListener)
  {
    mListeners.add(paramISelectionListener);
    paramISelectionListener.selectionChanged(mCurrentDevice);
    paramISelectionListener.selectionChanged(mCurrentClient);
  }
  
  public synchronized void removeSelectionListener(ISelectionListener paramISelectionListener)
  {
    mListeners.remove(paramISelectionListener);
  }
  
  public synchronized void setListeningState(boolean paramBoolean)
  {
    mListeningToUiSelection = paramBoolean;
  }
  
  public void deviceConnected(IDevice paramIDevice)
  {
    if ((!mListeningToUiSelection) && (mCurrentDevice == null)) {
      handleDefaultSelection(paramIDevice);
    }
  }
  
  public void deviceDisconnected(IDevice paramIDevice)
  {
    if ((!mListeningToUiSelection) && (mCurrentDevice == paramIDevice))
    {
      AndroidDebugBridge localAndroidDebugBridge = AndroidDebugBridge.getBridge();
      if (localAndroidDebugBridge != null)
      {
        IDevice[] arrayOfIDevice = localAndroidDebugBridge.getDevices();
        if (arrayOfIDevice.length == 0) {
          handleDefaultSelection(null);
        } else {
          handleDefaultSelection(arrayOfIDevice[0]);
        }
      }
      else
      {
        handleDefaultSelection(null);
      }
    }
  }
  
  public void deviceChanged(IDevice paramIDevice, int paramInt)
  {
    if ((!mListeningToUiSelection) && (paramIDevice == mCurrentDevice)) {
      if (mCurrentClient == null)
      {
        handleDefaultSelection(paramIDevice);
      }
      else
      {
        Client[] arrayOfClient1 = paramIDevice.getClients();
        int i = 0;
        Client[] arrayOfClient2;
        int k = (arrayOfClient2 = arrayOfClient1).length;
        for (int j = 0; j < k; j++)
        {
          Client localClient = arrayOfClient2[j];
          if (localClient == mCurrentClient)
          {
            i = 1;
            break;
          }
        }
        if (i == 0)
        {
          mCurrentClient = null;
          handleDefaultSelection(paramIDevice);
        }
      }
    }
  }
  
  public synchronized void selectionChanged(IDevice paramIDevice, Client paramClient)
  {
    Iterator localIterator;
    ISelectionListener localISelectionListener;
    if (mCurrentDevice != paramIDevice)
    {
      mCurrentDevice = paramIDevice;
      localIterator = mListeners.iterator();
      while (localIterator.hasNext())
      {
        localISelectionListener = (ISelectionListener)localIterator.next();
        localISelectionListener.selectionChanged(mCurrentDevice);
      }
    }
    if (mCurrentClient != paramClient)
    {
      mCurrentClient = paramClient;
      localIterator = mListeners.iterator();
      while (localIterator.hasNext())
      {
        localISelectionListener = (ISelectionListener)localIterator.next();
        localISelectionListener.selectionChanged(mCurrentClient);
      }
    }
  }
  
  private void handleDefaultSelection(final IDevice paramIDevice)
  {
    try
    {
      Display localDisplay = getDisplay();
      localDisplay.asyncExec(new Runnable()
      {
        public void run()
        {
          int i = 0;
          Object localObject;
          if (mCurrentDevice != paramIDevice)
          {
            mCurrentDevice = paramIDevice;
            i = 1;
            Iterator localIterator = mListeners.iterator();
            while (localIterator.hasNext())
            {
              localObject = (DdmsPlugin.ISelectionListener)localIterator.next();
              ((DdmsPlugin.ISelectionListener)localObject).selectionChanged(mCurrentDevice);
            }
          }
          if (paramIDevice != null)
          {
            if ((i != 0) || (mCurrentClient == null))
            {
              localObject = paramIDevice.getClients();
              if (localObject.length > 0) {
                DdmsPlugin.this.handleDefaultSelection(localObject[0]);
              } else {
                DdmsPlugin.this.handleDefaultSelection(null);
              }
            }
          }
          else {
            DdmsPlugin.this.handleDefaultSelection(null);
          }
        }
      });
    }
    catch (SWTException localSWTException) {}
  }
  
  private void handleDefaultSelection(Client paramClient)
  {
    mCurrentClient = paramClient;
    Iterator localIterator = mListeners.iterator();
    while (localIterator.hasNext())
    {
      ISelectionListener localISelectionListener = (ISelectionListener)localIterator.next();
      localISelectionListener.selectionChanged(mCurrentClient);
    }
  }
  
  private static synchronized void printToStream(MessageConsoleStream paramMessageConsoleStream, String paramString1, String paramString2)
  {
    String str = getMessageTag(paramString1);
    paramMessageConsoleStream.print(str);
    if (!str.endsWith(" ")) {
      paramMessageConsoleStream.print(" ");
    }
    paramMessageConsoleStream.println(paramString2);
  }
  
  private static String getMessageTag(String paramString)
  {
    Calendar localCalendar = Calendar.getInstance();
    if (paramString == null) {
      return String.format(Messages.DdmsPlugin_Message_Tag_Mask_1, new Object[] { localCalendar });
    }
    return String.format(Messages.DdmsPlugin_Message_Tag_Mask_2, new Object[] { localCalendar, paramString });
  }
  
  public void reveal(String paramString1, String paramString2, int paramInt)
  {
    JavaSourceRevealer.reveal(paramString1, paramString2, paramInt);
  }
  
  public boolean launchTraceview(String paramString)
  {
    if (mTraceviewLaunchers != null)
    {
      ITraceviewLauncher[] arrayOfITraceviewLauncher;
      int j = (arrayOfITraceviewLauncher = mTraceviewLaunchers).length;
      int i = 0;
      while (i < j)
      {
        ITraceviewLauncher localITraceviewLauncher = arrayOfITraceviewLauncher[i];
        try
        {
          if (localITraceviewLauncher.openFile(paramString)) {
            return true;
          }
        }
        catch (Throwable localThrowable)
        {
          i++;
        }
      }
    }
    return false;
  }
  
  @NonNull
  public synchronized List<IClientAction> getClientSpecificActions()
  {
    if (mClientSpecificActions == null)
    {
      IConfigurationElement[] arrayOfIConfigurationElement = findConfigElements("com.android.ide.eclipse.ddms.clientAction");
      try
      {
        mClientSpecificActions = instantiateClientSpecificActions(arrayOfIConfigurationElement);
      }
      catch (CoreException localCoreException)
      {
        mClientSpecificActions = Collections.emptyList();
      }
    }
    return mClientSpecificActions;
  }
  
  public void startLogCatMonitor(IDevice paramIDevice)
  {
    if (mLogCatMonitor == null) {
      mLogCatMonitor = new LogCatMonitor(getDebuggerConnectors(), getPreferenceStore());
    }
    mLogCatMonitor.monitorDevice(paramIDevice);
  }
  
  public static ImageDescriptor getImageDescriptor(String paramString)
  {
    return imageDescriptorFromPlugin("com.android.ide.eclipse.ddms", paramString);
  }
  
  public static abstract interface ISelectionListener
  {
    public abstract void selectionChanged(Client paramClient);
    
    public abstract void selectionChanged(IDevice paramIDevice);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.DdmsPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import com.android.ddmlib.Client;
import org.eclipse.jface.action.Action;

public abstract interface IClientAction
{
  public abstract Action getAction();
  
  public abstract void selectedClientChanged(Client paramClient);
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.IClientAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

public abstract interface IDebuggerConnector
{
  public abstract boolean isWorkspaceApp(String paramString);
  
  public abstract boolean connectDebugger(String paramString, int paramInt1, int paramInt2);
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.IDebuggerConnector
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

public abstract interface ISourceRevealer
{
  public abstract boolean reveal(String paramString1, String paramString2, int paramInt);
  
  public abstract boolean revealMethod(String paramString1, String paramString2, int paramInt, String paramString3);
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.ISourceRevealer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

public abstract interface IToolsLocator
{
  public abstract String getAdbLocation();
  
  public abstract String getTraceViewLocation();
  
  public abstract String getHprofConvLocation();
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.IToolsLocator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

public abstract interface ITraceviewLauncher
{
  public abstract boolean openFile(String paramString);
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.ddms.ITraceviewLauncher
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.ddms;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;

public class JavaSourceRevealer
{
  private static final String SOURCE_REVEALER_EXTENSION_ID = "com.android.ide.eclipse.ddms.sourceRevealer";
  private static List<ISourceRevealer> sSourceRevealers = ;
  
  private static List<ISourceRevealer> instantiateSourceRevealers()
  {
    IConfigurationElement[] arrayOfIConfigurationElement1 = DdmsPlugin.getDefault().findConfigElements("com.android.ide.eclipse.ddms.sourceRevealer");
    ArrayList localArrayList = new ArrayList();
    IConfigurationElement[] arrayOfIConfigurationElement2 = arrayOfIConfigurationElement1;
    int j = arrayOfIConfigurationElement1.length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement localIConfigurationElement = arrayOfIConfigurationElement2[i];
      Object localObject = null;
      try
      {
        localObject = localIConfigurationElement.createExecutableExtension("class");
      }
      catch (CoreException localCoreException) {}
      if ((localObject instanceof ISourceRevealer)) {
        localArrayList.add((ISourceRevealer)localObject);
      }
    }
    return localArrayList;
  }
  
  public static boolean reveal(String paramString1, String paramString2, int paramInt)
  {
    Iterator localIterator = sSourceRevealers.iterator();
    while (localIterator.hasNext())
    {
      ISourceRevealer localISourceRevealer = (ISourceRevealer)localIterator.next();
      try
      {
        if (localISourceRevealer.reveal(paramString1, paramString2, paramInt)) {
          return true;
        }
      }
      catch (Throwable localThrowable) {}
    }
    return false;
  }
  
  public static boo
1 2 3 4 5 6 7 8

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd