Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to do away with hard coding of view
How to do away with hard coding of view [message #448774] Tue, 02 May 2006 01:48 Go to next message
Eclipse UserFriend
Originally posted by: jojy.sv.gmail.com

Hi all,

I have created an RCP application with a perspective associated with it.
In addition to that I have created some where around 3 to 4 views.Now I
need to place these views in the perspective.I have done with this using
perspective extension.

Here I am facing a problem, in order to make use of the perspective
extension I should have one view added programatically (as of my
knowledge).But I dont want to put the view id into code.

This is what I have seen in the sample RCP mail app where the view is
added to layout programatically.

public class Perspective implements IPerspectiveFactory {

public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);

layout.addStandaloneView(NavigationView.ID, false, IPageLayout.LEFT,
0.25f, editorArea);
IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP,
0.5f, editorArea);
folder.addPlaceholder(View.ID + ":*");
folder.addView(View.ID);

layout.getViewLayout(NavigationView.ID).setCloseable(false);
}
}

But I want to position my views only by using the extension point
mechanism.

Is there any way by which I can achieve it.

Regards
George S
Re: How to do away with hard coding of view [message #448784 is a reply to message #448774] Tue, 02 May 2006 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jojy.sv.gmail.com

Hi all,

For my below mentioned issue.
Can I solve with the sticky view ??
I tried the same but could't get through

George S
George S wrote:

> Hi all,

> I have created an RCP application with a perspective associated with it.
> In addition to that I have created some where around 3 to 4 views.Now I
> need to place these views in the perspective.I have done with this using
> perspective extension.

> Here I am facing a problem, in order to make use of the perspective
> extension I should have one view added programatically (as of my
> knowledge).But I dont want to put the view id into code.

> This is what I have seen in the sample RCP mail app where the view is
> added to layout programatically.

> public class Perspective implements IPerspectiveFactory {

> public void createInitialLayout(IPageLayout layout) {
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible(false);

> layout.addStandaloneView(NavigationView.ID, false, IPageLayout.LEFT,
> 0.25f, editorArea);
> IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP,
> 0.5f, editorArea);
> folder.addPlaceholder(View.ID + ":*");
> folder.addView(View.ID);

> layout.getViewLayout(NavigationView.ID).setCloseable(false);
> }
> }

> But I want to position my views only by using the extension point
> mechanism.

> Is there any way by which I can achieve it.

> Regards
> George S
Re: How to do away with hard coding of view [message #448786 is a reply to message #448774] Tue, 02 May 2006 08:45 Go to previous messageGo to next message
Eclipse UserFriend
George S wrote:
> Hi all,
>
> I have created an RCP application with a perspective associated with it.
> In addition to that I have created some where around 3 to 4 views.Now I
> need to place these views in the perspective.I have done with this using
> perspective extension.
>
> Here I am facing a problem, in order to make use of the perspective
> extension I should have one view added programatically (as of my
> knowledge).But I dont want to put the view id into code.


I'm not sure what you are doing ...

You have some views, and you have a perspectiveExtension extension to
add them to a perspective. OK, that's good.

The problem is you want to do the equivalent of
folder.addPlaceholder(View.ID + ":*"); with one of your 4 views? So you
can have it placed when your user does a Show View later?

This case can't be done with the perspectiveExtension. You would have
to create a complete perspective yourself.

> But I dont want to put the view id into code.

Huh? Any time you want to request a specific view, you MUST use the
view id. Code, extensions, it's all the same.


Later,
PW
Re: How to do away with hard coding of view [message #448889 is a reply to message #448774] Sat, 06 May 2006 02:21 Go to previous message
Eclipse UserFriend
hi

As par my knowledge it is not possible to add view to the perspective by the extension point.

sticky view is somethink different. it is used to have a common view in the number of perspectives
Previous Topic:hi
Next Topic:Actions and SWT Buttons
Goto Forum:
  


Current Time: Sun Aug 31 04:31:18 EDT 2025

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

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

Back to the top