Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » how to open a new view and close existing view
how to open a new view and close existing view [message #670909] Mon, 16 May 2011 03:24 Go to next message
Eclipse UserFriend
hello im new to eclipse rcp

problem:
i added a button click event and i wish to open a new view and close the current view

i could do the second one closing the current view but unable to do the first

Regards,
Raghav
Re: how to open a new view and close existing view [message #670955 is a reply to message #670909] Mon, 16 May 2011 07:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi, the code you need is:
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
		
String viewIdToClose = OneView.ID;
IViewReference viewToClose = activePage.findViewReference(viewIdToClose);
activePage.hideView(viewToClose);
		
try {
	String viewIdToOpen = OtherView.ID;
	activePage.showView(viewIdToOpen);
} catch (PartInitException e) {
	e.printStackTrace();
}
Re: how to open a new view and close existing view [message #671187 is a reply to message #670955] Tue, 17 May 2011 00:32 Go to previous messageGo to next message
Eclipse UserFriend
thanks pavlov

its working fine
Re: how to open a new view and close existing view [message #674538 is a reply to message #671187] Fri, 27 May 2011 05:41 Go to previous message
Eclipse UserFriend
Hi there,
I am facing a similar problem like above. The code delivered in this thread works quite fine, but does not cover my problem completely.

I need to open two views when the top one (like a welcome page similar to the eclipse welcome page) closes. One of the views is supposed to open on the left side holding a picklist and the second view will manage the content of the item to be picked. As a standalone without the welcome page this works fine.

Right now, I am able to open both views (picklist and content) from the welcome view, but they appear just as two tabs on top of each other, which cuts the usability extremly down.

As a newby to Eclipse RCP I am running out of ideas. I tried a little bit to work with placeholders, but did not come to a sattisfying solution.

Any idea is more than welcome.

Thanks for your time
TG

[Updated on: Fri, 27 May 2011 05:42] by Moderator

Previous Topic:Help! How to change 'Loading Workbench' in splash screen?
Next Topic:How to add a progress bar as a component in a view
Goto Forum:
  


Current Time: Wed Jul 23 12:23:30 EDT 2025

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

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

Back to the top