How to get or create the PerspectiveSwitcher Bar? [message #117211] |
Sat, 27 December 2008 13:23 |
CAO Dahai Messages: 16 Registered: July 2009 |
Junior Member |
|
|
I use PerspectiveSwitcher to create default Perspective bar in my
ApplicationWorkbenchWindowAdvisor#createWindowContents(final Shell shell),
and my code is :
if (getWindowConfigurer().getShowPerspectiveBar()) {
perspectiveSwitcher = new PerspectiveSwitcher(getWindowConfigurer()
.getWindow(), banner, perspectiveBarStyle());
perspectiveSwitcher.createControl(shell);
}
But the exception occurs :
java.lang.NullPointerException
at
org.eclipse.ui.internal.PerspectiveSwitcher.createControlFor Location(PerspectiveSwitcher.java:511)
at
org.eclipse.ui.internal.PerspectiveSwitcher.setPerspectiveBa rLocation(PerspectiveSwitcher.java:320)
at
org.eclipse.ui.internal.PerspectiveSwitcher.createControl(Pe rspectiveSwitcher.java:232)
the position is at line: getTrimManager().removeTrim(this);
getTrimManager() is null.
I found that I have no any way to set the TrimManager. How can create the
default Perspective bar without null pointer exception?
thank you!
Dahai CAO
|
|
|
Powered by
FUDForum. Page generated in 0.03236 seconds