com.android.ide.eclipse.hierarchyviewer_22.6.2.201403212018

16:34:16.675 INFO  jd.cli.Main - Decompiling com.android.ide.eclipse.hierarchyviewer_22.6.2.201403212018.jar
package com.android.ide.eclipse.hierarchyviewer;

import org.eclipse.ui.console.MessageConsoleStream;

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

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

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 HierarchyViewerPlugin$2$1
  implements Runnable
{
  HierarchyViewerPlugin$2$1(HierarchyViewerPlugin.2 param2, Log.LogLevel paramLogLevel, String paramString1, String paramString2) {}
  
  public void run()
  {
    Shell localShell = Display.getDefault().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.hierarchyviewer.HierarchyViewerPlugin.2.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.android.ide.eclipse.hierarchyviewer;

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.ConsolePlugin;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;

class HierarchyViewerPlugin$2
  implements Log.ILogOutput
{
  HierarchyViewerPlugin$2(HierarchyViewerPlugin paramHierarchyViewerPlugin, MessageConsoleStream paramMessageConsoleStream1, MessageConsole paramMessageConsole, MessageConsoleStream paramMessageConsoleStream2) {}
  
  public void printLog(Log.LogLevel paramLogLevel, String paramString1, String paramString2)
  {
    if (paramLogLevel.getPriority() >= Log.LogLevel.ERROR.getPriority())
    {
      HierarchyViewerPlugin.access$1(val$errorConsoleStream, paramString1, paramString2);
      ConsolePlugin.getDefault().getConsoleManager().showConsoleView(val$messageConsole);
    }
    else
    {
      HierarchyViewerPlugin.access$1(val$consoleStream, paramString1, paramString2);
    }
  }
  
  public void printAndPromptLog(final Log.LogLevel paramLogLevel, final String paramString1, final String paramString2)
  {
    printLog(paramLogLevel, paramString1, paramString2);
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        Shell localShell = Display.getDefault().getActiveShell();
        if (paramLogLevel == Log.LogLevel.ERROR) {
          MessageDialog.openError(localShell, paramString1, paramString2);
        } else {
          MessageDialog.openWarning(localShell, paramString1, paramString2);
        }
      }
    });
  }
}

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

import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;

class HierarchyViewerPlugin$3
  implements AndroidDebugBridge.IDebugBridgeChangeListener
{
  HierarchyViewerPlugin$3(HierarchyViewerPlugin paramHierarchyViewerPlugin, HierarchyViewerDirector paramHierarchyViewerDirector) {}
  
  public void bridgeChanged(AndroidDebugBridge paramAndroidDebugBridge)
  {
    val$director.acquireBridge(paramAndroidDebugBridge);
  }
}

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

import com.android.hierarchyviewerlib.HierarchyViewerDirector;

class HierarchyViewerPlugin$4
  extends Thread
{
  HierarchyViewerPlugin$4(HierarchyViewerPlugin paramHierarchyViewerPlugin, HierarchyViewerDirector paramHierarchyViewerDirector) {}
  
  public void run()
  {
    val$director.populateDeviceSelectionModel();
  }
}

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

