I like Atlan's response but would like to add a bit. Your question is can it be done. I believe a self-sustaining colony/habitat could be constructed in the near future. However, my biggest question would be what kind of life would it be? Anyone in that kind of habitat would only be able to survive off the resources supplied to them. EVERYTHING would be limited to that which was placed in the habitat during construction. If the purpose of the habitat is to provide a base of operations to mine or do other things that allow for growth, then I think it's a good idea. Otherwise, it's more like a prison.
Smart man here. Very smart. But not that cognizant of seagoing history, thousands of years of the virtual colonization of the Maritime Frontier, one the greatest untold stories. Next to farming, which I'm one of the fewest to recognize would be a land office business for the colonies, the second great industry would be ship building, including further colony construction -- shipping. O'Neill among others whose primary interests were not history -- among other things -- thought in terms of gigantic solar satellites being the primary industry of the in-space colonies. No way, Jose (as the saying goes). These would be city-states coming into being, the likes of Athens and the other Greek city-states of Greece, Italy, and Spain, Troy and Phoenicia and Carthage, and even, somewhat Rome. Much later on, Venice and the other Renaissance Italian city-states, and even Britain. Even later, Hong Kong and Singapore and the like. Not one self-supporting, except to an [early] degree, Britain.
You won't, because it won't interest you very much probably, but you should read the 'Influence of Sea Power Upon History' by Alfred Thayer Mahan, and think 'The Influence of Space Power Upon Future History'. Nothing, no one, but those in-space colonies will be in such a position. The real highland frontier. The real high seas of space frontier. The only true connection to all the mass material and energy resources of the solar system. The only users, the only expansionist states, period(!), physically capable of making use of it all.
There will be those who will only want to go about their local business and industry, like mining, farming, or shipbuilding. But like Crevecouer said about Old Worlders landing for the first time in the New World, there will those who minds will expand vastly to match the new environment of a vast frontier. The colonies will be no more than bases for much, much, greater things to them. And like the New World of 1772, they will have the material resources out there to work wonders with. And they will have the Old World, now becoming a part of the New World, hungry for them to do it. Hungry for the growing exchange of energies rather than any dumping of material resource on an Earth that can't use it.
I think that's enough for now.
Mod Edit - Keep it professional