@Override
 public void saveState(IMemento memento) {
   super.saveState(memento);
   memento.putInteger(DETAILS_VIEW_FLYOUT_STATE, detailsViewerFlyout.getPreferences().getState());
   memento.putInteger(
       PATTERNS_VIEWER_FLYOUT_STATE, patternsViewerFlyout.getPreferences().getState());
   memento.putString(
       PACKAGE_PRESENTATION_STATE,
       (patternsTreeViewer.getContentProvider() == flatCP) ? "flat" : "hierarchical");
 }
 /** Updates the check states of process tree viewer. */
 private void updateCheckedStates() {
   ITreeContentProvider cp = (ITreeContentProvider) processViewer.getContentProvider();
   if (config != null) {
     Object[] plugins = null;
     if (ConfigFreeProcessPublishUtil.getInstance().isSameMethodConfiguration(config)) {
       // For config free process publish
       plugins = cp.getChildren(LibraryService.getInstance().getCurrentMethodLibrary());
     } else {
       plugins = cp.getChildren(config);
     }
     for (int i = 0; i < plugins.length; i++) {
       Object[] uiFolders = cp.getChildren(plugins[i]);
       int totalUIFolders = uiFolders.length;
       int checkedUIFolders = 0;
       for (int j = 0; j < uiFolders.length; j++) {
         Object[] processes = cp.getChildren(uiFolders[j]);
         int totalProcesses = processes.length;
         int checkedProcesses = 0;
         for (int k = 0; k < processes.length; k++) {
           if (processViewer.getChecked(processes[k])) {
             checkedProcesses++;
           }
         }
         if (checkedProcesses == 0) {
           processViewer.setGrayChecked(uiFolders[j], false);
         } else if (checkedProcesses == totalProcesses) {
           processViewer.setGrayed(uiFolders[j], false);
           processViewer.setChecked(uiFolders[j], true);
         } else {
           processViewer.setGrayChecked(uiFolders[j], true);
         }
         if (processViewer.getChecked(uiFolders[j])) {
           checkedUIFolders++;
         }
       }
       if (checkedUIFolders == totalUIFolders) {
         processViewer.setGrayed(plugins[i], false);
         processViewer.setChecked(plugins[i], true);
       } else if (checkedUIFolders == 0) {
         processViewer.setGrayChecked(plugins[i], false);
       } else {
         processViewer.setGrayChecked(plugins[i], true);
       }
     }
   }
 }
 private ICheckboxTreeContentProvider contentProvider() {
   return (ICheckboxTreeContentProvider) treeViewer.getContentProvider();
 }