import com.android.ddmlib.AndroidDebugBridge;
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;
import java.util.Calendar;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
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 class HierarchyViewerPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "com.android.ide.eclipse.hierarchyviewer";
  public static final String ADB_LOCATION = "com.android.ide.eclipse.hierarchyviewer.adb";
  private static HierarchyViewerPlugin sPlugin;
  private Color mRedColor;
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    sPlugin = this;
    final MessageConsole localMessageConsole = new MessageConsole("Hierarchy Viewer", null);
    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { localMessageConsole });
    final MessageConsoleStream localMessageConsoleStream1 = localMessageConsole.newMessageStream();
    final MessageConsoleStream localMessageConsoleStream2 = localMessageConsole.newMessageStream();
    mRedColor = new Color(Display.getDefault(), 255, 0, 0);
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        localMessageConsoleStream2.setColor(mRedColor);
      }
    });
    Log.setLogOutput(new Log.ILogOutput()
    {
      public void printLog(Log.LogLevel paramAnonymousLogLevel, String paramAnonymousString1, String paramAnonymousString2)
      {
        if (paramAnonymousLogLevel.getPriority() >= Log.LogLevel.ERROR.getPriority())
        {
          HierarchyViewerPlugin.printToStream(localMessageConsoleStream2, paramAnonymousString1, paramAnonymousString2);
          ConsolePlugin.getDefault().getConsoleManager().showConsoleView(localMessageConsole);
        }
        else
        {
          HierarchyViewerPlugin.printToStream(localMessageConsoleStream1, paramAnonymousString1, paramAnonymousString2);
        }
      }
      
      public void printAndPromptLog(final Log.LogLevel paramAnonymousLogLevel, final String paramAnonymousString1, final String paramAnonymousString2)
      {
        printLog(paramAnonymousLogLevel, paramAnonymousString1, paramAnonymousString2);
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            Shell localShell = Display.getDefault().getActiveShell();
            if (paramAnonymousLogLevel == Log.LogLevel.ERROR) {
              MessageDialog.openError(localShell, paramAnonymousString1, paramAnonymousString2);
            } else {
              MessageDialog.openWarning(localShell, paramAnonymousString1, paramAnonymousString2);
            }
          }
        });
      }
    });
    final HierarchyViewerDirector localHierarchyViewerDirector = HierarchyViewerPluginDirector.createDirector();
    localHierarchyViewerDirector.startListenForDevices();
    AndroidDebugBridge.addDebugBridgeChangeListener(new AndroidDebugBridge.IDebugBridgeChangeListener()
    {
      public void bridgeChanged(AndroidDebugBridge paramAnonymousAndroidDebugBridge)
      {
        localHierarchyViewerDirector.acquireBridge(paramAnonymousAndroidDebugBridge);
      }
    });
    localHierarchyViewerDirector.acquireBridge(AndroidDebugBridge.getBridge());
    new Thread()
    {
      public void run()
      {
        localHierarchyViewerDirector.populateDeviceSelectionModel();
      }
    }.start();
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    sPlugin = null;
    super.stop(paramBundleContext);
    mRedColor.dispose();
    HierarchyViewerDirector localHierarchyViewerDirector = HierarchyViewerDirector.getDirector();
    localHierarchyViewerDirector.stopListenForDevices();
    localHierarchyViewerDirector.stopDebugBridge();
    localHierarchyViewerDirector.terminate();
  }
  
  public static HierarchyViewerPlugin getPlugin()
  {
    return sPlugin;
  }
  
  private static synchronized void printToStream(MessageConsoleStream paramMessageConsoleStream, String paramString1, String paramString2)
  {
    String str = getMessageTag(paramString1);
    paramMessageConsoleStream.print(str);
    paramMessageConsoleStream.println(paramString2);
  }
  
  private static String getMessageTag(String paramString)
  {
    Calendar localCalendar = Calendar.getInstance();
    if (paramString == null) {
      return String.format("[%1$tF %1$tT]", new Object[] { localCalendar });
    }
    return String.format("[%1$tF %1$tT - %2$s]", new Object[] { localCalendar, paramString });
  }
}

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

import org.eclipse.core.runtime.jobs.ISchedulingRule;

class HierarchyViewerPluginDirector$1
  implements ISchedulingRule
{
  HierarchyViewerPluginDirector$1(HierarchyViewerPluginDirector paramHierarchyViewerPluginDirector) {}
  
  public boolean contains(ISchedulingRule paramISchedulingRule)
  {
    return paramISchedulingRule == this;
  }
  
  public boolean isConflicting(ISchedulingRule paramISchedulingRule)
  {
    return paramISchedulingRule == this;
  }
}

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

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 HierarchyViewerPluginDirector$2
  extends Job
{
  HierarchyViewerPluginDirector$2(HierarchyViewerPluginDirector paramHierarchyViewerPluginDirector, String paramString, Runnable paramRunnable)
  {
    super(paramString);
  }
  
  protected IStatus run(IProgressMonitor paramIProgressMonitor)
  {
    val$task.run();
    return Status.OK_STATUS;
  }
}

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

import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.device.IHvDevice;
import com.android.hierarchyviewerlib.models.Window;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;

