Execute code when loading an Eclipse perspective
I'm creating an Eclipse plug-in which amongst other things creates a new perspective. I want to I execute some code when the perspective loads. Previously I was doing this through createIni开发者_开发知识库tialLayout
of IPerspectiveFactory
but then I realized that this is for defining the page layout only and is usually called when when launching the perspective for the first time only.
How can I specify some code to execute whenever the perspective is displayed? (e.g. when it is loaded as the default perspective by Eclipse)
Thanks and regards, Krt_Malta
Check the documentation for the IPerspectiveListener interface or the PerspectiveAdapter class, the perspective lifecycle events are explained there.
精彩评论