Add new prespective : createInitialLayout never gets called. [message #14385] |
Fri, 25 July 2008 08:30  |
Eclipse User |
|
|
|
I have created a new perspective called TestPerspective.
When I run the application and switch to my new perspective, the switch
happens but the views I have added do not show up. Instead an empty page
appears.
Here is my extension :
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="my.plugin.perspectives.MyPerspective"
icon="icons/mylogo.gif"
id="my.plugin.perspectives.main"
name="My Perspective">
</perspective>
</extension>
And here is the class
package my.plugin.perspectives;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class MyPerspective implements IPerspectiveFactory {
@Override
public void createInitialLayout(IPageLayout layout) {
System.out.println("--------------Inside perspective-------");
String editorArea = layout.getEditorArea();
// place a view on the left
IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
(float)0.26, editorArea);
left.addView(IPageLayout.ID_RES_NAV);
left.addView(IPageLayout.ID_OUTLINE);
}
}
The println statement inside createInitialLayout method also doesn't show
up on the console.
Google search led me to a previous thread which suggested me to clear
metadata directory which I did with no results.
What should I be doing?
Thanks in advance.
|
|
|
Re: Add new prespective : createInitialLayout never gets called. [message #18948 is a reply to message #14385] |
Wed, 03 September 2008 08:23  |
Eclipse User |
|
|
|
Originally posted by: yeronimuz.aol.com
Prasanna wrote:
> I have created a new perspective called TestPerspective.
> When I run the application and switch to my new perspective, the switch
> happens but the views I have added do not show up. Instead an empty page
> appears.
> Here is my extension :
> <extension
> point="org.eclipse.ui.perspectives">
> <perspective
> class="my.plugin.perspectives.MyPerspective"
> icon="icons/mylogo.gif"
> id="my.plugin.perspectives.main"
> name="My Perspective">
> </perspective>
> </extension>
> And here is the class
>
>
> package my.plugin.perspectives;
>
> import org.eclipse.ui.IFolderLayout;
> import org.eclipse.ui.IPageLayout;
> import org.eclipse.ui.IPerspectiveFactory;
>
> public class MyPerspective implements IPerspectiveFactory {
>
> @Override
> public void createInitialLayout(IPageLayout layout) {
> System.out.println("--------------Inside perspective-------");
> String editorArea = layout.getEditorArea();
> // place a view on the left
> IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
> (float)0.26, editorArea);
> left.addView(IPageLayout.ID_RES_NAV);
> left.addView(IPageLayout.ID_OUTLINE);
> }
> }
>
> The println statement inside createInitialLayout method also doesn't
> show up on the console.
>
> Google search led me to a previous thread which suggested me to clear
> metadata directory which I did with no results.
> What should I be doing?
> Thanks in advance.
>
>
I have the same problem. When doing a Reset Perspective I get my views and most menu contributions.
Switching to a perspective using code doesn't do the trick either.
|
|
|
Re: Add new prespective : createInitialLayout never gets called. [message #578321 is a reply to message #14385] |
Wed, 03 September 2008 08:23  |
Eclipse User |
|
|
|
Prasanna wrote:
> I have created a new perspective called TestPerspective.
> When I run the application and switch to my new perspective, the switch
> happens but the views I have added do not show up. Instead an empty page
> appears.
> Here is my extension :
> <extension
> point="org.eclipse.ui.perspectives">
> <perspective
> class="my.plugin.perspectives.MyPerspective"
> icon="icons/mylogo.gif"
> id="my.plugin.perspectives.main"
> name="My Perspective">
> </perspective>
> </extension>
> And here is the class
>
>
> package my.plugin.perspectives;
>
> import org.eclipse.ui.IFolderLayout;
> import org.eclipse.ui.IPageLayout;
> import org.eclipse.ui.IPerspectiveFactory;
>
> public class MyPerspective implements IPerspectiveFactory {
>
> @Override
> public void createInitialLayout(IPageLayout layout) {
> System.out.println("--------------Inside perspective-------");
> String editorArea = layout.getEditorArea();
> // place a view on the left
> IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
> (float)0.26, editorArea);
> left.addView(IPageLayout.ID_RES_NAV);
> left.addView(IPageLayout.ID_OUTLINE);
> }
> }
>
> The println statement inside createInitialLayout method also doesn't
> show up on the console.
>
> Google search led me to a previous thread which suggested me to clear
> metadata directory which I did with no results.
> What should I be doing?
> Thanks in advance.
>
>
I have the same problem. When doing a Reset Perspective I get my views and most menu contributions.
Switching to a perspective using code doesn't do the trick either.
|
|
|
Powered by
FUDForum. Page generated in 0.02757 seconds