/*
   * (non-Javadoc)
   *
   * @see
   * org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.
   * debug.core.ILaunchConfigurationWorkingCopy)
   */
  @Override
  public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
    IPreferenceStore store = PreferenceConstants.getPreferenceStore(null);

    configuration.setAttribute(GENERATE_ABI, store.getBoolean(GENERATE_ABI));
    configuration.setAttribute(GENERATE_MARKDOWN, store.getBoolean(GENERATE_MARKDOWN));
    configuration.setAttribute(GENERATION_TARGET_DOC, store.getString(GENERATION_TARGET_DOC));
    configuration.setAttribute(GENERATE_ABI_TARGET, store.getString(GENERATE_ABI_TARGET));
  }
  /*
   * (non-Javadoc)
   *
   * @see
   * org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.
   * debug.core.ILaunchConfiguration)
   */
  @Override
  public void initializeFrom(ILaunchConfiguration configuration) {
    IPreferenceStore store = PreferenceConstants.getPreferenceStore(null);
    try {
      btnGenerateMarkdownReport.setSelection(
          configuration.getAttribute(GENERATE_MARKDOWN, store.getBoolean(GENERATE_MARKDOWN)));
      btnGenerateSingleAbi.setSelection(
          configuration.getAttribute(GENERATE_ABI, store.getBoolean(GENERATE_ABI)));
      docDirectoryText.setText(
          configuration.getAttribute(
              GENERATION_TARGET_DOC, store.getString(GENERATION_TARGET_DOC)));
      abiDirectoryText.setText(
          configuration.getAttribute(GENERATE_ABI_TARGET, store.getString(GENERATE_ABI_TARGET)));

      IResource member = findResource(configuration, docDirectoryText.getText());
      if (member != null) docDirectoryText.setText(member.getFullPath().toString());
      member = findResource(configuration, abiDirectoryText.getText());
      if (member != null) abiDirectoryText.setText(member.getFullPath().toString());

    } catch (CoreException e) {
      Activator.logError("Error initalizing from LauncheConfig", e);
    }
  }