protected void changeSelection(final TreeItem item, final boolean select) {
   SelectableFeature feature = (SelectableFeature) item.getData();
   if (feature.getAutomatic() == Selection.UNDEFINED) {
     switch (feature.getManual()) {
       case SELECTED:
         set(feature, (select) ? Selection.UNDEFINED : Selection.UNSELECTED);
         break;
       case UNSELECTED:
         set(feature, (select) ? Selection.SELECTED : Selection.UNDEFINED);
         break;
       case UNDEFINED:
         set(feature, (select) ? Selection.SELECTED : Selection.UNSELECTED);
         break;
       default:
         set(feature, Selection.UNDEFINED);
     }
     if (!dirty) {
       setDirty();
     }
     if (configurationEditor.isAutoSelectFeatures()) {
       computeTree(false);
       //				updateInfoLabel();
     } else {
       refreshItem(item, feature);
       if (configurationEditor.getConfiguration().canBeValid()) {
         invalidFeatures.clear();
       } else {
         invalidFeatures.add(feature);
       }
       //				updateInfoLabel();
     }
   }
 }
 /**
  * Colors all features if they lead to a valid configuration if current configuration is invalid.
  * deselect:blue, select:green
  */
 protected IConfigJob<?> computeColoring(final Display currentDisplay) {
   if (!configurationEditor.isAutoSelectFeatures()
       || configurationEditor.getConfiguration().isValid()) {
     return null;
   }
   final List<SelectableFeature> featureList =
       configurationEditor.getConfiguration().getManualFeatures();
   final IConfigJob<?> job =
       configurationEditor
           .getConfiguration()
           .getPropagator()
           .getJobWrapper()
           .leadToValidConfiguration(featureList);
   job.setIntermediateFunction(
       new IFunction<Object, Void>() {
         @Override
         public Void invoke(Object t) {
           if (t instanceof SelectableFeature) {
             final SelectableFeature feature = (SelectableFeature) t;
             final TreeItem item = itemMap.get(feature);
             if (item == null) {
               return null;
             }
             currentDisplay.asyncExec(
                 new Runnable() {
                   @Override
                   public void run() {
                     if (feature.getAutomatic() == Selection.UNDEFINED) {
                       switch (feature.getRecommended()) {
                         case SELECTED:
                           item.setFont(treeItemSpecialFont);
                           item.setForeground(green);
                           break;
                         case UNSELECTED:
                           item.setFont(treeItemSpecialFont);
                           item.setForeground(blue);
                           break;
                         case UNDEFINED:
                           item.setFont(treeItemStandardFont);
                           item.setForeground(null);
                           break;
                       }
                     }
                   }
                 });
           }
           return null;
         }
       });
   return job;
 }
 protected IConfigJob<?> computeFeatures(
     final boolean redundantManual, final Display currentDisplay) {
   if (!configurationEditor.isAutoSelectFeatures()) {
     return null;
   }
   final TreeItem topItem = tree.getTopItem();
   SelectableFeature feature = (SelectableFeature) (topItem.getData());
   final IConfigJob<?> job =
       configurationEditor
           .getConfiguration()
           .getPropagator()
           .getJobWrapper()
           .update(redundantManual, feature.getFeature().getName());
   job.setIntermediateFunction(
       new IFunction<Object, Void>() {
         @Override
         public Void invoke(Object t) {
           if (t instanceof SelectableFeature) {
             final SelectableFeature feature = (SelectableFeature) t;
             final TreeItem item = itemMap.get(feature);
             if (item == null) {
               return null;
             }
             currentDisplay.asyncExec(
                 new Runnable() {
                   @Override
                   public void run() {
                     updateFeatures.remove(feature);
                     refreshItem(item, feature);
                   }
                 });
           }
           return null;
         }
       });
   return job;
 }