Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

istartup plugin does nto work in jazz

i wrote some code to display a message whenever a user changes the perspective. this works in eclipse as a plug in, but it does not work in RTC. it uses istartup plugin. my code is below:
public class startupperspective implements IStartup {

public void earlyStartup() {
/*
* The registration of the listener should have been done in the UI thread
* since PlatformUI.getWorkbench().getActiveWorkbenchWindow() returns null
* if it is called outside of the UI thread.
* */
System.out.print("aba");
Display.getDefault().asyncExec(new Runnable() {
/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
public void run() {
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (workbenchWindow != null) {
workbenchWindow.addPerspectiveListener(new PerspectiveAdapter() {
/* (non-Javadoc)
* @see org.eclipse.ui.PerspectiveAdapter#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
@Override
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspectiveDescriptor) {
super.perspectiveActivated(page, perspectiveDescriptor);
// TODO implement the task to execute when the perspective change
//System.out.println("Something changed!");
String e, d1, d, s, l, n;
s= perspectiveDescriptor.getDescription();
n = perspectiveDescriptor.getId();
l= perspectiveDescriptor.getLabel();


IEditorPart viewDescription = PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (viewDescription!=null) {
e = viewDescription.getEditorInput().getName();
}
else{
e="";
}

if (viewDescription!=null) {
d1= viewDescription.getEditorSite().getRegisteredName();
}
else{
d1="";
}

MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "perspective", n+" : "+s+" : "+l+" file: "+e+" editor:"+d1);
}
});
}
}
});
}

}

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,953

Question asked: Jul 19 '10, 11:25 a.m.

Question was seen: 4,314 times

Last updated: Jul 19 '10, 11:25 a.m.

Confirmation Cancel Confirm