Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to Disable close option in a view
How to Disable close option in a view [message #716342] Wed, 17 August 2011 06:05 Go to next message
raghav Missing name is currently offline raghav Missing name
Messages: 18
Registered: May 2011
Junior Member

Hello All,

I created 2 views and in the view1 there is a button b1 and upon button click view1 gets hidden and view2 opens but it shows the close option to the user. I want this close option to be disabled

below is my code snippet
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();

IViewReference viewToClose = activePage.findViewReference(viewIdToClose);
activePage.hideView(viewToClose);
try {
activePage.showView(viewIdToOpen);
} catch (PartInitException e) {
e.printStackTrace();
}

how can i disable the close option in view2

Thanks in advance
Re: How to Disable close option in a view [message #717544 is a reply to message #716342] Sun, 21 August 2011 07:57 Go to previous message
John Steele is currently offline John Steele
Messages: 33
Registered: June 2010
Location: Seattle, WA
Member
It depends on how you add the view to the perspective.

If you add the view programmatically in the perspective factory then you have to specify the view as being either closeable or not:

IFolderLayout topLeft = layout.createFolder("distributed.grep.client.topLeft", IPageLayout.LEFT, 0.25f, editor);
topLeft.addView("distributed.grep.client.topLeft");
layout.getViewLayout("distributed.grep.client.topLeft").setCloseable(true);


If you add the view to the perspective using extensions in the plugin.xml then you specify the closeable attribute.

If the perspective is set to being fixed, then by default the view will be closeable.
Previous Topic:RCP + spring
Next Topic:Can't get rootfiles specification to work in plug-in based product
Goto Forum:
  


Current Time: Sat Oct 25 20:48:22 GMT 2014

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

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