org.eclipse.linuxtools.valgrind.launch_1.3.18.201310312000

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

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.linuxtools.valgrind.core.ValgrindCommand;

public abstract interface IValgrindLaunchDelegate
{
  public abstract void launch(ValgrindCommand paramValgrindCommand, ILaunchConfiguration paramILaunchConfiguration, ILaunch paramILaunch, IProgressMonitor paramIProgressMonitor)
    throws CoreException, Exception;
  
  public abstract String[] getCommandArray(ValgrindCommand paramValgrindCommand, ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException;
}

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

import org.eclipse.debug.ui.ILaunchConfigurationTab;

public abstract interface IValgrindToolPage
  extends ILaunchConfigurationTab
{}

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

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

public class Messages
{
  private static final String BUNDLE_NAME = "org.eclipse.linuxtools.valgrind.launch.messages";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.linuxtools.valgrind.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.valgrind.launch.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.launch;

import java.io.File;
import java.util.HashMap;
import java.util.Set;
import org.eclipse.cdt.launch.LaunchUtils;
import org.eclipse.core.resources.IResource;
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.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class ValgrindLaunchPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.launch";
  public static final String LAUNCH_ID = "org.eclipse.linuxtools.valgrind.launch.valgrindLaunch";
  public static final String RESULT_DIR = "/tmp/";
  public static final String XML_FILE = "valgrind_result.xml";
  public static final String TOOL_EXT_ID = "valgrindTools";
  public static final String TOOL_EXT_DEFAULT = "org.eclipse.linuxtools.valgrind.launch.memcheck";
  protected static final String EXT_ELEMENT = "tool";
  protected static final String EXT_ATTR_NAME = "name";
  protected static final String EXT_ATTR_ID = "id";
  protected static final String EXT_ATTR_PAGE = "page";
  protected static final String EXT_ATTR_DELEGATE = "delegate";
  protected HashMap<String, IConfigurationElement> toolMap;
  private static ValgrindLaunchPlugin plugin;
  
  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 ValgrindLaunchPlugin getDefault()
  {
    return plugin;
  }
  
  public String[] getRegisteredToolIDs()
  {
    Set localSet = getToolMap().keySet();
    return (String[])localSet.toArray(new String[localSet.size()]);
  }
  
  public String getToolName(String paramString)
  {
    String str = null;
    IConfigurationElement localIConfigurationElement = (IConfigurationElement)getToolMap().get(paramString);
    if (localIConfigurationElement != null) {
      str = localIConfigurationElement.getAttribute("name");
    }
    return str;
  }
  
  public IValgrindToolPage getToolPage(String paramString)
    throws CoreException
  {
    IValgrindToolPage localIValgrindToolPage = null;
    IConfigurationElement localIConfigurationElement = (IConfigurationElement)getToolMap().get(paramString);
    if (localIConfigurationElement != null)
    {
      Object localObject = localIConfigurationElement.createExecutableExtension("page");
      if ((localObject instanceof IValgrindToolPage)) {
        localIValgrindToolPage = (IValgrindToolPage)localObject;
      }
    }
    if (localIValgrindToolPage == null) {
      throw new CoreException(new Status(4, "org.eclipse.linuxtools.valgrind.launch", Messages.getString("ValgrindLaunchPlugin.Cannot_retrieve_page")));
    }
    return localIValgrindToolPage;
  }
  
  public IValgrindLaunchDelegate getToolDelegate(String paramString)
    throws CoreException
  {
    IValgrindLaunchDelegate localIValgrindLaunchDelegate = null;
    IConfigurationElement localIConfigurationElement = (IConfigurationElement)getToolMap().get(paramString);
    if (localIConfigurationElement != null)
    {
      Object localObject = localIConfigurationElement.createExecutableExtension("delegate");
      if ((localObject instanceof IValgrindLaunchDelegate)) {
        localIValgrindLaunchDelegate = (IValgrindLaunchDelegate)localObject;
      }
    }
    if (localIValgrindLaunchDelegate == null) {
      throw new CoreException(new Status(4, "org.eclipse.linuxtools.valgrind.launch", Messages.getString("ValgrindLaunchPlugin.Cannot_retrieve_delegate")));
    }
    return localIValgrindLaunchDelegate;
  }
  