public class HierarchyViewerPluginDirector
  extends HierarchyViewerDirector
{
  private ISchedulingRule mSchedulingRule = new ISchedulingRule()
  {
    public boolean contains(ISchedulingRule paramAnonymousISchedulingRule)
    {
      return paramAnonymousISchedulingRule == this;
    }
    
    public boolean isConflicting(ISchedulingRule paramAnonymousISchedulingRule)
    {
      return paramAnonymousISchedulingRule == this;
    }
  };
  
  public static HierarchyViewerDirector createDirector()
  {
    return sDirector = new HierarchyViewerPluginDirector();
  }
  
  public void executeInBackground(String paramString, final Runnable paramRunnable)
  {
    Job local2 = new Job(paramString)
    {
      protected IStatus run(IProgressMonitor paramAnonymousIProgressMonitor)
      {
        paramRunnable.run();
        return Status.OK_STATUS;
      }
    };
    local2.setPriority(20);
    local2.setRule(mSchedulingRule);
    local2.schedule();
  }
  
  public String getAdbLocation()
  {
    return HierarchyViewerPlugin.getPlugin().getPreferenceStore().getString("com.android.ide.eclipse.hierarchyviewer.adb");
  }
  
  public void loadViewTreeData(Window paramWindow)
  {
    super.loadViewTreeData(paramWindow);
    IWorkbenchWindow[] arrayOfIWorkbenchWindow1 = HierarchyViewerPlugin.getPlugin().getWorkbench().getWorkbenchWindows();
    IWorkbenchWindow[] arrayOfIWorkbenchWindow2;
    int j = (arrayOfIWorkbenchWindow2 = arrayOfIWorkbenchWindow1).length;
    for (int i = 0; i < j; i++)
    {
      IWorkbenchWindow localIWorkbenchWindow = arrayOfIWorkbenchWindow2[i];
      IWorkbenchPage localIWorkbenchPage = localIWorkbenchWindow.getActivePage();
      if (localIWorkbenchPage.getPerspective().getId().equals("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective")) {
        try
        {
          IViewPart localIViewPart = localIWorkbenchPage.findView("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
          if (localIViewPart != null) {
            localIWorkbenchPage.showView("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
          }
        }
        catch (PartInitException localPartInitException) {}
      }
    }
  }
  
  public void loadPixelPerfectData(IHvDevice paramIHvDevice)
  {
    super.loadPixelPerfectData(paramIHvDevice);
    IWorkbenchWindow[] arrayOfIWorkbenchWindow1 = HierarchyViewerPlugin.getPlugin().getWorkbench().getWorkbenchWindows();
    IWorkbenchWindow[] arrayOfIWorkbenchWindow2;
    int j = (arrayOfIWorkbenchWindow2 = arrayOfIWorkbenchWindow1).length;
    for (int i = 0; i < j; i++)
    {
      IWorkbenchWindow localIWorkbenchWindow = arrayOfIWorkbenchWindow2[i];
      IWorkbenchPage localIWorkbenchPage = localIWorkbenchWindow.getActivePage();
      if (localIWorkbenchPage.getPerspective().getId().equals("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective")) {
        try
        {
          IViewPart localIViewPart = localIWorkbenchPage.findView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
          if (localIViewPart != null) {
            localIWorkbenchPage.showView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
          }
        }
        catch (PartInitException localPartInitException) {}
      }
    }
  }
}

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

import com.android.ide.eclipse.ddms.Perspective;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class PixelPerfectPespective
  implements IPerspectiveFactory
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective";
  
  public void createInitialLayout(IPageLayout paramIPageLayout)
  {
    paramIPageLayout.setEditorAreaVisible(false);
    String str = paramIPageLayout.getEditorArea();
    IFolderLayout localIFolderLayout = paramIPageLayout.createFolder("tree", 1, 0.25F, str);
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
    localIFolderLayout = paramIPageLayout.createFolder("overview", 2, 0.4F, str);
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView");
    localIFolderLayout = paramIPageLayout.createFolder("main", 2, 0.35F, str);
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView");
    paramIPageLayout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective");
    paramIPageLayout.addPerspectiveShortcut("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective");
    paramIPageLayout.addPerspectiveShortcut(Perspective.ID);
  }
}

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

import com.android.ide.eclipse.ddms.Perspective;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class TreeViewPerspective
  implements IPerspectiveFactory
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective";
  
  public void createInitialLayout(IPageLayout paramIPageLayout)
  {
    paramIPageLayout.setEditorAreaVisible(false);
    String str = paramIPageLayout.getEditorArea();
    IFolderLayout localIFolderLayout = paramIPageLayout.createFolder("properties", 1, 0.1F, str);
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
    localIFolderLayout = paramIPageLayout.createFolder("main", 2, 0.24F, "properties");
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.TreeViewView");
    localIFolderLayout = paramIPageLayout.createFolder("panel-top", 2, 0.7F, "main");
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.TreeOverviewView");
    localIFolderLayout = paramIPageLayout.createFolder("panel-bottom", 4, 0.5F, "panel-top");
    localIFolderLayout.addView("com.android.ide.eclipse.hierarchyviewer.views.LayoutView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.PropertyView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.TreeOverviewView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.LayoutView");
    paramIPageLayout.addShowViewShortcut("com.android.ide.eclipse.hierarchyviewer.views.TreeViewView");
    paramIPageLayout.addPerspectiveShortcut("org.eclipse.jdt.ui.JavaPerspective");
    paramIPageLayout.addPerspectiveShortcut("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective");
    paramIPageLayout.addPerspectiveShortcut(Perspective.ID);
  }
}

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

