Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Hiding and restoring a view in RCP
Hiding and restoring a view in RCP [message #1005350] Thu, 24 January 2013 20:36 Go to previous message
Prasanth Jonna Vamsi is currently offline Prasanth Jonna Vamsi
Messages: 8
Registered: January 2013
Junior Member
I have 4 views in my perspective. I need to hide a view and restore it on.

But what i inferred is eclipse is closing the view on the call of hideView() and showView is creating a new view. But i need to just hide and show the view as it works for "View - > Console / View -> error log " in eclipse.

My sample code

IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
String viewIdToToggle = HBinningView.ID;
IViewReference viewToToggle = activePage.findViewReference(viewIdToToggle);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!isChecked()) {

activePage.hideView(viewToToggle);


} else {
try {
activePage.showView(viewIdToToggle);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Enable/disable command handlers depending on command parameter
Next Topic:Cheatsheet: async action problem
Goto Forum:
  


Current Time: Wed May 22 18:49:02 EDT 2013

Powered by FUDForum. Page generated in 0.04435 seconds