Integrating birt perspective into new rcp-application [message #889831] |
Tue, 19 June 2012 16:20  |
Eclipse User |
|
|
|
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 #889850 is a reply to message #889831] |
Tue, 19 June 2012 18:18   |
Eclipse User |
|
|
|
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
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04230 seconds