When writing Junit plugin tests in Eclipse I wanted to close the welcome page programmatically before starting the tests; looks like it's pretty easy :) Just use this @BeforeClass static method and you'll be fine!
@BeforeClass
public static void closeWelcome() {
final IIntroManager introManager =
PlatformUI.getWorkbench().getIntroManager();
IIntroPart part = introManager.getIntro();
introManager.closeIntro(part);
}
1 comment:
Very interesting tip.
Could I suggest a little modification?
I suggest
if (part != null)
introManager.closeIntro(part);
instead of just
introManager.closeIntro(part);
Ciao,
Emilio
Post a Comment