import com.android.hierarchyviewerlib.actions.InspectScreenshotAction;
import com.android.hierarchyviewerlib.actions.LoadViewHierarchyAction;
import com.android.hierarchyviewerlib.actions.RefreshWindowsAction;
import com.android.hierarchyviewerlib.ui.DeviceSelector;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IPerspectiveListener;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.ViewPart;

public class DeviceSelectorView
  extends ViewPart
  implements IPerspectiveListener
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView";
  private DeviceSelector mDeviceSelector;
  
  public void createPartControl(Composite paramComposite)
  {
    paramComposite.setLayout(new FillLayout());
    IPerspectiveDescriptor localIPerspectiveDescriptor = getViewSite().getPage().getPerspective();
    boolean bool1 = true;
    boolean bool2 = true;
    if (localIPerspectiveDescriptor.getId().equals("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective")) {
      bool1 = false;
    } else if (localIPerspectiveDescriptor.getId().equals("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective")) {
      bool2 = false;
    }
    mDeviceSelector = new DeviceSelector(paramComposite, bool1, bool2);
    placeActions(bool1, bool2);
    getViewSite().getWorkbenchWindow().addPerspectiveListener(this);
  }
  
  public void dispose()
  {
    super.dispose();
    getViewSite().getWorkbenchWindow().removePerspectiveListener(this);
  }
  
  private void placeActions(boolean paramBoolean1, boolean paramBoolean2)
  {
    IActionBars localIActionBars = getViewSite().getActionBars();
    IMenuManager localIMenuManager = localIActionBars.getMenuManager();
    localIMenuManager.removeAll();
    localIMenuManager.add(RefreshWindowsAction.getAction());
    IToolBarManager localIToolBarManager = localIActionBars.getToolBarManager();
    localIToolBarManager.removeAll();
    localIToolBarManager.add(RefreshWindowsAction.getAction());
    if (paramBoolean1)
    {
      localIMenuManager.add(LoadViewHierarchyAction.getAction());
      localIToolBarManager.add(LoadViewHierarchyAction.getAction());
    }
    if (paramBoolean2)
    {
      localIMenuManager.add(InspectScreenshotAction.getAction());
      localIToolBarManager.add(InspectScreenshotAction.getAction());
    }
    localIMenuManager.updateAll(true);
    localIToolBarManager.update(true);
    localIActionBars.updateActionBars();
  }
  
  public void setFocus()
  {
    mDeviceSelector.setFocus();
  }
  
  public void perspectiveActivated(IWorkbenchPage paramIWorkbenchPage, IPerspectiveDescriptor paramIPerspectiveDescriptor)
  {
    if (paramIPerspectiveDescriptor.getId().equals("com.android.ide.eclipse.hierarchyviewer.PixelPerfectPespective"))
    {
      mDeviceSelector.setMode(false, true);
      placeActions(false, true);
    }
    else if (paramIPerspectiveDescriptor.getId().equals("com.android.ide.eclipse.hierarchyviewer.TreeViewPerspective"))
    {
      mDeviceSelector.setMode(true, false);
      placeActions(true, false);
    }
    else
    {
      mDeviceSelector.setMode(true, true);
      placeActions(true, true);
    }
  }
  
  public void perspectiveChanged(IWorkbenchPage paramIWorkbenchPage, IPerspectiveDescriptor paramIPerspectiveDescriptor, String paramString) {}
}

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