  public File parseWSPath(String paramString)
    throws CoreException
  {
    paramString = LaunchUtils.getStringVariableManager().performStringSubstitution(paramString);
    Path localPath = new Path(paramString);
    File localFile = null;
    if (localPath.isAbsolute())
    {
      localFile = new File(localPath.toOSString());
    }
    else
    {
      IResource localIResource = ResourcesPlugin.getWorkspace().getRoot().findMember(localPath);
      if (localIResource != null)
      {
        IPath localIPath = localIResource.getLocation();
        if (localIPath != null) {
          localFile = localIPath.toFile();
        }
      }
    }
    return localFile;
  }
  
  protected void initializeToolMap()
  {
    toolMap = new HashMap();
    IExtensionPoint localIExtensionPoint = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.linuxtools.valgrind.launch", "valgrindTools");
    IConfigurationElement[] arrayOfIConfigurationElement1 = localIExtensionPoint.getConfigurationElements();
    IConfigurationElement[] arrayOfIConfigurationElement2;
    int j = (arrayOfIConfigurationElement2 = arrayOfIConfigurationElement1).length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement localIConfigurationElement = arrayOfIConfigurationElement2[i];
      if (localIConfigurationElement.getName().equals("tool"))
      {
        String str = localIConfigurationElement.getAttribute("id");
        if ((str != null) && (localIConfigurationElement.getAttribute("name") != null) && (localIConfigurationElement.getAttribute("page") != null) && (localIConfigurationElement.getAttribute("delegate") != null)) {
          toolMap.put(str, localIConfigurationElement);
        }
      }
    }
  }
  
  protected HashMap<String, IConfigurationElement> getToolMap()
  {
    if (toolMap == null) {
      initializeToolMap();
    }
    return toolMap;
  }
  
