@Override
 protected void setProfileAttributes(ILaunchConfigurationWorkingCopy wc) throws CoreException {
   ILaunchConfigurationTab tab = new ValgrindOptionsTab();
   tab.setDefaults(wc);
   tab = ValgrindLaunchPlugin.getDefault().getToolPage(getToolID());
   tab.setDefaults(wc);
   wc.setAttribute(LaunchConfigurationConstants.ATTR_TOOL, getToolID());
   wc.setAttribute(LaunchConfigurationConstants.ATTR_FULLPATH_AFTER, false);
 }
 @Override
 protected void setDefaultProfileAttributes(ILaunchConfigurationWorkingCopy wc)
     throws CoreException {
   ValgrindOptionsTab tab = new ValgrindOptionsTab();
   tab.setDefaults(wc);
   ILaunchConfigurationTab defaultTab =
       ValgrindLaunchPlugin.getDefault().getToolPage(MassifPlugin.TOOL_ID);
   defaultTab.setDefaults(wc);
 }
  @Override
  public void setActiveTab(ILaunchConfigurationTab tab) {
    if (activeTab != null) {
      activeTab.deactivated(workingCopy);
      activeTab.getControl().dispose();
    }

    activeTab = tab;

    if (activeTab != null) {
      launchConfigArea.setRedraw(false);

      configNameText.setVisible(true);

      activeTab.createControl(launchConfigArea);
      //      GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL,
      // SWT.BEGINNING).applyTo(
      //          activeTab.getControl());
      launchConfigArea.setContent(activeTab.getControl());
      activeTab.getControl().setSize(activeTab.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT));
      configUI.layout(true);

      activeTab.activated(workingCopy);

      launchConfigArea.setRedraw(true);
    } else {
      configNameText.setVisible(false);
    }

    updateButtons();
    updateMessage();
  }
  @Override
  public void updateMessage() {
    try {
      verifyName();
    } catch (CoreException ce) {
      setErrorMessage(ce.getStatus().getMessage());
      return;
    }

    if (activeTab != null) {
      String errorMessage = activeTab.getErrorMessage();

      if (errorMessage != null) {
        setErrorMessage(errorMessage);
      } else {
        setMessage(activeTab.getMessage());
        setErrorMessage(null);
      }
    } else {
      setMessage(null);
      setErrorMessage(null);
    }
  }
 private boolean canEnableButton() {
   return activeTab != null && activeTab.getErrorMessage() == null && canLaunch();
 }