import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;

class LayoutView$1
  extends Action
{
  LayoutView$1(LayoutView paramLayoutView, String paramString, int paramInt)
  {
    super(paramString, paramInt);
  }
  
  public void run()
  {
    LayoutView.access$0(this$0).setShowExtras(isChecked());
  }
}

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

import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;

class LayoutView$2
  extends Action
{
  LayoutView$2(LayoutView paramLayoutView, String paramString)
  {
    super(paramString);
  }
  
  public void run()
  {
    HierarchyViewerDirector.getDirector().loadAllViews();
    LayoutView.access$1(this$0).setChecked(true);
    LayoutView.access$0(this$0).setShowExtras(true);
  }
}

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

import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;

class LayoutView$3
  extends Action
{
  LayoutView$3(LayoutView paramLayoutView, String paramString)
  {
    super(paramString);
  }
  
  public void run()
  {
    boolean bool = !LayoutView.access$0(this$0).getOnBlack();
    LayoutView.access$0(this$0).setOnBlack(bool);
    if (bool) {
      setImageDescriptor(ImageDescriptor.createFromImage(LayoutView.access$2(this$0)));
    } else {
      setImageDescriptor(ImageDescriptor.createFromImage(LayoutView.access$3(this$0)));
    }
  }
}

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

import com.android.hierarchyviewerlib.models.TreeViewModel;
import org.eclipse.jface.action.Action;

class LayoutView$4
  implements Runnable
{
  LayoutView$4(LayoutView paramLayoutView) {}
  
  public void run()
  {
    LayoutView.access$4(this$0).setEnabled(TreeViewModel.getModel().getTree() != null);
    LayoutView.access$1(this$0).setEnabled(TreeViewModel.getModel().getTree() != null);
  }
}

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

import com.android.ddmuilib.ImageLoader;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.models.TreeViewModel;
import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
import com.android.hierarchyviewerlib.ui.LayoutViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class LayoutView
  extends ViewPart
  implements TreeViewModel.ITreeChangeListener
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.LayoutView";
  private LayoutViewer mLayoutViewer;
  private Image mOnBlack;
  private Image mOnWhite;
  private Action mShowExtrasAction = new Action("Show &Extras", 2)
  {
    public void run()
    {
      mLayoutViewer.setShowExtras(isChecked());
    }
  };
  private Action mLoadAllViewsAction = new Action("Load All &Views")
  {
    public void run()
    {
      HierarchyViewerDirector.getDirector().loadAllViews();
      mShowExtrasAction.setChecked(true);
      mLayoutViewer.setShowExtras(true);
    }
  };
  private Action mOnBlackWhiteAction = new Action("Change Background &Color")
  {
    public void run()
    {
      boolean bool = !mLayoutViewer.getOnBlack();
      mLayoutViewer.setOnBlack(bool);
      if (bool) {
        setImageDescriptor(ImageDescriptor.createFromImage(mOnWhite));
      } else {
        setImageDescriptor(ImageDescriptor.createFromImage(mOnBlack));
      }
    }
  };
  
  public void createPartControl(Composite paramComposite)
  {
    mShowExtrasAction.setAccelerator(SWT.MOD1 + 69);
    ImageLoader localImageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
    Image localImage = localImageLoader.loadImage("show-extras.png", Display.getDefault());
    mShowExtrasAction.setImageDescriptor(ImageDescriptor.createFromImage(localImage));
    mShowExtrasAction.setToolTipText("Show images");
    mShowExtrasAction.setEnabled(TreeViewModel.getModel().getTree() != null);
    mOnWhite = localImageLoader.loadImage("on-white.png", Display.getDefault());
    mOnBlack = localImageLoader.loadImage("on-black.png", Display.getDefault());
    mOnBlackWhiteAction.setAccelerator(SWT.MOD1 + 67);
    mOnBlackWhiteAction.setImageDescriptor(ImageDescriptor.createFromImage(mOnWhite));
    mOnBlackWhiteAction.setToolTipText("Change layout viewer background color");
    mLoadAllViewsAction.setAccelerator(SWT.MOD1 + 86);
    localImage = localImageLoader.loadImage("load-all-views.png", Display.getDefault());
    mLoadAllViewsAction.setImageDescriptor(ImageDescriptor.createFromImage(localImage));
    mLoadAllViewsAction.setToolTipText("Load all view images");
    mLoadAllViewsAction.setEnabled(TreeViewModel.getModel().getTree() != null);
    paramComposite.setLayout(new FillLayout());
    mLayoutViewer = new LayoutViewer(paramComposite);
    placeActions();
    TreeViewModel.getModel().addTreeChangeListener(this);
  }
  
  public void placeActions()
  {
    IActionBars localIActionBars = getViewSite().getActionBars();
    IMenuManager localIMenuManager = localIActionBars.getMenuManager();
    localIMenuManager.removeAll();
    localIMenuManager.add(mOnBlackWhiteAction);
    localIMenuManager.add(mShowExtrasAction);
    localIMenuManager.add(mLoadAllViewsAction);
    IToolBarManager localIToolBarManager = localIActionBars.getToolBarManager();
    localIToolBarManager.removeAll();
    localIToolBarManager.add(mOnBlackWhiteAction);
    localIToolBarManager.add(mShowExtrasAction);
    localIToolBarManager.add(mLoadAllViewsAction);
  }
  
  public void dispose()
  {
    super.dispose();
    TreeViewModel.getModel().removeTreeChangeListener(this);
  }
  
  public void setFocus()
  {
    mLayoutViewer.setFocus();
  }
  
  public void selectionChanged() {}
  
  public void treeChanged()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        mLoadAllViewsAction.setEnabled(TreeViewModel.getModel().getTree() != null);
        mShowExtrasAction.setEnabled(TreeViewModel.getModel().getTree() != null);
      }
    });
  }
  
  public void viewportChanged() {}
  
  public void zoomChanged() {}
}

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

