Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Integrating birt perspective into new rcp-application
Integrating birt perspective into new rcp-application [message #889831] Tue, 19 June 2012 16:20 Go to next message
Sam Missing name is currently offline Sam Missing name
Messages: 14
Registered: May 2011
Junior Member
Hi,

I have to integrate the birt-report-design perspective into our rcp-application.
I tried with:

PlatformUI.getWorkbench().openWorkbenchWindow(
"org.eclipse.birt.report.designer.ui.ReportPerspective",null);

But the workbench window which opens looks like in the attached image.

I thought i might have to provide a parameter so i tried to debug the opening of the birt-perspective when its running in eclipse, but didnt find the right place to start.

Do you have any idea what i did wrong?

Thanks in advance

  • Attachment: screen229.png
    (Size: 16.91KB, Downloaded 100 times)
Re: Integrating birt perspective into new rcp-application [message #889850 is a reply to message #889831] Tue, 19 June 2012 18:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Have you tried showPerspective? I pulled this form a test in the source:

package org.eclipse.birt.report.designer.testutil;

import junit.framework.TestCase;

import org.eclipse.birt.report.designer.tests.ITestConstants;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;

/**
* Base class of BIRT GUI Features test
*/
public class BirtUITestCase extends TestCase implements ITestConstants
{

protected IWorkbench tWorkbench;

protected IWorkbenchWindow tWindow;

protected IWorkbenchPage tPage;

protected IPerspectiveDescriptor tPerspectiveDescriptor;

protected IEditorPart tEditor = null;

/*
* (non-Javadoc)
*
* @see junit.framework.TestCase#setUp()
*/
protected void setUp( ) throws Exception
{
tWorkbench = PlatformUI.getWorkbench( );
tWindow = tWorkbench.getActiveWorkbenchWindow( );
tPage = tWindow.getActivePage( );
tPerspectiveDescriptor = tWorkbench.getPerspectiveRegistry( )
.findPerspectiveWithId( PERSPECTIVE_ID );
}

/**
* Switch to the Report Designer Perspective
*/

protected void showPerspective( ) throws Exception
{
tWorkbench.showPerspective( PERSPECTIVE_ID, tWindow );
}

/**
* Opens the ReportEditor
*
* @return the Report Editor
*/

protected IEditorPart openEditor( ) throws Exception
{
if ( tEditor == null )
{
IProject p = FileUtil.createProject( TEST_PROJECT_NAME );

IFile f = FileUtil.createFile( TEST_DESIGN_FILE, p );
tEditor = tPage.openEditor( new FileEditorInput( f ), EDITOR_ID );
}
return tEditor;
}

/**
* Saves the opened editor
*/
protected void saveEditor( )
{
if ( tEditor != null )
{
tEditor.doSave( null );
}
}

/**
* Closes the opened editor without saving changes
*/
protected void closeEditor( )
{
if ( tEditor != null )
{
tPage.closeEditor( tEditor, false );
tEditor = null;
}
}

/**
* Gets the ViewPart with the specified id
*
* @param id
* the id of view part
*
* @return Returns the view part, or null if not found
*/

protected IViewPart getView( String id )
{
IViewReference[] v = tPage.getViewReferences( );
int i;
for ( i = 0; i < v.length; i++ )
{
if ( v[i].getId( ).equals( id ) )
return (IViewPart) v[i].getPart( true );
}
return null;
}
}


Jason


On 6/19/2012 4:20 PM, Sam Mising name wrote:
> Hi,
>
> I have to integrate the birt-report-design perspective into our rcp-application.
> I tried with:
>
> PlatformUI.getWorkbench().openWorkbenchWindow(
> "org.eclipse.birt.report.designer.ui.ReportPerspective",null);
>
> But the workbench window which opens looks like in the attached image.
>
> I thought i might have to provide a parameter so i tried to debug the opening of the birt-perspective when its running in eclipse, but didnt find the right place to start.
>
> Do you have any idea what i did wrong?
>
> Thanks in advance
>
>
Re: Integrating birt perspective into new rcp-application [message #890140 is a reply to message #889850] Thu, 21 June 2012 05:08 Go to previous messageGo to next message
Sam Missing name is currently offline Sam Missing name
Messages: 14
Registered: May 2011
Junior Member
Thank you for your reply.
Your suggestion didnt help in my case, but i figured out the problem was:

1. The WorkbenchWindowAdvisor of our application did deactivate many parts of the workbench, as in our application you dont recognize it to be based on eclipse rcp.
So i had to implement a Factory in the application where you can set the .class of from the advisor you want to be created.
When the new WorkbenchWindow is created the rcp-framework calls the createAdvisor-method located in the application and so the new advisor is returned.
2. Not all necessary plugins were started.

There is only one problem left:
The navigor shows nothing, but i can right-click and add new projects, then you see an empty entry, but if you restart its empty again even the projects are in the workspace.
If you add a new report you see all projects in the wizard, but again as empty lines.
Images are attached.

Thanks for your help
Re: Integrating birt perspective into new rcp-application [message #1016200 is a reply to message #890140] Tue, 05 March 2013 08:17 Go to previous message
Bastian Wagenfeld is currently offline Bastian Wagenfeld
Messages: 162
Registered: January 2013
Senior Member
Hi,

It's been a while, but I'm experiencing the same problem. Did you find a solution for it? That would be very helpful.

Best regards
Bastian
Previous Topic:YYYY vs yyyy in onrender()
Next Topic:Reports Run Multiple Times
Goto Forum:
  


Current Time: Fri Aug 29 08:31:22 EDT 2014

Powered by FUDForum. Page generated in 0.01985 seconds