Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » createPartControl
createPartControl [message #467018] Mon, 23 January 2006 01:25 Go to next message
Eclipse UserFriend
Originally posted by: mohansl.gmail.com

Hi,
I wish to call a view as follows(basically to set view content and open
it in performFinish of wizard) :

IWorkbenchWindow wdc =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = wdc.getActivePage();

MyView myview = new MyView(viewContent);
myview.createPartControl(parent);
IViewPart part =(IViewPart) myview.getViewSite() ;
page.activate(part) ;

However how do I set the 'parent' in myview.createPartControl(parent)?

Regards,
mohansl
Re: createPartControl [message #467020 is a reply to message #467018] Mon, 23 January 2006 04:08 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
declare views extension point and open view
with page#showView
eclipes will create view for you
mohansl wrote:

>
> Hi,
> I wish to call a view as follows(basically to set view content and open
> it in performFinish of wizard) :
>
> IWorkbenchWindow wdc =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> IWorkbenchPage page = wdc.getActivePage();
>
> MyView myview = new MyView(viewContent);
> myview.createPartControl(parent);
> IViewPart part =(IViewPart) myview.getViewSite() ;
> page.activate(part) ;
>
> However how do I set the 'parent' in myview.createPartControl(parent)?
>
> Regards,
> mohansl
Re: createPartControl [message #467022 is a reply to message #467020] Mon, 23 January 2006 03:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mohansl.gmail.com

Hi,
I could do that, however I wish to set the view content from the wizard
via the view constructor and then show the view, So how do I go about
doing it?

Regards,
mohansl
Re: createPartControl [message #467026 is a reply to message #467018] Mon, 23 January 2006 15:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

mohansl wrote:
>
> Hi,
> I wish to call a view as follows(basically to set view content and
> open it in performFinish of wizard) :
>
> IWorkbenchWindow wdc =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> IWorkbenchPage page = wdc.getActivePage();
>
> MyView myview = new MyView(viewContent);
> myview.createPartControl(parent);
> IViewPart part =(IViewPart) myview.getViewSite() ;
> page.activate(part) ;
>
> However how do I set the 'parent' in myview.createPartControl(parent)?

The short answer is you can't. Views don't work that way.

Your best bet is to have your view start up with a blank screen or
message (like the Content Outline view) and respond to another message
that causes it to update it's contents. ex:

IViewPart part = page.showView("id");
// the view now updates its composites
part.setViewContents(viewContent);
page.activate(part); // probably not necessary


The other (less good :-) option would be to have your performFinish()
put something in a singleton somewhere, and have your view always check
for information in it's IViewPart#init(*) method when it starts up.

Later,
PW


Re: createPartControl [message #467034 is a reply to message #467022] Mon, 23 January 2006 15:51 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You should ask this question in the eclipse.platform newsgroup:

news://news.eclipse.org/eclipse.platform

"mohansl" <mohansl@gmail.com> wrote in message
news:adb8cb97e28c979b35c1d362e4f5ea99$1@www.eclipse.org...
>
> Hi,
> I could do that, however I wish to set the view content from the wizard
> via the view constructor and then show the view, So how do I go about
> doing it?
>
> Regards,
> mohansl
>
Re: createPartControl [message #467041 is a reply to message #467026] Mon, 23 January 2006 17:25 Go to previous message
Eclipse UserFriend
Originally posted by: mohansl.gmail.com

Hi,
Thanks, I got it working on lines of your snippet.

Thanks and Regards,
mohansl
Previous Topic:How to add a new Node the Tree Viewer available in Plugin from its Fragment
Next Topic:sizing Text
Goto Forum:
  


Current Time: Fri Apr 19 19:51:35 GMT 2024

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

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

Back to the top