code: private CommonControlState getButtonType(Which state) {
          switch (state) {
  
          case BACKGROUND_DISABLED:
              return CommonControlState.DISABLED;
  
          case BACKGROUND_ENABLED:
              return CommonControlState.ENABLED;
  
          case BACKGROUND_PRESSED:
          case BACKGROUND_SELECTED:
              return CommonControlState.PRESSED;
  
          case FOREGROUND_ENABLED:
          case FOREGROUND_PRESSED:
          case FOREGROUND_SELECTED:
          case FOREGROUND_ENABLED_EDITABLE:
              return CommonControlState.ENABLED;
  
          case FOREGROUND_DISABLED:
          case FOREGROUND_DISABLED_EDITABLE:
              return CommonControlState.DISABLED;
          }
  
          return null;
      }
docs: Get the CommonControlState for the state.
  
  @param  state the control state.
  
  @return the common control color state.