Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Add new prespective : createInitialLayout never gets called.
Add new prespective : createInitialLayout never gets called. [message #14385] Fri, 25 July 2008 12:30 Go to next message
Prasanna K is currently offline Prasanna KFriend
Messages: 78
Registered: July 2009
Member
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 12:23 Go to previous message
Eclipse UserFriend
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 12:23 Go to previous message
Jeroen Lankheet is currently offline Jeroen LankheetFriend
Messages: 31
Registered: July 2009
Member
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.
Previous Topic:[P2] Problem creating repository with .product when exporting for multiple platforms
Next Topic:import existing project into workspace extension point
Goto Forum:
  


Current Time: Fri Apr 26 03:58:20 GMT 2024

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

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

Back to the top