Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Textual Concrete Syntax (TCS) » creating multiple perspective in a single plugin.xml
creating multiple perspective in a single plugin.xml [message #469387] Fri, 26 December 2008 10:22
Susanta is currently offline SusantaFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

I am creating 2 perspective in a single application.when i click a button
in a perspective i need to open another perspective.

Below is the changes in plugin.xml :

<extension
point="org.eclipse.ui.perspectives">
<perspective
name="Retail"
class="com.teamcenter.rac.tcretail.RetailPerspective"
id="com.teamcenter.rac.tcretail.perspective">
</perspective>
<perspective
name="SearchPerspective"
class="com.teamcenter.rac.tcretail.SearchPerspective"
id="com.teamcenter.rac.tcretail.SearchPerspective">
</perspective>
</extension>

Below is the code for the button's action in the java file :

private static final String SEARCH_PERSPECTIVE_ID =
com.teamcenter.rac.tcretail.SearchPerspective;

addExistButton.addSelectionListener(new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent event)
{

try
{
//use to open SearcView.

RACRetailUIPlugin.getDefault().openPerspective(SEARCH_PERSPE CTIVE_ID);
}
catch( Exception e1 )
{
e1.printStackTrace();
}
}
});


When i am clicking the button in the Retail perspective i am opening with
the search perspective. but i am getting the below null pointer exception.
Can you please tell me where i am going wrong.

Exception i got :

ERROR: 15:50:41,627 - TcLogger$IC_LogListener.logging:?
org.eclipse.core.runtime - org.eclipse.ui.workbench - 2 - Problems
occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
java.lang.NullPointerException
at
com.teamcenter.rac.aif.AIFDesktop$IC_PerspectiveListener.per spectiveActivated(Unknown
Source)
at
org.eclipse.ui.internal.PerspectiveListenerList$1.run(Perspe ctiveListenerList.java:74)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at
org.eclipse.ui.internal.PerspectiveListenerList.fireEvent(Pe rspectiveListenerList.java:58)
at
org.eclipse.ui.internal.PerspectiveListenerList.firePerspect iveActivated(PerspectiveListenerList.java:72)
at
org.eclipse.ui.internal.WorkbenchWindow.firePerspectiveActiv ated(WorkbenchWindow.java:1295)
at
org.eclipse.ui.internal.WorkbenchPage.setPerspective(Workben chPage.java:3464)
at
org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(Wor kbenchPage.java:988)
at org.eclipse.ui.internal.WorkbenchPage.access$17(WorkbenchPag e.java:972)
at org.eclipse.ui.internal.WorkbenchPage$18.run(WorkbenchPage.j ava:3560)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.setPerspective(Workben chPage.java:3558)
at
org.eclipse.ui.internal.ChangeToPerspectiveMenu.run(ChangeTo PerspectiveMenu.java:92)
at org.eclipse.ui.actions.PerspectiveMenu.run(PerspectiveMenu.j ava:336)
at
org.eclipse.ui.actions.PerspectiveMenu.runOther(PerspectiveM enu.java:352)
at
org.eclipse.ui.actions.PerspectiveMenu$3.runWithEvent(Perspe ctiveMenu.java:108)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:545)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.teamcenter.rac.aifrcp.Application.runApplication(Unknown Source)
at com.teamcenter.rac.aifrcp.Application.start(Unknown Source)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:153)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Previous Topic:Welcome to eclipse.tcs
Next Topic:creating multiple perspective in a single plugin.xml
Goto Forum:
  


Current Time: Fri Nov 28 10:06:48 GMT 2014

Powered by FUDForum. Page generated in 0.01719 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software