Skip to main content



      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 02:05 Go to next message
Eclipse UserFriend
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 03:57 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 23:38:16 EDT 2025

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

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

Back to the top