Hamas started this war out of desperation. Their popularity is declining and they're out of cash to pay their 20,000 trained terrorists and 50,000 civil employees. But they have a large stock of Iranian-supplied rockets and an underground network of tunnels to protect themselves and their arms.
Hamas wants to project strength to improve their image among Palestinians and to achieve several urgent objectives: opening their border with Sinai (to bring in arms, supplies and money), and release of their members who were imprisoned during the search for the three murdered teens.
Sadly, a lasting cease-fire doesn't appear imminent. First, Israeli and Hamas demands are far apart. Israel rejects Hamas's demands and has its own objectives: to destroy the terrorist tunnels and stop the rockets. This could take several weeks.
Second, Hamas believes they're winning the war because: Israel hasn't been able to stop the rockets launched at Tel Aviv; Hamas has penetrated the border and killed Israeli soldiers; and they believe civilian deaths in Gaza will turn world opinion in their favour.
Also, Hamas doesn't trust the current government in Egypt to negotiate. They'd prefer to have the sympathetic Turks and Qataris as mediators. So there are many hurdles to achieving a cease-fire.