com.android.ide.eclipse.traceview_22.6.2.201403212018

16:34:19.306 INFO  jd.cli.Main - Decompiling com.android.ide.eclipse.traceview_22.6.2.201403212018.jar
package com.android.ide.eclipse.traceview;

import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.ide.IDE;

class TraceviewLauncher$1
  implements Runnable
{
  TraceviewLauncher$1(TraceviewLauncher paramTraceviewLauncher, IWorkbench paramIWorkbench, boolean[] paramArrayOfBoolean, IFileStore paramIFileStore) {}
  
  public void run()
  {
    IWorkbenchWindow localIWorkbenchWindow = val$workbench.getActiveWorkbenchWindow();
    IWorkbenchPage localIWorkbenchPage = localIWorkbenchWindow.getActivePage();
    if (!localIWorkbenchPage.isEditorAreaVisible())
    {
      IAdaptable localIAdaptable = localIWorkbenchPage.getInput();
      try
      {
        val$workbench.showPerspective("org.eclipse.debug.ui.DebugPerspective", localIWorkbenchWindow, localIAdaptable);
      }
      catch (WorkbenchException localWorkbenchException) {}
    }
    try
    {
      val$result[0] = (IDE.openEditorOnFileStore(localIWorkbenchPage, val$fileStore) != null ? 1 : false);
    }
    catch (PartInitException localPartInitException) {}
  }
}

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

import com.android.ide.eclipse.ddms.ITraceviewLauncher;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.IFileSystem;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.ide.IDE;

public class TraceviewLauncher
  implements ITraceviewLauncher
{
  public boolean openFile(String paramString)
  {
    final IFileStore localIFileStore = EFS.getLocalFileSystem().getStore(new Path(paramString));
    if ((!localIFileStore.fetchInfo().isDirectory()) && (localIFileStore.fetchInfo().exists()))
    {
      final IWorkbench localIWorkbench = PlatformUI.getWorkbench();
      Display localDisplay = localIWorkbench.getDisplay();
      final boolean[] arrayOfBoolean = new boolean[1];
      localDisplay.syncExec(new Runnable()
      {
        public void run()
        {
          IWorkbenchWindow localIWorkbenchWindow = localIWorkbench.getActiveWorkbenchWindow();
          IWorkbenchPage localIWorkbenchPage = localIWorkbenchWindow.getActivePage();
          if (!localIWorkbenchPage.isEditorAreaVisible())
          {
            IAdaptable localIAdaptable = localIWorkbenchPage.getInput();
            try
            {
              localIWorkbench.showPerspective("org.eclipse.debug.ui.DebugPerspective", localIWorkbenchWindow, localIAdaptable);
            }
            catch (WorkbenchException localWorkbenchException) {}
          }
          try
          {
            arrayOfBoolean[0] = (IDE.openEditorOnFileStore(localIWorkbenchPage, localIFileStore) != null ? 1 : false);
          }
          catch (PartInitException localPartInitException) {}
        }
      });
      return arrayOfBoolean[0];
    }
    return false;
  }
}

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

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class TraceviewPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "com.android.ide.eclipse.traceview";
  private static TraceviewPlugin sPlugin;
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    sPlugin = this;
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    sPlugin = null;
    super.stop(paramBundleContext);
  }
  
  public static TraceviewPlugin getDefault()
  {
    return sPlugin;
  }
}

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

import com.android.ide.eclipse.ddms.JavaSourceRevealer;
import com.android.ide.eclipse.traceview.TraceviewPlugin;
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.TraceUnits.TimeScale;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.graphics.Color;
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.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.ide.FileStoreEditorInput;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.part.FileEditorInput;