  public String escapeAndQuote(String paramString)
  {
    String str = paramString.replaceAll(" ", "\\ ");
    return str;
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class ValgrindOptionsTab$1
  extends SelectionAdapter
{
  ValgrindOptionsTab$1(ValgrindOptionsTab paramValgrindOptionsTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    this$0.updateLaunchConfigurationDialog();
  }
}

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

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class ValgrindOptionsTab$2
  implements ModifyListener
{
  ValgrindOptionsTab$2(ValgrindOptionsTab paramValgrindOptionsTab) {}
  
  public void modifyText(ModifyEvent paramModifyEvent)
  {
    this$0.updateLaunchConfigurationDialog();
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class ValgrindOptionsTab$3
  extends SelectionAdapter
{
  ValgrindOptionsTab$3(ValgrindOptionsTab paramValgrindOptionsTab) {}
  
  public void widgetDefaultSelected(SelectionEvent paramSelectionEvent)
  {
    widgetSelected(paramSelectionEvent);
  }
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    ValgrindOptionsTab.access$0(this$0, true);
    if (!ValgrindOptionsTab.access$1(this$0)) {
      return;
    }
    if (!this$0.isInitializing)
    {
      this$0.tool = "org.eclipse.linuxtools.valgrind.launch.memcheck";
      this$0.handleToolChanged();
      this$0.updateLaunchConfigurationDialog();
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class ValgrindOptionsTab$4
  extends SelectionAdapter
{
  ValgrindOptionsTab$4(ValgrindOptionsTab paramValgrindOptionsTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    if (!this$0.isInitializing)
    {
      this$0.tool = "org.eclipse.linuxtools.valgrind.launch.massif";
      this$0.handleToolChanged();
      this$0.updateLaunchConfigurationDialog();
    }
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;

class ValgrindOptionsTab$5
  extends SelectionAdapter
{
  ValgrindOptionsTab$5(ValgrindOptionsTab paramValgrindOptionsTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    ElementTreeSelectionDialog localElementTreeSelectionDialog = new ElementTreeSelectionDialog(ValgrindOptionsTab.access$2(this$0), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
    localElementTreeSelectionDialog.setTitle(Messages.getString("ValgrindOptionsTab.Select_a_Resource"));
    localElementTreeSelectionDialog.setMessage(Messages.getString("ValgrindOptionsTab.Select_a_Suppressions_File"));
    localElementTreeSelectionDialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
    localElementTreeSelectionDialog.setComparator(new ResourceComparator(1));
    if (localElementTreeSelectionDialog.open() == 0)
    {
      IResource localIResource = (IResource)localElementTreeSelectionDialog.getFirstResult();
      String str1 = localIResource.getFullPath().toString();
      String str2 = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", str1);
      this$0.suppFileText.setText(str2);
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Text;

class ValgrindOptionsTab$6
  extends SelectionAdapter
{
  ValgrindOptionsTab$6(ValgrindOptionsTab paramValgrindOptionsTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    String str = this$0.suppFileText.getText();
    FileDialog localFileDialog = new FileDialog(ValgrindOptionsTab.access$2(this$0), 8192);
    str = localFileDialog.open();
    if (str != null) {
      this$0.suppFileText.setText(str);
    }
  }
}

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

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

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

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

import java.io.File;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
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.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchPlugin;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;

public class ValgrindOptionsTab
  extends AbstractLaunchConfigurationTab
{
  protected static final String EMPTY_STRING = "";
  private ScrolledComposite scrContainer;
  protected Button collectData1Button;
  protected Button collectData2Button;
  protected Button mempsButton;
  protected Button traceChildrenButton;
  protected Button childSilentButton;
  protected Button runFreeresButton;
  protected Button demangleButton;
  protected Spinner numCallersSpinner;
  protected Button errorLimitButton;
  protected Button showBelowMainButton;
  protected Spinner maxStackFrameSpinner;
  protected Text suppFileText;
  protected String tool;
  protected String[] tools;
  protected Combo toolsCombo;
  protected Composite top;
  protected ScrolledComposite scrollTop;
  protected ILaunchConfigurationWorkingCopy launchConfigurationWorkingCopy;
  protected ILaunchConfiguration launchConfiguration;
  protected ILaunchConfigurationTab dynamicTab;
  protected Composite dynamicTabHolder;
  protected boolean isInitializing = false;
  protected boolean initDefaults = false;
  private boolean canInitialize;
  protected SelectionListener selectListener = new SelectionAdapter()
  {
    public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
    {
      updateLaunchConfigurationDialog();
    }
  };
  protected ModifyListener modifyListener = new ModifyListener()
  {
    public void modifyText(ModifyEvent paramAnonymousModifyEvent)
    {
      updateLaunchConfigurationDialog();
    }
  };
  
  public void createControl(Composite paramComposite)
  {
    int i = ProfileLaunchPlugin.checkTarget();
    if (i == 0)
    {
      localObject1 = new Composite(paramComposite, 0);
      setControl((Control)localObject1);
      ((Composite)localObject1).setLayout(new GridLayout());
      PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), "");
      localObject2 = new Label((Composite)localObject1, 16384);
      localObject3 = Messages.getString("ValgrindOptionsTab.nodevice");
      ((Label)localObject2).setText((String)localObject3);
      canInitialize = false;
      return;
    }
    canInitialize = true;
    scrContainer = new ScrolledComposite(paramComposite, 768);
    Object localObject1 = new FillLayout();
    scrContainer.setLayout((Layout)localObject1);
    Object localObject2 = new GridData(1808);
    scrContainer.setLayoutData(localObject2);
    scrContainer.setExpandHorizontal(true);
    scrContainer.setExpandVertical(true);
    top = new Composite(scrContainer, 0);
    setControl(scrContainer);
    top.setLayout(new GridLayout());
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), "");
    createVerticalSpacer(top, 1);
    createVerticalSpacer(top, 1);
    Object localObject3 = new TabFolder(top, 2048);
    ((TabFolder)localObject3).setLayoutData(new GridData(1808));
    TabItem localTabItem1 = new TabItem((TabFolder)localObject3, 0);
    localTabItem1.setText(Messages.getString("ValgrindOptionsTab.Start"));
    Composite localComposite1 = new Composite((Composite)localObject3, 0);
    localComposite1.setLayout(new GridLayout());
    localComposite1.setLayoutData(new GridData(1808));
    createStartOptions(localComposite1, true);
    createVerticalSpacer(localComposite1, 1);
    localTabItem1.setControl(localComposite1);
    TabItem localTabItem2 = new TabItem((TabFolder)localObject3, 0);
    localTabItem2.setText(Messages.getString("ValgrindOptionsTab.General"));
    Composite localComposite2 = new Composite((Composite)localObject3, 0);
    localComposite2.setLayout(new GridLayout());
    localComposite2.setLayoutData(new GridData(1808));
    createBasicOptions(localComposite2);
    createVerticalSpacer(localComposite2, 1);
    createErrorOptions(localComposite2);
    createVerticalSpacer(localComposite2, 1);
    createSuppressionsOption(localComposite2);
    localTabItem2.setControl(localComposite2);
    TabItem localTabItem3 = new TabItem((TabFolder)localObject3, 0);
    localTabItem3.setText(Messages.getString("ValgrindOptionsTab.Tool"));
    dynamicTabHolder = new Composite((Composite)localObject3, 0);
    dynamicTabHolder.setLayout(new GridLayout());
    dynamicTabHolder.setLayoutData(new GridData(1808));
    localTabItem3.setControl(dynamicTabHolder);
    scrContainer.setContent(top);
    scrContainer.setMinSize(top.computeSize(-1, -1));
  }
  
  protected void createStartOptions(Composite paramComposite, boolean paramBoolean)
  {
    tools = ValgrindLaunchPlugin.getDefault().getRegisteredToolIDs();
    String[] arrayOfString = new String[tools.length];
    for (int i = 0; i < arrayOfString.length; i++) {
      arrayOfString[i] = ValgrindLaunchPlugin.getDefault().getToolName(tools[i]);
    }
    Group localGroup = new Group(paramComposite, 0);
    localGroup.setLayout(new GridLayout());
    localGroup.setLayoutData(new GridData(768));
    localGroup.setText(Messages.getString("ValgrindOptionsTab.Collect_Options"));
    Composite localComposite = new Composite(localGroup, 0);
    localComposite.setLayout(new GridLayout(8, false));
    localComposite.setLayoutData(new GridData(768));
    collectData1Button = new Button(localComposite, 16);
    collectData1Button.setText(Messages.getString("ValgrindOptionsTab.collect_data1"));
    collectData1Button.addSelectionListener(new SelectionAdapter()
    {
      public void widgetDefaultSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        widgetSelected(paramAnonymousSelectionEvent);
      }
      
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        canInitialize = true;
        if (!canInitialize) {
          return;
        }
        if (!isInitializing)
        {
          tool = "org.eclipse.linuxtools.valgrind.launch.memcheck";
          handleToolChanged();
          updateLaunchConfigurationDialog();
        }
      }
    });
    collectData2Button = new Button(localComposite, 16);
    collectData2Button.setText(Messages.getString("ValgrindOptionsTab.collect_data2"));
    collectData2Button.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        if (!isInitializing)
        {
          tool = "org.eclipse.linuxtools.valgrind.launch.massif";
          handleToolChanged();
          updateLaunchConfigurationDialog();
        }
      }
    });
  }
  
  protected void createBasicOptions(Composite paramComposite)
  {
    Group localGroup = new Group(paramComposite, 0);
    localGroup.setLayout(new GridLayout());
    localGroup.setLayoutData(new GridData(768));
    localGroup.setText(Messages.getString("ValgrindOptionsTab.Basic_Options"));
    Composite localComposite = new Composite(localGroup, 0);
    localComposite.setLayout(new GridLayout(2, true));
    localComposite.setLayoutData(new GridData(768));
    traceChildrenButton = new Button(localComposite, 32);
    traceChildrenButton.setText(Messages.getString("ValgrindOptionsTab.trace_children"));
    traceChildrenButton.addSelectionListener(selectListener);
    traceChildrenButton.setLayoutData(new GridData(768));
    childSilentButton = new Button(localComposite, 32);
    childSilentButton.setText(Messages.getString("ValgrindOptionsTab.child_silent"));
    childSilentButton.setSelection(true);
    childSilentButton.setEnabled(false);
    childSilentButton.setLayoutData(new GridData(768));
    runFreeresButton = new Button(localComposite, 32);
    runFreeresButton.setText(Messages.getString("ValgrindOptionsTab.run_freeres"));
    runFreeresButton.addSelectionListener(selectListener);
    runFreeresButton.setLayoutData(new GridData(768));
  }
  
  protected void createErrorOptions(Composite paramComposite)
  {
    Group localGroup = new Group(paramComposite, 0);
    localGroup.setLayout(new GridLayout());
    localGroup.setLayoutData(new GridData(768));
    localGroup.setText(Messages.getString("ValgrindOptionsTab.Error_Options"));
    Composite localComposite1 = new Composite(localGroup, 0);
    localComposite1.setLayout(new GridLayout(2, true));
    localComposite1.setLayoutData(new GridData(768));
    demangleButton = new Button(localComposite1, 32);
    demangleButton.setText(Messages.getString("ValgrindOptionsTab.demangle"));
    demangleButton.addSelectionListener(selectListener);
    demangleButton.setLayoutData(new GridData(768));
    Composite localComposite2 = new Composite(localComposite1, 0);
    localComposite2.setLayout(new GridLayout(2, false));
    Label localLabel1 = new Label(localComposite2, 0);
    localLabel1.setText(Messages.getString("ValgrindOptionsTab.num_callers"));
    numCallersSpinner = new Spinner(localComposite2, 2048);
    numCallersSpinner.setMaximum(50);
    numCallersSpinner.addModifyListener(modifyListener);
    numCallersSpinner.setLayoutData(new GridData(768));
    errorLimitButton = new Button(localComposite1, 32);
    errorLimitButton.setText(Messages.getString("ValgrindOptionsTab.limit_errors"));
    errorLimitButton.addSelectionListener(selectListener);
    errorLimitButton.setLayoutData(new GridData(768));
    showBelowMainButton = new Button(localComposite1, 32);
    showBelowMainButton.setText(Messages.getString("ValgrindOptionsTab.show_errors_below_main"));
    showBelowMainButton.addSelectionListener(selectListener);
    showBelowMainButton.setLayoutData(new GridData(768));
    Composite localComposite3 = new Composite(localComposite1, 0);
    localComposite3.setLayout(new GridLayout(2, false));
    Label localLabel2 = new Label(localComposite3, 0);
    localLabel2.setText(Messages.getString("ValgrindOptionsTab.max_size_of_stack_frame"));
    maxStackFrameSpinner = new Spinner(localComposite3, 2048);
    maxStackFrameSpinner.setMaximum(Integer.MAX_VALUE);
    maxStackFrameSpinner.addModifyListener(modifyListener);
    maxStackFrameSpinner.setLayoutData(new GridData(768));
  }
  
  protected void createSuppressionsOption(Composite paramComposite)
  {
    Group localGroup = new Group(paramComposite, 0);
    localGroup.setLayout(new GridLayout());
    localGroup.setLayoutData(new GridData(768));
    localGroup.setText(Messages.getString("ValgrindOptionsTab.Suppressions"));
    Composite localComposite = new Composite(localGroup, 0);
    localComposite.setLayout(new GridLayout(4, false));
    GridData localGridData = new GridData(768);
    localComposite.setLayoutData(localGridData);
    Label localLabel = new Label(localComposite, 0);
    localLabel.setText(Messages.getString("ValgrindOptionsTab.suppressions_file"));
    suppFileText = new Text(localComposite, 2048);
    suppFileText.setLayoutData(new GridData(768));
    suppFileText.addModifyListener(modifyListener);
    Button localButton1 = createPushButton(localComposite, Messages.getString("ValgrindOptionsTab.Workspace"), null);
    localButton1.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        ElementTreeSelectionDialog localElementTreeSelectionDialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        localElementTreeSelectionDialog.setTitle(Messages.getString("ValgrindOptionsTab.Select_a_Resource"));
        localElementTreeSelectionDialog.setMessage(Messages.getString("ValgrindOptionsTab.Select_a_Suppressions_File"));
        localElementTreeSelectionDialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
        localElementTreeSelectionDialog.setComparator(new ResourceComparator(1));
        if (localElementTreeSelectionDialog.open() == 0)
        {
          IResource localIResource = (IResource)localElementTreeSelectionDialog.getFirstResult();
          String str1 = localIResource.getFullPath().toString();
          String str2 = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", str1);
          suppFileText.setText(str2);
        }
      }
    });
    Button localButton2 = createPushButton(localComposite, Messages.getString("ValgrindOptionsTab.File_System"), null);
    localButton2.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        String str = suppFileText.getText();
        FileDialog localFileDialog = new FileDialog(getShell(), 8192);
        str = localFileDialog.open();
        if (str != null) {
          suppFileText.setText(str);
        }
      }
    });
  }
  
  protected void handleToolChanged()
  {
    try
    {
      loadDynamicArea();
      if (launchConfigurationWorkingCopy == null) {
        if (launchConfiguration.isWorkingCopy()) {
          launchConfigurationWorkingCopy = ((ILaunchConfigurationWorkingCopy)launchConfiguration);
        } else {
          launchConfigurationWorkingCopy = launchConfiguration.getWorkingCopy();
        }
      }
      if (initDefaults) {
        dynamicTab.setDefaults(launchConfigurationWorkingCopy);
      }
      initDefaults = false;
      dynamicTab.initializeFrom(launchConfigurationWorkingCopy);
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
  }
  
  private void loadDynamicArea()
    throws CoreException
  {
    Control[] arrayOfControl;
    int j = (arrayOfControl = dynamicTabHolder.getChildren()).length;
    for (int i = 0; i < j; i++)
    {
      Control localControl = arrayOfControl[i];
      localControl.dispose();
    }
    dynamicTab = ValgrindLaunchPlugin.getDefault().getToolPage(tool);
    if (dynamicTab == null) {
      throw new CoreException(new Status(4, "org.eclipse.linuxtools.valgrind.launch", Messages.getString("ValgrindOptionsTab.No_options_tab_found") + tool));
    }
    dynamicTab.setLaunchConfigurationDialog(getLaunchConfigurationDialog());
    dynamicTab.createControl(dynamicTabHolder);
    dynamicTabHolder.layout(true);
  }
  
  public String getName()
  {
    return Messages.getString("ValgrindOptionsTab.Valgrind_Options");
  }
  
  public Image getImage()
  {
    return ValgrindLaunchPlugin.imageDescriptorFromPlugin("org.eclipse.linuxtools.valgrind.launch", "icons/valgrind-icon.png").createImage();
  }
  
  public void initializeFrom(ILaunchConfiguration paramILaunchConfiguration)
  {
    if (!canInitialize) {
      return;
    }
    isInitializing = true;
    getControl().setRedraw(false);
    launchConfiguration = paramILaunchConfiguration;
    launchConfigurationWorkingCopy = null;
    try
    {
      tool = paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.TOOL", "org.eclipse.linuxtools.valgrind.launch.memcheck");
      int i = -1;
      if (tool.contains("memcheck")) {
        i = 0;
      } else if (tool.contains("massif")) {
        i = 1;
      }
      if (i == 0)
      {
        collectData1Button.setSelection(true);
        collectData2Button.setSelection(false);
      }
      else if (i == 1)
      {
        collectData2Button.setSelection(true);
        collectData1Button.setSelection(false);
      }
      handleToolChanged();
      initializeGeneral(paramILaunchConfiguration);
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    getControl().setRedraw(true);
    isInitializing = false;
  }
  
  protected void initializeGeneral(ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException
  {
    traceChildrenButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_TRACECHILD", false));
    runFreeresButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_FREERES", true));
    demangleButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_DEMANGLE", true));
    numCallersSpinner.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_NUMCALLERS", 12));
    errorLimitButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_ERRLIMIT", true));
    showBelowMainButton.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_BELOWMAIN", false));
    maxStackFrameSpinner.setSelection(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_MAXFRAME", 2000000));
    suppFileText.setText(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_SUPPFILE", ""));
  }
  
  public boolean isValid(ILaunchConfiguration paramILaunchConfiguration)
  {
    if ((!canInitialize) || (ProfileLaunchPlugin.checkTarget() == 0))
    {
      setErrorMessage(Messages.getString("ValgrindOptionsTab.nodevice"));
      return false;
    }
    setErrorMessage(null);
    boolean bool = false;
    if ((bool = (isGeneralValid()) && (dynamicTab != null) ? 1 : 0) != 0) {
      bool = dynamicTab.isValid(paramILaunchConfiguration);
    }
    return bool;
  }
  
  protected boolean isGeneralValid()
  {
    String str = suppFileText.getText();
    boolean bool = false;
    if (str.equals("")) {
      bool = true;
    } else {
      try
      {
        File localFile = ValgrindLaunchPlugin.getDefault().parseWSPath(str);
        if ((localFile != null) && (localFile.exists())) {
          bool = true;
        }
      }
      catch (CoreException localCoreException)
      {
        localCoreException.printStackTrace();
      }
    }
    if (!bool) {
      setErrorMessage(NLS.bind(Messages.getString("ValgrindOptionsTab.suppressions_file_doesnt_exist"), str));
    }
    return bool;
  }
  
  public void performApply(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    if ((!canInitialize) || (ProfileLaunchPlugin.checkTarget() == 0)) {
      return;
    }
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.TOOL", tool);
    applyGeneralAttributes(paramILaunchConfigurationWorkingCopy);
    if (dynamicTab != null) {
      dynamicTab.performApply(paramILaunchConfigurationWorkingCopy);
    }
  }
  
  protected void applyGeneralAttributes(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_TRACECHILD", traceChildrenButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_FREERES", runFreeresButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_DEMANGLE", demangleButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_NUMCALLERS", numCallersSpinner.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_ERRLIMIT", errorLimitButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_BELOWMAIN", showBelowMainButton.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_MAXFRAME", maxStackFrameSpinner.getSelection());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_SUPPFILE", suppFileText.getText());
  }
  
  public void setDefaults(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    launchConfigurationWorkingCopy = paramILaunchConfigurationWorkingCopy;
    setDefaultGeneralAttributes(paramILaunchConfigurationWorkingCopy);
    if (dynamicTab != null)
    {
      dynamicTab.setDefaults(paramILaunchConfigurationWorkingCopy);
      initDefaults = false;
    }
  }
  
  public static void setDefaultGeneralAttributes(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.TOOL", "org.eclipse.linuxtools.valgrind.launch.memcheck");
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_TRACECHILD", false);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_FREERES", true);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_DEMANGLE", true);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_NUMCALLERS", 12);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_ERRLIMIT", true);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_BELOWMAIN", false);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_MAXFRAME", 2000000);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.valgrind.launch.GENERAL_SUPPFILE", "");
  }
  
  public void dispose()
  {
    if (dynamicTab != null) {
      dynamicTab.dispose();
    }
    super.dispose();
  }
  
  protected void createHorizontalSpacer(Composite paramComposite, int paramInt)
  {
    Label localLabel = new Label(paramComposite, 0);
    GridData localGridData = new GridData(768);
    horizontalSpan = paramInt;
    localLabel.setLayoutData(localGridData);
  }
  
  protected void updateLaunchConfigurationDialog()
  {
    if (!isInitializing) {
      super.updateLaunchConfigurationDialog();
    }
  }
  
  public static void showErrorDialog(String paramString1, String paramString2, Exception paramException)
  {
    String str = Messages.getString("ValgrindOptionsTab.Tool");
    final Status localStatus = new Status(4, str, 0, paramString2, paramException);
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        ErrorDialog.openError(null, "Valgrind Error", ValgrindOptionsTab.this, localStatus);
      }
    });
  }
}

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