import com.android.hierarchyviewerlib.ui.PixelPerfectLoupe;
import org.eclipse.jface.action.Action;

class PixelPerfectLoupeView$1
  extends Action
{
  PixelPerfectLoupeView$1(PixelPerfectLoupeView paramPixelPerfectLoupeView, String paramString, int paramInt)
  {
    super(paramString, paramInt);
  }
  
  public void run()
  {
    PixelPerfectLoupeView.access$0(this$0).setShowOverlay(isChecked());
  }
}

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

import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import org.eclipse.jface.action.Action;
import org.eclipse.swt.graphics.Image;

class PixelPerfectLoupeView$2
  implements Runnable
{
  PixelPerfectLoupeView$2(PixelPerfectLoupeView paramPixelPerfectLoupeView) {}
  
  public void run()
  {
    Image localImage = PixelPerfectModel.getModel().getOverlayImage();
    PixelPerfectLoupeView.access$1(this$0).setEnabled(localImage != null);
  }
}

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

import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import org.eclipse.jface.action.Action;

class PixelPerfectLoupeView$3
  implements Runnable
{
  PixelPerfectLoupeView$3(PixelPerfectLoupeView paramPixelPerfectLoupeView) {}
  
  public void run()
  {
    PixelPerfectLoupeView.access$1(this$0).setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
  }
}

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

