org.eclipse.linuxtools.profiling.launch_1.3.18.201310312000

16:46:09.006 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.profiling.launch_1.3.18.201310312000.jar
package org.eclipse.linuxtools.profiling.launch;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Messages
{
  private static final String BUNDLE_NAME = "org.eclipse.linuxtools.profiling.launch.messages";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.linuxtools.profiling.launch.messages");
  
  public static String getString(String paramString)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(paramString);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + paramString + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import java.util.ArrayList;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
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.debug.core.ILaunchConfiguration;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.tizen.nativecommon.launch.ui.TizenMainTab;

public class ProfileConfigurationMainTab
  extends TizenMainTab
{
  protected void updateProgramFromConfig(ILaunchConfiguration paramILaunchConfiguration)
  {
    if (fProgText != null)
    {
      String str = "";
      try
      {
        if (!isUnitTestProject(paramILaunchConfiguration)) {
          str = paramILaunchConfiguration.getAttribute("org.eclipse.cdt.launch.PROGRAM_NAME", "");
        }
      }
      catch (CoreException localCoreException)
      {
        localCoreException.printStackTrace();
      }
      fProgText.setText(str);
    }
  }
  
  protected void updateProjectFromConfig(ILaunchConfiguration paramILaunchConfiguration)
  {
    String str1 = "";
    String str2 = "";
    try
    {
      if (!isUnitTestProject(paramILaunchConfiguration))
      {
        str1 = paramILaunchConfiguration.getAttribute("org.eclipse.cdt.launch.PROJECT_ATTR", "");
        str2 = paramILaunchConfiguration.getAttribute("org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR", "");
      }
    }
    catch (CoreException localCoreException)
    {
      LaunchUIPlugin.log(localCoreException);
    }
    if (!fProjText.getText().equals(str1)) {
      fProjText.setText(str1);
    }
    updateBuildConfigCombo(str2);
  }
  
  protected ICProject chooseCProject()
  {
    try
    {
      ICProject[] arrayOfICProject1 = getCProjects();
      ArrayList localArrayList = new ArrayList();
      ICProject[] arrayOfICProject2;
      int j = (arrayOfICProject2 = arrayOfICProject1).length;
      for (int i = 0; i < j; i++)
      {
        localObject = arrayOfICProject2[i];
        String[] arrayOfString1 = ((ICProject)localObject).getProject().getDescription().getNatureIds();
        int k = 0;
        String[] arrayOfString2;
        int n = (arrayOfString2 = arrayOfString1).length;
        for (int m = 0; m < n; m++)
        {
          String str = arrayOfString2[m];
          if (str.equals("org.tizen.tizentest.nature"))
          {
            k = 1;
            break;
          }
        }
        if (k == 0) {
          localArrayList.add(localObject);
        }
      }
      Object localObject = new CElementLabelProvider();
      ElementListSelectionDialog localElementListSelectionDialog = new ElementListSelectionDialog(getShell(), (ILabelProvider)localObject);
      localElementListSelectionDialog.setTitle(LaunchMessages.CMainTab_Project_Selection);
      localElementListSelectionDialog.setMessage(LaunchMessages.CMainTab_Choose_project_to_constrain_search_for_program);
      localElementListSelectionDialog.setElements(localArrayList.toArray());
      ICProject localICProject = getCProject();
      if (localICProject != null) {
        localElementListSelectionDialog.setInitialSelections(new Object[] { localICProject });
      }
      if (localElementListSelectionDialog.open() == 0) {
        return (ICProject)localElementListSelectionDialog.getFirstResult();
      }
    }
    catch (CModelException localCModelException)
    {
      LaunchUIPlugin.errorDialog("Launch UI internal error", localCModelException);
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    return null;
  }
  
  public static boolean isUnitTestProject(ILaunchConfiguration paramILaunchConfiguration)
  {
    IWorkspace localIWorkspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot localIWorkspaceRoot = localIWorkspace.getRoot();
    try
    {
      String str1 = paramILaunchConfiguration.getAttribute("org.eclipse.cdt.launch.PROJECT_ATTR", "");
      if (!str1.equals(""))
      {
        String[] arrayOfString1 = localIWorkspaceRoot.getProject(str1).getDescription().getNatureIds();
        String[] arrayOfString2;
        int j = (arrayOfString2 = arrayOfString1).length;
        for (int i = 0; i < j; i++)
        {
          String str2 = arrayOfString2[i];
          if (str2.equals("org.tizen.tizentest.nature")) {
            return true;
          }
        }
      }
    }
    catch (CoreException localCoreException)
    {
      return false;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileConfigurationMainTab
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.cdt.launch.ui.CArgumentsTab;
import org.eclipse.cdt.launch.ui.CMainTab;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.EnvironmentTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;

public abstract class ProfileLaunchConfigurationTabGroup
  extends AbstractLaunchConfigurationTabGroup
{
  public void createTabs(ILaunchConfigurationDialog paramILaunchConfigurationDialog, String paramString)
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(new CMainTab());
    localArrayList.add(new CArgumentsTab());
    localArrayList.addAll(Arrays.asList(getProfileTabs()));
    localArrayList.add(new EnvironmentTab());
    localArrayList.add(new SourceLookupTab());
    localArrayList.add(new CommonTab());
    setTabs((ILaunchConfigurationTab[])localArrayList.toArray(new AbstractLaunchConfigurationTab[localArrayList.size()]));
  }
  
  public abstract AbstractLaunchConfigurationTab[] getProfileTabs();
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.tizen.common.connection.ConnectionPlugin;
import org.tizen.sdblib.IDevice;

public class ProfileLaunchPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.profiling.launch";
  private static ProfileLaunchPlugin plugin;
  private static boolean isProfiling = false;
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    plugin = this;
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    plugin = null;
    super.stop(paramBundleContext);
  }
  
  public static void startProfiling()
  {
    isProfiling = true;
  }
  
  public static void stopProfiling()
  {
    isProfiling = false;
  }
  
  public static boolean isProfiling()
  {
    return isProfiling;
  }
  
  public static ProfileLaunchPlugin getDefault()
  {
    return plugin;
  }
  
  public static Shell getActiveWorkbenchShell()
  {
    return getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
  }
  
  public static int checkTarget()
  {
    IDevice localIDevice = ConnectionPlugin.getDefault().getCurrentDevice();
    if (localIDevice == null) {
      return 0;
    }
    if (localIDevice.isEmulator()) {
      return 2;
    }
    return 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;

class ProfileLaunchShortcut$1
  implements Runnable
{
  ProfileLaunchShortcut$1(String paramString, IStatus paramIStatus) {}
  
  public void run()
  {
    ErrorDialog.openError(null, "Profile Error", val$errorMessage, val$status);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import java.util.List;
import org.eclipse.jface.operation.IRunnableWithProgress;

class ProfileLaunchShortcut$2
  implements IRunnableWithProgress
{
  ProfileLaunchShortcut$2(ProfileLaunchShortcut paramProfileLaunchShortcut, Object[] paramArrayOfObject, List paramList) {}
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor paramIProgressMonitor)
    throws java.lang.InterruptedException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 18	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$elements	[Ljava/lang/Object;
    //   4: arraylength
    //   5: istore_2
    //   6: aload_1
    //   7: ldc 30
    //   9: invokestatic 32	org/eclipse/linuxtools/profiling/launch/Messages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   12: iload_2
    //   13: invokeinterface 38 3 0
    //   18: new 44	org/eclipse/core/runtime/SubProgressMonitor
    //   21: dup
    //   22: aload_1
    //   23: iconst_1
    //   24: invokespecial 46	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   27: astore_3
    //   28: iconst_0
    //   29: istore 4
    //   31: goto +228 -> 259
    //   34: aload_0
    //   35: getfield 18	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$elements	[Ljava/lang/Object;
    //   38: iload 4
    //   40: aaload
    //   41: instanceof 49
    //   44: ifeq +189 -> 233
    //   47: aload_0
    //   48: getfield 18	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$elements	[Ljava/lang/Object;
    //   51: iload 4
    //   53: aaload
    //   54: checkcast 49	org/eclipse/core/runtime/IAdaptable
    //   57: ldc 51
    //   59: invokeinterface 53 2 0
    //   64: checkcast 51	org/eclipse/core/resources/IResource
    //   67: astore 5
    //   69: aload 5
    //   71: ifnull +162 -> 233
    //   74: invokestatic 57	org/eclipse/cdt/core/model/CoreModel:getDefault	()Lorg/eclipse/cdt/core/model/CoreModel;
    //   77: aload 5
    //   79: invokeinterface 63 1 0
    //   84: invokevirtual 67	org/eclipse/cdt/core/model/CoreModel:create	(Lorg/eclipse/core/resources/IProject;)Lorg/eclipse/cdt/core/model/ICProject;
    //   87: astore 6
    //   89: aload 6
    //   91: ifnull +142 -> 233
    //   94: aload 6
    //   96: invokeinterface 71 1 0
    //   101: invokeinterface 77 1 0
    //   106: astore 7
    //   108: aload 5
    //   110: invokeinterface 63 1 0
    //   115: invokestatic 83	org/eclipse/cdt/managedbuilder/core/ManagedBuildManager:getBuildInfo	(Lorg/eclipse/core/resources/IResource;)Lorg/eclipse/cdt/managedbuilder/core/IManagedBuildInfo;
    //   118: invokeinterface 89 1 0
    //   123: astore 8
    //   125: aload 8
    //   127: invokevirtual 95	java/lang/Object:toString	()Ljava/lang/String;
    //   130: astore 9
    //   132: iconst_0
    //   133: istore 10
    //   135: goto +80 -> 215
    //   138: aload 7
    //   140: iload 10
    //   142: aaload
    //   143: invokeinterface 99 1 0
    //   148: ifne +16 -> 164
    //   151: aload 7
    //   153: iload 10
    //   155: aaload
    //   156: invokeinterface 105 1 0
    //   161: ifeq +51 -> 212
    //   164: aload 7
    //   166: iload 10
    //   168: aaload
    //   169: invokeinterface 108 1 0
    //   174: iconst_1
    //   175: invokeinterface 112 2 0
    //   180: invokeinterface 118 1 0
    //   185: astore 11
    //   187: aload 11
    //   189: aload 9
    //   191: invokevirtual 121	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   194: ifeq +18 -> 212
    //   197: aload_0
    //   198: getfield 20	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$results	Ljava/util/List;
    //   201: aload 7
    //   203: iload 10
    //   205: aaload
    //   206: invokeinterface 127 2 0
    //   211: pop
    //   212: iinc 10 1
    //   215: iload 10
    //   217: aload 7
    //   219: arraylength
    //   220: if_icmplt -82 -> 138
    //   223: goto +10 -> 233
    //   226: astore 7
    //   228: aload 7
    //   230: invokevirtual 132	org/eclipse/cdt/core/model/CModelException:printStackTrace	()V
    //   233: aload_1
    //   234: invokeinterface 137 1 0
    //   239: ifeq +11 -> 250
    //   242: new 28	java/lang/InterruptedException
    //   245: dup
    //   246: invokespecial 140	java/lang/InterruptedException:<init>	()V
    //   249: athrow
    //   250: aload_3
    //   251: invokeinterface 141 1 0
    //   256: iinc 4 1
    //   259: iload 4
    //   261: iload_2
    //   262: if_icmplt -228 -> 34
    //   265: goto +14 -> 279
    //   268: astore 12
    //   270: aload_1
    //   271: invokeinterface 141 1 0
    //   276: aload 12
    //   278: athrow
    //   279: aload_1
    //   280: invokeinterface 141 1 0
    //   285: return
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	286	0	this	2
    //   0	286	1	paramIProgressMonitor	org.eclipse.core.runtime.IProgressMonitor
    //   5	258	2	i	int
    //   27	224	3	localSubProgressMonitor	org.eclipse.core.runtime.SubProgressMonitor
    //   29	234	4	j	int
    //   67	42	5	localIResource	org.eclipse.core.resources.IResource
    //   87	8	6	localICProject	org.eclipse.cdt.core.model.ICProject
    //   106	112	7	arrayOfIBinary	org.eclipse.cdt.core.model.IBinary[]
    //   226	3	7	localCModelException	org.eclipse.cdt.core.model.CModelException
    //   123	3	8	localIConfiguration	org.eclipse.cdt.managedbuilder.core.IConfiguration
    //   130	60	9	str1	String
    //   133	88	10	k	int
    //   185	3	11	str2	String
    //   268	9	12	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   94	223	226	org/eclipse/cdt/core/model/CModelException
    //   18	268	268	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.core.runtime.IPath;

class ProfileLaunchShortcut$3
  extends CElementLabelProvider
{
  ProfileLaunchShortcut$3(ProfileLaunchShortcut paramProfileLaunchShortcut) {}
  
  public String getText(Object paramObject)
  {
    if ((paramObject instanceof IBinary))
    {
      IBinary localIBinary = (IBinary)paramObject;
      StringBuffer localStringBuffer = new StringBuffer();
      localStringBuffer.append(localIBinary.getPath().lastSegment());
      return localStringBuffer.toString();
    }
    return super.getText(paramObject);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.core.runtime.IPath;

class ProfileLaunchShortcut$4
  extends CElementLabelProvider
{
  ProfileLaunchShortcut$4(ProfileLaunchShortcut paramProfileLaunchShortcut) {}
  
  public String getText(Object paramObject)
  {
    if ((paramObject instanceof IBinary))
    {
      IBinary localIBinary = (IBinary)paramObject;
      StringBuffer localStringBuffer = new StringBuffer();
      localStringBuffer.append(localIBinary.getCPU() + (localIBinary.isLittleEndian() ? "le" : "be"));
      localStringBuffer.append(" - ");
      localStringBuffer.append(localIBinary.getPath().toString());
      return localStringBuffer.toString();
    }
    return super.getText(paramObject);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.profiling.launch;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.ILaunchShortcut;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.dialogs.TwoPaneElementSelector;
import org.tizen.common.util.ViewUtil;
import org.tizen.nativecommon.ProjectUtil;
import org.tizen.nativecommon.launch.LaunchUtils;
import org.tizen.sdblib.IDevice;

public abstract class ProfileLaunchShortcut
  implements ILaunchShortcut
{
  public void launch(IEditorPart paramIEditorPart, String paramString)
  {
    searchAndLaunch(new Object[] { paramIEditorPart.getEditorInput() }, paramString);
  }
  
  public void launch(ISelection paramISelection, String paramString)
  {
    if ((paramISelection instanceof IStructuredSelection)) {
      searchAndLaunch(((IStructuredSelection)paramISelection).toArray(), paramString);
    }
  }
  
  public void launch(IBinary paramIBinary, String paramString)
  {
    ILaunchConfiguration localILaunchConfiguration = findLaunchConfiguration(paramIBinary, paramString);
    if (localILaunchConfiguration != null) {
      DebugUITools.launch(localILaunchConfiguration, paramString);
    }
  }
  
  public static void showErrorDialog(String paramString1, String paramString2, Exception paramException)
  {
    String str = Messages.getString("ProfileLaunchShortcut.targetcheck");
    final Status localStatus = new Status(4, str, 0, paramString2, paramException);
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        ErrorDialog.openError(null, "Profile Error", ProfileLaunchShortcut.this, localStatus);
      }
    });
  }
  
  protected ILaunchConfiguration findLaunchConfiguration(IBinary paramIBinary, String paramString)
  {
    if (paramIBinary == null)
    {
      localObject1 = ViewUtil.getWorkbenchWindow();
      if ((localObject1 != null) && (((IWorkbenchWindow)localObject1).getSelectionService() != null))
      {
        localObject2 = ((IWorkbenchWindow)localObject1).getSelectionService().getSelection();
        if ((localObject2 instanceof IStructuredSelection))
        {
          localObject3 = ((IStructuredSelection)localObject2).toArray();
          if (localObject3.length == 1)
          {
            localObject4 = (IProject)localObject3[0];
            return createConfiguration((IProject)localObject4, paramString);
          }
        }
      }
      showErrorDialog("Cannot find a project name.", "Cannot find a project name.", null);
    }
    Object localObject1 = null;
    Object localObject2 = getLaunchConfigType();
    Object localObject3 = LaunchUtils.getCurrentDeployDevice();
    Object localObject4 = Collections.emptyList();
    try
    {
      ILaunchConfiguration[] arrayOfILaunchConfiguration = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations((ILaunchConfigurationType)localObject2);
      localObject4 = new ArrayList(arrayOfILaunchConfiguration.length);
      for (int j = 0; j < arrayOfILaunchConfiguration.length; j++)
      {
        ILaunchConfiguration localILaunchConfiguration = arrayOfILaunchConfiguration[j];
        String str1 = localILaunchConfiguration.getAttribute("org.tizen.common.launch.device.id", "");
        String str2 = LaunchUtils.getDeviceId((IDevice)localObject3);
        IPath localIPath1 = AbstractCLaunchDelegate.getProgramPath(localILaunchConfiguration);
        String str3 = AbstractCLaunchDelegate.getProjectName(localILaunchConfiguration);
        IPath localIPath2 = paramIBinary.getResource().getProjectRelativePath();
        if ((localIPath1 != null) && (localIPath1.equals(localIPath2)) && (str3 != null) && (str3.equals(paramIBinary.getCProject().getProject().getName())) && (str1.equals(str2))) {
          ((List)localObject4).add(localILaunchConfiguration);
        }
      }
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    int i = ((List)localObject4).size();
    if (i < 1) {
      localObject1 = createConfiguration(paramIBinary);
    } else if (i == 1) {
      localObject1 = (ILaunchConfiguration)((List)localObject4).get(0);
    } else {
      localObject1 = chooseConfiguration((List)localObject4, paramString);
    }
    return (ILaunchConfiguration)localObject1;
  }
  
  protected abstract ILaunchConfigurationType getLaunchConfigType();
  
  protected abstract void setDefaultProfileAttributes(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
    throws CoreException;
  
  protected ILaunchConfiguration createConfiguration(IBinary paramIBinary)
  {
    ILaunchConfiguration localILaunchConfiguration = null;
    try
    {
      String str1 = paramIBinary.getResource().getProjectRelativePath().toString();
      ILaunchConfigurationType localILaunchConfigurationType = getLaunchConfigType();
      IDevice localIDevice = LaunchUtils.getCurrentDeployDevice();
      ILaunchConfigurationWorkingCopy localILaunchConfigurationWorkingCopy = localILaunchConfigurationType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(paramIBinary.getElementName()));
      localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.PROGRAM_NAME", str1);
      localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.PROJECT_ATTR", paramIBinary.getCProject().getElementName());
      localILaunchConfigurationWorkingCopy.setMappedResources(new IResource[] { paramIBinary.getResource(), paramIBinary.getResource().getProject() });
      localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.WORKING_DIRECTORY", null);
      setDefaultProfileAttributes(localILaunchConfigurationWorkingCopy);
      ICProjectDescription localICProjectDescription = CCorePlugin.getDefault().getProjectDescription(paramIBinary.getCProject().getProject());
      if (localICProjectDescription != null)
      {
        String str2 = localICProjectDescription.getActiveConfiguration().getId();
        localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR", str2);
        String str3 = localICProjectDescription.getActiveConfiguration().getName();
        localILaunchConfigurationWorkingCopy.setAttribute("org.tizen.nativeapp.launch.PROJECT_BUILD_CONFIG_NAME_ATTR", str3);
        LaunchUtils.setDeviceToLaunchConfiguration(localILaunchConfigurationWorkingCopy, localIDevice);
      }
      localILaunchConfiguration = localILaunchConfigurationWorkingCopy.doSave();
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    return localILaunchConfiguration;
  }
  
  protected ILaunchConfiguration createConfiguration(IProject paramIProject, String paramString)
  {
    ILaunchConfiguration localILaunchConfiguration = null;
    try
    {
      String str1 = paramIProject.getName();
      ILaunchConfigurationType localILaunchConfigurationType = getLaunchConfigType();
      IDevice localIDevice = LaunchUtils.getCurrentDeployDevice();
      IProject localIProject = paramIProject;
      String str2 = ProjectUtil.getLaunchConfigurationName(localIProject);
      ILaunchConfigurationWorkingCopy localILaunchConfigurationWorkingCopy = localILaunchConfigurationType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(str2));
      String str3 = ProjectUtil.getDefaultConfiguration(paramIProject).getName() + File.separatorChar + ProjectUtil.getBinaryName(paramIProject);
      localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.PROGRAM_NAME", str3);
      localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.PROJECT_ATTR", str1);
      localILaunchConfigurationWorkingCopy.setMappedResources(new IResource[] { paramIProject });
      localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.WORKING_DIRECTORY", null);
      setDefaultProfileAttributes(localILaunchConfigurationWorkingCopy);
      ICProjectDescription localICProjectDescription = CCorePlugin.getDefault().getProjectDescription(paramIProject);
      if (localICProjectDescription != null)
      {
        String str4 = localICProjectDescription.getActiveConfiguration().getId();
        localILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR", str4);
        String str5 = localICProjectDescription.getActiveConfiguration().getName();
        localILaunchConfigurationWorkingCopy.setAttribute("org.tizen.nativeapp.launch.PROJECT_BUILD_CONFIG_NAME_ATTR", str5);
        LaunchUtils.setDeviceToLaunchConfiguration(localILaunchConfigurationWorkingCopy, localIDevice);
      }
      localILaunchConfiguration = localILaunchConfigurationWorkingCopy.doSave();
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    return localILaunchConfiguration;
  }
  
  protected ILaunchManager getLaunchManager()
  {
    return DebugPlugin.getDefault().getLaunchManager();
  }
  
  private void searchAndLaunch(final Object[] paramArrayOfObject, String paramString)
  {
    if ((paramArrayOfObject != null) && (paramArrayOfObject.length > 0))
    {
      IBinary localIBinary = null;
      if ((paramArrayOfObject.length == 1) && ((paramArrayOfObject[0] instanceof IBinary)))
      {
        localIBinary = (IBinary)paramArrayOfObject[0];
      }
      else
      {
        final ArrayList localArrayList = new ArrayList();
        ProgressMonitorDialog localProgressMonitorDialog = new ProgressMonitorDialog(getActiveWorkbenchShell());
        IRunnableWithProgress local2 = new IRunnableWithProgress()
        {
          /* Error */
          public void run(org.eclipse.core.runtime.IProgressMonitor paramAnonymousIProgressMonitor)
            throws InterruptedException
          {
            // Byte code:
            //   0: aload_0
            //   1: getfield 18	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$elements	[Ljava/lang/Object;
            //   4: arraylength
            //   5: istore_2
            //   6: aload_1
            //   7: ldc 30
            //   9: invokestatic 32	org/eclipse/linuxtools/profiling/launch/Messages:getString	(Ljava/lang/String;)Ljava/lang/String;
            //   12: iload_2
            //   13: invokeinterface 38 3 0
            //   18: new 44	org/eclipse/core/runtime/SubProgressMonitor
            //   21: dup
            //   22: aload_1
            //   23: iconst_1
            //   24: invokespecial 46	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
            //   27: astore_3
            //   28: iconst_0
            //   29: istore 4
            //   31: goto +228 -> 259
            //   34: aload_0
            //   35: getfield 18	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$elements	[Ljava/lang/Object;
            //   38: iload 4
            //   40: aaload
            //   41: instanceof 49
            //   44: ifeq +189 -> 233
            //   47: aload_0
            //   48: getfield 18	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$elements	[Ljava/lang/Object;
            //   51: iload 4
            //   53: aaload
            //   54: checkcast 49	org/eclipse/core/runtime/IAdaptable
            //   57: ldc 51
            //   59: invokeinterface 53 2 0
            //   64: checkcast 51	org/eclipse/core/resources/IResource
            //   67: astore 5
            //   69: aload 5
            //   71: ifnull +162 -> 233
            //   74: invokestatic 57	org/eclipse/cdt/core/model/CoreModel:getDefault	()Lorg/eclipse/cdt/core/model/CoreModel;
            //   77: aload 5
            //   79: invokeinterface 63 1 0
            //   84: invokevirtual 67	org/eclipse/cdt/core/model/CoreModel:create	(Lorg/eclipse/core/resources/IProject;)Lorg/eclipse/cdt/core/model/ICProject;
            //   87: astore 6
            //   89: aload 6
            //   91: ifnull +142 -> 233
            //   94: aload 6
            //   96: invokeinterface 71 1 0
            //   101: invokeinterface 77 1 0
            //   106: astore 7
            //   108: aload 5
            //   110: invokeinterface 63 1 0
            //   115: invokestatic 83	org/eclipse/cdt/managedbuilder/core/ManagedBuildManager:getBuildInfo	(Lorg/eclipse/core/resources/IResource;)Lorg/eclipse/cdt/managedbuilder/core/IManagedBuildInfo;
            //   118: invokeinterface 89 1 0
            //   123: astore 8
            //   125: aload 8
            //   127: invokevirtual 95	java/lang/Object:toString	()Ljava/lang/String;
            //   130: astore 9
            //   132: iconst_0
            //   133: istore 10
            //   135: goto +80 -> 215
            //   138: aload 7
            //   140: iload 10
            //   142: aaload
            //   143: invokeinterface 99 1 0
            //   148: ifne +16 -> 164
            //   151: aload 7
            //   153: iload 10
            //   155: aaload
            //   156: invokeinterface 105 1 0
            //   161: ifeq +51 -> 212
            //   164: aload 7
            //   166: iload 10
            //   168: aaload
            //   169: invokeinterface 108 1 0
            //   174: iconst_1
            //   175: invokeinterface 112 2 0
            //   180: invokeinterface 118 1 0
            //   185: astore 11
            //   187: aload 11
            //   189: aload 9
            //   191: invokevirtual 121	java/lang/String:equals	(Ljava/lang/Object;)Z
            //   194: ifeq +18 -> 212
            //   197: aload_0
            //   198: getfield 20	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut$2:val$results	Ljava/util/List;
            //   201: aload 7
            //   203: iload 10
            //   205: aaload
            //   206: invokeinterface 127 2 0
            //   211: pop
            //   212: iinc 10 1
            //   215: iload 10
            //   217: aload 7
            //   219: arraylength
            //   220: if_icmplt -82 -> 138
            //   223: goto +10 -> 233
            //   226: astore 7
            //   228: aload 7
            //   230: invokevirtual 132	org/eclipse/cdt/core/model/CModelException:printStackTrace	()V
            //   233: aload_1
            //   234: invokeinterface 137 1 0
            //   239: ifeq +11 -> 250
            //   242: new 28	java/lang/InterruptedException
            //   245: dup
            //   246: invokespecial 140	java/lang/InterruptedException:<init>	()V
            //   249: athrow
            //   250: aload_3
            //   251: invokeinterface 141 1 0
            //   256: iinc 4 1
            //   259: iload 4
            //   261: iload_2
            //   262: if_icmplt -228 -> 34
            //   265: goto +14 -> 279
            //   268: astore 12
            //   270: aload_1
            //   271: invokeinterface 141 1 0
            //   276: aload 12
            //   278: athrow
            //   279: aload_1
            //   280: invokeinterface 141 1 0
            //   285: return
            // Local variable table:
            //   start	length	slot	name	signature
            //   0	286	0	this	2
            //   0	286	1	paramAnonymousIProgressMonitor	org.eclipse.core.runtime.IProgressMonitor
            //   5	258	2	i	int
            //   27	224	3	localSubProgressMonitor	org.eclipse.core.runtime.SubProgressMonitor
            //   29	234	4	j	int
            //   67	42	5	localIResource	IResource
            //   87	8	6	localICProject	ICProject
            //   106	112	7	arrayOfIBinary	IBinary[]
            //   226	3	7	localCModelException	org.eclipse.cdt.core.model.CModelException
            //   123	3	8	localIConfiguration	IConfiguration
            //   130	60	9	str1	String
            //   133	88	10	k	int
            //   185	3	11	str2	String
            //   268	9	12	localObject	Object
            // Exception table:
            //   from	to	target	type
            //   94	223	226	org/eclipse/cdt/core/model/CModelException
            //   18	268	268	finally
          }
        };
        try
        {
          localProgressMonitorDialog.run(true, true, local2);
        }
        catch (InterruptedException localInterruptedException)
        {
          return;
        }
        catch (InvocationTargetException localInvocationTargetException)
        {
          handleFail(localInvocationTargetException.getMessage());
          return;
        }
        int i = localArrayList.size();
        if (i == 1) {
          localIBinary = (IBinary)localArrayList.get(0);
        } else if (i > 1) {
          localIBinary = chooseBinary(localArrayList, paramString);
        }
      }
      launch(localIBinary, paramString);
    }
    else
    {
      handleFail(Messages.getString("ProfileLaunchShortcut.no_project_selected"));
    }
  }
  
  protected void handleFail(String paramString)
  {
    MessageDialog.openError(getActiveWorkbenchShell(), Messages.getString("ProfileLaunchShortcut.Valgrind_Launcher"), paramString);
  }
  
  protected IBinary chooseBinary(List<IBinary> paramList, String paramString)
  {
    CElementLabelProvider local3 = new CElementLabelProvider()
    {
      public String getText(Object paramAnonymousObject)
      {
        if ((paramAnonymousObject instanceof IBinary))
        {
          IBinary localIBinary = (IBinary)paramAnonymousObject;
          StringBuffer localStringBuffer = new StringBuffer();
          localStringBuffer.append(localIBinary.getPath().lastSegment());
          return localStringBuffer.toString();
        }
        return super.getText(paramAnonymousObject);
      }
    };
    CElementLabelProvider local4 = new CElementLabelProvider()
    {
      public String getText(Object paramAnonymousObject)
      {
        if ((paramAnonymousObject instanceof IBinary))
        {
          IBinary localIBinary = (IBinary)paramAnonymousObject;
          StringBuffer localStringBuffer = new StringBuffer();
          localStringBuffer.append(localIBinary.getCPU() + (localIBinary.isLittleEndian() ? "le" : "be"));
          localStringBuffer.append(" - ");
          localStringBuffer.append(localIBinary.getPath().toString());
          return localStringBuffer.toString();
        }
        return super.getText(paramAnonymousObject);
      }
    };
    TwoPaneElementSelector localTwoPaneElementSelector = new TwoPaneElementSelector(getActiveWorkbenchShell(), local3, local4);
    localTwoPaneElementSelector.setElements(paramList.toArray());
    localTwoPaneElementSelector.setTitle(Messages.getString("ProfileLaunchShortcut.Profile_With_Valgrind"));
    localTwoPaneElementSelector.setMessage(Messages.getString("ProfileLaunchShortcut.Choose_a_local_application"));
    localTwoPaneElementSelector.setUpperListLabel(Messages.getString("ProfileLaunchShortcut.Binaries"));
    localTwoPaneElementSelector.setLowerListLabel(Messages.getString("ProfileLaunchShortcut.Qualifier"));
    localTwoPaneElementSelector.setMultipleSelection(false);
    if (localTwoPaneElementSelector.open() == 0) {
      return (IBinary)localTwoPaneElementSelector.getFirstResult();
    }
    return null;
  }
  
  protected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> paramList, String paramString)
  {
    IDebugModelPresentation localIDebugModelPresentation = DebugUITools.newDebugModelPresentation();
    ElementListSelectionDialog localElementListSelectionDialog = new ElementListSelectionDialog(getActiveWorkbenchShell(), localIDebugModelPresentation);
    localElementListSelectionDialog.setElements(paramList.toArray());
    localElementListSelectionDialog.setTitle(Messages.getString("ProfileLaunchShortcut.Launch_Configuration_Selection"));
    localElementListSelectionDialog.setMessage(Messages.getString("ProfileLaunchShortcut.Choose_a_launch_configuration"));
    localElementListSelectionDialog.setMultipleSelection(false);
    int i = localElementListSelectionDialog.open();
    localIDebugModelPresentation.dispose();
    if (i == 0) {
      return (ILaunchConfiguration)localElementListSelectionDialog.getFirstResult();
    }
    return null;
  }
  
  protected Shell getActiveWorkbenchShell()
  {
    return ProfileLaunchPlugin.getActiveWorkbenchShell();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut
 * 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