public class TraceviewEditor
  extends EditorPart
  implements ProfileView.MethodHandler
{
  private Composite mParent;
  private String mFilename;
  private Composite mContents;
  
  public void doSave(IProgressMonitor paramIProgressMonitor) {}
  
  private IFile getWorkspaceFile(IFileStore paramIFileStore)
  {
    IWorkspaceRoot localIWorkspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile[] arrayOfIFile = localIWorkspaceRoot.findFilesForLocationURI(paramIFileStore.toURI());
    if ((arrayOfIFile != null) && (arrayOfIFile.length == 1)) {
      return arrayOfIFile[0];
    }
    return null;
  }
  
  public void doSaveAs()
  {
    Shell localShell = getSite().getShell();
    IEditorInput localIEditorInput = getEditorInput();
    Object localObject2;
    Object localObject3;
    Object localObject4;
    Object localObject5;
    Object localObject6;
    Object localObject7;
    Object localObject1;
    if ((localIEditorInput instanceof FileEditorInput))
    {
      localObject2 = (FileEditorInput)localIEditorInput;
      localObject3 = new SaveAsDialog(localShell);
      localObject4 = ((FileEditorInput)localObject2).getFile();
      if (localObject4 != null) {
        ((SaveAsDialog)localObject3).setOriginalFile((IFile)localObject4);
      }
      ((SaveAsDialog)localObject3).create();
      if ((localObject4 != null) && (!((IFile)localObject4).isAccessible()))
      {
        localObject5 = String.format("The original file ''%s'' has been deleted or is not accessible.", new Object[] { ((IFile)localObject4).getName() });
        ((SaveAsDialog)localObject3).setErrorMessage(null);
        ((SaveAsDialog)localObject3).setMessage((String)localObject5, 2);
      }
      if (((SaveAsDialog)localObject3).open() == 1) {
        return;
      }
      localObject5 = ((SaveAsDialog)localObject3).getResult();
      if (localObject5 == null) {
        return;
      }
      localObject6 = ResourcesPlugin.getWorkspace();
      localObject7 = ((IWorkspace)localObject6).getRoot().getFile((IPath)localObject5);
      if (copy(localShell, ((FileEditorInput)localObject2).getURI(), ((IFile)localObject7).getLocationURI()) == null) {
        return;
      }
      try
      {
        ((IFile)localObject7).refreshLocal(0, null);
      }
      catch (CoreException localCoreException)
      {
        localCoreException.printStackTrace();
      }
      localObject1 = new FileEditorInput((IFile)localObject7);
      setInput((IEditorInput)localObject1);
      setPartName(((IEditorInput)localObject1).getName());
    }
    else if ((localIEditorInput instanceof FileStoreEditorInput))
    {
      localObject2 = (FileStoreEditorInput)localIEditorInput;
      localObject3 = new FileDialog(localShell, 8192);
      localObject4 = URIUtil.toPath(((FileStoreEditorInput)localObject2).getURI());
      if (localObject4 != null)
      {
        ((FileDialog)localObject3).setFileName(((IPath)localObject4).lastSegment());
        ((FileDialog)localObject3).setFilterPath(((IPath)localObject4).toOSString());
      }
      localObject5 = ((FileDialog)localObject3).open();
      if (localObject5 == null) {
        return;
      }
      localObject6 = new File((String)localObject5);
      if (((File)localObject6).exists())
      {
        localObject7 = new MessageDialog(localShell, "Save As", null, String.format("%s already exists.\nDo you want to replace it?", new Object[] { localObject5 }), 4, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1);
        if (((MessageDialog)localObject7).open() != 0) {
          return;
        }
      }
      localObject7 = copy(localShell, ((FileStoreEditorInput)localObject2).getURI(), ((File)localObject6).toURI());
      if (localObject7 != null)
      {
        IFile localIFile = getWorkspaceFile((IFileStore)localObject7);
        if (localIFile != null) {
          localObject1 = new FileEditorInput(localIFile);
        } else {
          localObject1 = new FileStoreEditorInput((IFileStore)localObject7);
        }
        setInput((IEditorInput)localObject1);
        setPartName(((IEditorInput)localObject1).getName());
      }
    }
  }
  
  private IFileStore copy(Shell paramShell, URI paramURI1, URI paramURI2)
  {
    IFileStore localIFileStore1 = null;
    IFileStore localIFileStore2 = null;
    try
    {
      localIFileStore1 = EFS.getStore(paramURI2);
      localIFileStore2 = EFS.getStore(paramURI1);
      localIFileStore2.copy(localIFileStore1, 2, null);
    }
    catch (CoreException localCoreException)
    {
      String str1 = "Problems During Save As...";
      String str2 = String.format("Save could not be completed. %s", new Object[] { localCoreException.getMessage() });
      MessageDialog.openError(paramShell, str1, str2);
      return null;
    }
    return localIFileStore1;
  }
  
  public void init(IEditorSite paramIEditorSite, IEditorInput paramIEditorInput)
    throws PartInitException
  {
    Object localObject;
    if ((paramIEditorInput instanceof FileEditorInput))
    {
      localObject = (FileEditorInput)paramIEditorInput;
      mFilename = ((FileEditorInput)localObject).getPath().toOSString();
      setSite(paramIEditorSite);
      setInput(paramIEditorInput);
      setPartName(paramIEditorInput.getName());
    }
    else if ((paramIEditorInput instanceof FileStoreEditorInput))
    {
      localObject = (FileStoreEditorInput)paramIEditorInput;
      mFilename = ((FileStoreEditorInput)localObject).getURI().getPath();
      setSite(paramIEditorSite);
      setInput(paramIEditorInput);
      setPartName(paramIEditorInput.getName());
    }
    else
    {
      throw new PartInitException("Input is not of type FileEditorInput nor FileStoreEditorInput: " + paramIEditorInput == null ? "null" : paramIEditorInput.toString());
    }
  }
  
  public boolean isDirty()
  {
    return false;
  }
  
  public boolean isSaveAsAllowed()
  {
    return true;
  }
  
  public void createPartControl(Composite paramComposite)
  {
    mParent = paramComposite;
    try
    {
      DmTraceReader localDmTraceReader = new DmTraceReader(mFilename, false);
      localDmTraceReader.getTraceUnits().setTimeScale(TraceUnits.TimeScale.MilliSeconds);
      mContents = new Composite(mParent, 0);
      localObject1 = mContents.getDisplay();
      ColorController.assignMethodColors((Display)localObject1, localDmTraceReader.getMethods());
      localObject2 = new SelectionController();
      GridLayout localGridLayout = new GridLayout(1, false);
      marginWidth = 0;
      marginHeight = 0;
      horizontalSpacing = 0;
      verticalSpacing = 0;
      mContents.setLayout(localGridLayout);
      Color localColor = ((Display)localObject1).getSystemColor(16);
      SashForm localSashForm = new SashForm(mContents, 512);
      localSashForm.setBackground(localColor);
      SASH_WIDTH = 3;
      GridData localGridData = new GridData(1808);
      localSashForm.setLayoutData(localGridData);
      new TimeLineView(localSashForm, localDmTraceReader, (SelectionController)localObject2);
      new ProfileView(localSashForm, localDmTraceReader, (SelectionController)localObject2).setMethodHandler(this);
    }
    catch (IOException localIOException)
    {
      Object localObject1 = new Label(paramComposite, 0);
      ((Label)localObject1).setText("Failed to read the stack trace.");
      Object localObject2 = new Status(4, "com.android.ide.eclipse.traceview", "Failed to read the stack trace.", localIOException);
      TraceviewPlugin.getDefault().getLog().log((IStatus)localObject2);
    }
    mParent.layout();
  }
  
  public void setFocus()
  {
    mParent.setFocus();
  }
  
  public void handleMethod(MethodData paramMethodData)
  {
    String str1 = paramMethodData.getMethodName();
    String str2 = paramMethodData.getClassName().replaceAll("/", ".");
    String str3 = str2 + "." + str1;
    JavaSourceRevealer.revealMethod(str3, null, -1, null);
  }
}

/* Location:
 * Qualified Name:     com.android.ide.eclipse.traceview.editors.TraceviewEditor
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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