1st Chronicles 28:4 gives us a little peek into the recesses of David's heart. Clearly, he felt God's favor; God's smile; God's pleasure. And, he was discernibly touched by the fact that God in mercy and grace had particularly chosen to bless him. "Of all my older brothers," he told the aristocrats, bureaucrats, captains and oligarchs whom he had assembled, "...of all of the men in Israel, in Judah and in the house of Jesse... God picked me! God liked me!" It was a statement indicative of David's continual worship, humility and sincere amazement that his life had been SO blessed by God.
Now, as much as God liked David, He still wasn't willing to just give him anything he wanted. Again, all Dave wanted to build a temple, yet God refused to allow that. So, David did the next best thing. And, in doing that, he prepared his heir apparent (and all of Israel, really) for the wonderful task of temple construction. David even handed him the blueprint showing exactly what had to be done and how to do it (the blueprint, which, incidentally, GOD had given to David - see I Chronicles 28:12 & 19). All Solomon had to do was trust God... and carry out the plan.