Since 1948, there have been a few proposals for compromises where the Palestinians got some territories and the Israelis got some territories. IF the Palestinians had accepted any one of those settlements, there would have been established borders and the Israeli settlements in those territories would not have been possible because it would have been under Palestinian law. ANY treaty would have settled that matter. The lack of a treaty is the only way that the settlements CAN occur.
IMO unless the Palestinian leadership is willing to sign a treaty that establishes a Palestinian territory as less than from the river to the sea, it leaves Israel with little choice but to either accept the status quo of continuous violence, or to, at some point, go or a militiary win. And yes, that could mean simply taking over Gaza and West Bank completely and drive everyone out. Force the UN to re-settle them ANYWHERE else but the new Israeli territories.
I think there IS a third option. The international community forces a partitian. Gaza and West Bank are handed to the Palestinian Authority and SOME international military force occupies those lands and actively STOPS organizations like Quds from attacking Israel. And prevents supplies from being coopted for that purpose. That would enable remove the Israeli interest in restricting international trade.