Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Open View from a Dialog possible
Open View from a Dialog possible [message #755827] Wed, 09 November 2011 17:28 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Hi,

I am not sure which forum to post this question but I try here since it is more general.

I have a Dialog and when I press a Button in my dialog I want to open a view in my workbench (similar to "console") and present a bunch of data (table).Then I want to select the data and update a comboViewer in my Dialog. Is it possible.

When I tried the following code in my Dialog:
try {
		BranchSearchView view = (BranchSearchView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
						.getActivePage().showView("net.sourceforge.eclipseccase.views.BranchSearchView");
		
		    view.setProject(resources[0].getProject());
		
		} catch (Exception e) {
			e.printStackTrace();
}


When I execute the class I get a message saying something like "that workbench is not created yet".

Is it possible to test this or do I need a running eclipse instance ( with a actual workbench existing)?

If it works how can I take the data from the selected row and add it to my comboviewer? Is it possible at all?

br,

//mike


Re: Open View from a Dialog possible [message #757848 is a reply to message #755827] Mon, 21 November 2011 06:12 Go to previous message
Leung Wang Hei is currently offline Leung Wang HeiFriend
Messages: 62
Registered: July 2010
Member
Calling from a non-UI thread?

On 11/10/2011 1:28 AM, Mikael Petterson wrote:
> Hi,
>
> I am not sure which forum to post this question but I try here since it
> is more general.
>
> I have a Dialog and when I press a Button in my dialog I want to open a
> view in my workbench (similar to "console") and present a bunch of data
> (table).Then I want to select the data and update a comboViewer in my
> Dialog. Is it possible.
>
> When I tried the following code in my Dialog:
> try {
> BranchSearchView view = (BranchSearchView)
> PlatformUI.getWorkbench().getActiveWorkbenchWindow()
> .getActivePage().showView("net.sourceforge.eclipseccase.views.BranchSearchView");
>
>
> view.setProject(resources[0].getProject());
>
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> When I execute the class I get a message saying something like "that
> workbench is not created yet".
>
> Is it possible to test this or do I need a running eclipse instance (
> with a actual workbench existing)?
>
> If it works how can I take the data from the selected row and add it to
> my comboviewer? Is it possible at all?
>
> br,
>
> //mike
>
>
>
Previous Topic:RCP over not 100% reliable network (Config.ini, class loading)
Next Topic:Common Navigator Framework - needs samples
Goto Forum:
  


Current Time: Sat Nov 29 02:38:32 GMT 2014

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

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