import com.android.ddmuilib.ImageLoader;
import com.android.hierarchyviewerlib.HierarchyViewerDirector;
import com.android.hierarchyviewerlib.actions.PixelPerfectAutoRefreshAction;
import com.android.hierarchyviewerlib.models.PixelPerfectModel;
import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
import com.android.hierarchyviewerlib.ui.PixelPerfectControls;
import com.android.hierarchyviewerlib.ui.PixelPerfectLoupe;
import com.android.hierarchyviewerlib.ui.PixelPerfectPixelPanel;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class PixelPerfectLoupeView
  extends ViewPart
  implements PixelPerfectModel.IImageChangeListener
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView";
  private PixelPerfectLoupe mPixelPerfectLoupe;
  private Action mShowInLoupeAction = new Action("&Show Overlay", 2)
  {
    public void run()
    {
      mPixelPerfectLoupe.setShowOverlay(isChecked());
    }
  };
  
  public void createPartControl(Composite paramComposite)
  {
    mShowInLoupeAction.setAccelerator(SWT.MOD1 + 83);
    ImageLoader localImageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
    Image localImage = localImageLoader.loadImage("show-overlay.png", Display.getDefault());
    mShowInLoupeAction.setImageDescriptor(ImageDescriptor.createFromImage(localImage));
    mShowInLoupeAction.setToolTipText("Show the overlay in the loupe view");
    mShowInLoupeAction.setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
    PixelPerfectModel.getModel().addImageChangeListener(this);
    GridLayout localGridLayout1 = new GridLayout();
    marginWidth = (marginHeight = 0);
    horizontalSpacing = (verticalSpacing = 0);
    paramComposite.setLayout(localGridLayout1);
    Composite localComposite = new Composite(paramComposite, 2048);
    localComposite.setLayoutData(new GridData(1808));
    GridLayout localGridLayout2 = new GridLayout();
    marginWidth = (marginHeight = 0);
    horizontalSpacing = (verticalSpacing = 0);
    localComposite.setLayout(localGridLayout2);
    mPixelPerfectLoupe = new PixelPerfectLoupe(localComposite);
    mPixelPerfectLoupe.setLayoutData(new GridData(1808));
    PixelPerfectPixelPanel localPixelPerfectPixelPanel = new PixelPerfectPixelPanel(localComposite);
    localPixelPerfectPixelPanel.setLayoutData(new GridData(768));
    PixelPerfectControls localPixelPerfectControls = new PixelPerfectControls(paramComposite);
    localPixelPerfectControls.setLayoutData(new GridData(768));
    placeActions();
  }
  
  private void placeActions()
  {
    IActionBars localIActionBars = getViewSite().getActionBars();
    IMenuManager localIMenuManager = localIActionBars.getMenuManager();
    localIMenuManager.removeAll();
    localIMenuManager.add(PixelPerfectAutoRefreshAction.getAction());
    localIMenuManager.add(mShowInLoupeAction);
    IToolBarManager localIToolBarManager = localIActionBars.getToolBarManager();
    localIToolBarManager.removeAll();
    localIToolBarManager.add(PixelPerfectAutoRefreshAction.getAction());
    localIToolBarManager.add(mShowInLoupeAction);
  }
  
  public void dispose()
  {
    super.dispose();
    PixelPerfectModel.getModel().removeImageChangeListener(this);
  }
  
  public void setFocus()
  {
    mPixelPerfectLoupe.setFocus();
  }
  
  public void crosshairMoved() {}
  
  public void treeChanged() {}
  
  public void imageChanged() {}
  
  public void imageLoaded()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        Image localImage = PixelPerfectModel.getModel().getOverlayImage();
        mShowInLoupeAction.setEnabled(localImage != null);
      }
    });
  }
  
  public void overlayChanged()
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        mShowInLoupeAction.setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
      }
    });
  }
  
  public void overlayTransparencyChanged() {}
  
  public void selectionChanged() {}
  
  public void zoomChanged() {}
}

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

import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectTreeAction;
import com.android.hierarchyviewerlib.ui.PixelPerfectTree;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.part.ViewPart;

public class PixelPerfectTreeView
  extends ViewPart
{
  public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView";
  private PixelPerfectTree mPixelPerfectTree;
  
  public void createPartControl(Composite paramComposite)
  {
    paramComposite.setLayout(new FillLayout());
    mPixelPerfectTree = new PixelPerfectTree(paramComposite);
    placeActions();
  }
  
  private void placeActions()
  {
    IActionBars localIActionBars = getViewSite().getActionBars();
    IMenuManager localIMenuManager = localIActionBars.getMenuManager();
    localIMenuManager.removeAll();
    localIMenuManager.add(RefreshPixelPerfectTreeAction.getAction());
    IToolBarManager localIToolBarManager = localIActionBars.getToolBarManager();
    localIToolBarManager.removeAll();
    localIToolBarManager.add(RefreshPixelPerfectTreeAction.getAction());
  }
  
  public void setFocus()
  {
    mPixelPerfectTree.setFocus();
  }
}

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

import com.android.hiera
1 2

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-2017. Infinite Loop Ltd