/** Initializes the wizard page controls with data. */
  protected void initControls() {
    String configId = config != null ? config.getGuid() : ""; // $NON-NLS-1$

    if ((config != null)
        && ConfigFreeProcessPublishUtil.getInstance().isSameMethodConfiguration(config)) {
      // For config free process publish
      processViewer.setContentProvider(new ProcessViewerOfConfigFreeContentProvider());
      publishConfigRadioButton.setEnabled(false);
      publishConfigRadioButton.setSelection(false);
      publishProcessesRadioButton.setSelection(true);
      processViewer.getControl().setEnabled(true);

      List<String> processIds = PublishingUIPreferences.getProcesses(configId);
      List<Process> processes = new ArrayList<Process>();
      if (processIds != null) {
        for (String guid : processIds) {
          MethodElement e =
              LibraryService.getInstance().getCurrentLibraryManager().getMethodElement(guid);
          if (e instanceof Process) {
            processes.add((Process) e);
          }
        }
      }
      processViewer.setCheckedElements(processes.toArray());

      boolean includeBaseProcess = PublishingUIPreferences.getIncludeBaseProcesses(configId);
      includeBaseProcessesCheckbox.setSelection(includeBaseProcess);

      updateCheckedStates();
    } else {
      processViewer.setContentProvider(new ProcessViewerContentProvider());
      boolean publishConfig = PublishingUIPreferences.getPublishEntireConfig(configId);
      publishConfigRadioButton.setEnabled(true);
      publishConfigRadioButton.setSelection(publishConfig);
      publishProcessesRadioButton.setSelection(!publishConfig);
      processViewer.getControl().setEnabled(!publishConfig);

      if (!publishConfig) {
        List<String> processIds = PublishingUIPreferences.getProcesses(configId);
        List<Process> processes = new ArrayList<Process>();
        if (processIds != null) {
          for (String guid : processIds) {
            MethodElement e =
                LibraryService.getInstance().getCurrentLibraryManager().getMethodElement(guid);
            if (e instanceof Process) {
              processes.add((Process) e);
            }
          }
        }
        processViewer.setCheckedElements(processes.toArray());
      }

      boolean includeBaseProcess = PublishingUIPreferences.getIncludeBaseProcesses(configId);
      includeBaseProcessesCheckbox.setSelection(includeBaseProcess);

      updateCheckedStates();
    }
  }
 public void savePreferences() {
   if (config != null) {
     String configId = config.getGuid();
     boolean publishConfig = publishConfigRadioButton.getSelection();
     PublishingUIPreferences.setPublishEntireConfig(configId, publishConfig);
     if (publishConfig) {
       List<String> processIds = new ArrayList<String>();
       PublishingUIPreferences.setProcesses(configId, processIds);
     } else {
       List<String> processIds = new ArrayList<String>();
       for (org.eclipse.epf.uma.Process process : getSelectedProcesses()) {
         processIds.add(process.getGuid());
       }
       PublishingUIPreferences.setProcesses(configId, processIds);
     }
     PublishingUIPreferences.setIncludeBaseProcesses(
         configId, includeBaseProcessesCheckbox.getSelection());
   }
 }