To cook the leeks: Heat the olive oil in a medium skillet (preferably nonstick) over medium heat. Add the leeks and sauté, stirring frequently, until limp and lightly browned, about 15 minutes. Spread the leeks evenly in the bottom of an oiled 2-qt. shallow gratin dish (preferably oval). Let cool.
To cook the potatoes: In a medium saucepan, cover the potato slices with well-salted water and bring to a boil. Reduce the heat to a gentle boil and cook for 5 minutes or until the potatoes are just barely tender. Drain and rinse under cold water until cool. Pat dry. Toss the potatoes with the salt, olive oil, and rosemary.
To assemble the gratin: Heat the oven to 375°F. Sprinkle 1/2 tsp. of the chopped rosemary over the leeks. Starting at one end of the baking dish, lay a row of slightly overlapping tomato slices across the width of the dish. Prop the tomatoes against the dish at a 60-degree angle. Cover the row of tomatoes with a generous sprinkling of Gruyère. Next, arrange a row of potato slices over the tomatoes. Sprinkle again with Gruyère. Repeat with alternating rows of tomatoes and potatoes, sprinkling each with cheese, until the gratin is full.
Sprinkle about 1/2 tsp. salt and the remaining 1/2 tsp. rosemary over all and season with pepper. Drizzle with the olive oil. Mix any remaining Gruyère with the breadcrumb mixture and spread this over the whole gratin. Cook until the gratin is well-browned all over and the juices have bubbled for a while and reduced considerably, 60 to 65 minutes. Let cool for at least 15 minutes before serving.
ou can fully cook this gratin several hours ahead, let it cool, and then reheat it again before serving.