Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Simple Question: Making a button open a tab
Simple Question: Making a button open a tab [message #671436] Tue, 17 May 2011 18:07 Go to next message
Eclipse UserFriend
Hi,

I am creating a simple RCP application that lets a user open multiple tabs using a button. I have two views: view1 and view2. The user starts out in view1. I have defined both views (both as views and view extensions so that tabs are possible) and both of them are visible when the user starts the program.

I want the user to initially start out by seeing only view1. When they press the button in view1 I want to create an instance of view2 as a tab and have it open.
I've created my button and added a listener but I don't know how to reference view2 (I know I have to use its id somehow) or how to create an instance of it and add it to my tab stack.

If anyone could point me towards some documentation or examples that tell me which classes to edit (ActionAdvisor, WindowAdvisor etc...) and how I reference view2 in my button I would appreciate it.

Thank you.
Re: Simple Question: Making a button open a tab [message #671626 is a reply to message #671436] Wed, 18 May 2011 10:17 Go to previous message
Eclipse UserFriend
When you create your perspective, make sure you add view1 and add a placeholder for view2. Then when they click your action in view1, use getSite() and org.eclipse.ui.IWorkbenchPage.showView(String) to show your second view.

PW
Previous Topic:Context Menu on my TreeViewer
Next Topic:[Done] How To double click editor tab to maximize it
Goto Forum:
  


Current Time: Fri Aug 29 15:51:16 EDT 2025

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

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

Back to the top