Bug 119085 - [TabbedProperties] need getters and setters for the current Tab
Summary: [TabbedProperties] need getters and setters for the current Tab
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 enhancement with 6 votes (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 237463 279421 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-02 14:28 EST by Rodrigo Peretti CLA
Modified: 2009-06-10 01:58 EDT (History)
10 users (show)

See Also:


Attachments
Patch for getters and setters for the current Tab (4.54 KB, patch)
2008-11-19 10:42 EST, Anthony Hunter CLA
no flags Details | Diff
Junits for the tab support (32.86 KB, patch)
2008-11-19 10:43 EST, Anthony Hunter CLA
no flags Details | Diff
Patch for getters and setters for the current Tab (4.54 KB, patch)
2008-11-25 16:31 EST, Anthony Hunter CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Peretti CLA 2005-12-02 14:28:49 EST
We have some use cases where we need to remember the current active Tab and Section and later in the lifecycle we need to select those again. Currently there is no API for this functionality.
Comment 1 Chuck Bridgham CLA 2005-12-02 14:38:40 EST
Do these belong to you? Forward as necessary.

Thanks,
Comment 2 Valentin Baciu CLA 2006-11-15 13:21:35 EST
We (WTP graphical WSDL, XSD editors) also have a few use cases which could benefit from having these APIs for setting the current tab/section.
Comment 3 Anthony Hunter CLA 2007-07-19 10:43:33 EDT
In plan for Eclipse 3.4
Comment 4 Mike Wilson CLA 2008-05-13 12:55:13 EDT
(In reply to comment #3)
> In plan for Eclipse 3.4
> 
But did they make it into the implementation for 3.4?


Comment 5 Anthony Hunter CLA 2008-05-13 13:44:42 EDT
This feature was on an IBM internal list for 3.4. No further follow up occurred since July 2007. 

Moving to 3.5 as the JUnit tests in the properties view could make use of these API.
Comment 6 Anthony Hunter CLA 2008-06-18 16:50:18 EDT
*** Bug 237463 has been marked as a duplicate of this bug. ***
Comment 7 John Arthorne CLA 2008-10-29 15:33:59 EDT
Removing plan keyword for bugs that are not linked to the 3.5 (Galileo) plan.
Comment 8 Anthony Hunter CLA 2008-10-30 09:05:39 EDT
This enhancement is targeted for the 3.5 release, but is not in the rolled up plan for the platform for 3.5 (plan keyword has been removed).

I am guessing that there are too many enhancements from the 17 or so platform components, so the list is cleaned a little to list only major enhancements.
Comment 9 Anthony Hunter CLA 2008-11-19 10:42:49 EST
Created attachment 118272 [details]
Patch for getters and setters for the current Tab

Here is the patch for the proposed changes for Tab support in TabbedPropertySheetPage

public ITabDescriptor getSelectedTab() - Returns the currently selected tab.
public ITabDescriptor[] getActiveTabs() - Returns the list of currently active tabs.
public void setSelectedTab(String id) - Set the currently selected tab to be that of the provided tab id.
The ID matches the Tab ID in the TabDescriptor extension point as we all the ITabDescriptor.getId() returned from the getters.

Please confirm this is sufficient.
Comment 10 Anthony Hunter CLA 2008-11-19 10:43:58 EST
Created attachment 118274 [details]
Junits for the tab support

Updated the JUnits to take advantage of the new API. Was able to remove the need to access internals in the JUnits.
Comment 11 Anthony Hunter CLA 2008-11-19 10:47:19 EST
Can someone let me know how setting the active section is going to work?
What is the expectation here and why would we use it?
Comment 12 Keith Chong CLA 2008-11-21 18:26:28 EST
Hi Anthony,

The setSelectedTab method will be helpful.  One of our use cases involves providing a context menu action, (or any action/command in the editor) that selects the specific tab showing the relevant properties for the currently selected element.   This will provide direct access to this content.  ie. instead of "Show Properties", it will be "Show XYZ Properties".

I tested out your patch, and there's a minor change required:

if (tabDescriptor.getId() != null &&
    tabDescriptor.getId().equals(id)) {

My action works just fine after this.
Comment 13 Anthony Hunter CLA 2008-11-24 14:11:08 EST
(In reply to comment #12)
> 
> if (tabDescriptor.getId() != null &&
>     tabDescriptor.getId().equals(id)) {
> 
Ouch, good catch.

My JUnit tests used setSelectedTab(tabDescriptors[4].getId()) and I did not catch that in my tests tab id == tab name. I will fix and fix the tests as well.
Comment 14 Anthony Hunter CLA 2008-11-25 16:29:08 EST
(In reply to comment #13)
> 
> My JUnit tests used setSelectedTab(tabDescriptors[4].getId()) and I did not
> catch that in my tests tab id == tab name. I will fix and fix the tests as
> well.
> 

This issue is fixed by Bug 256485 .
Comment 15 Anthony Hunter CLA 2008-11-25 16:31:32 EST
Created attachment 118702 [details]
Patch for getters and setters for the current Tab

Fixed patch for the issue found by Keith.

Keith, can you give another test and I will commit the fix for tabs?

Still waiting feedback for sections.
Comment 16 Anthony Hunter CLA 2008-11-26 10:54:49 EST
Committed patch for getters and setters for the current Tab to HEAD, as well as the JUnit tests.
Comment 17 Keith Chong CLA 2008-11-27 18:37:02 EST
Anthony, I've retested my action to select the tab and it's fine.  Note, I've only tested setSelectedTab.  Thanks for providing this feature.
Comment 18 Anthony Hunter CLA 2008-12-03 13:39:34 EST
(In reply to comment #15)
> 
> Still waiting feedback for sections.
> 

I have yet to get feedback on how remembering an active section is helpful or navigating to an active section is going to work.

So

Changing the name of this enhancement to "need getters and setters for the current Tab" and Resolving as fixed in 3.5 M4.

If anyone wants getters and setters for sections I would request we create a new Bugzilla.
Comment 19 Daniel Stein CLA 2009-06-10 01:58:31 EDT
*** Bug 279421 has been marked as a duplicate of this bug. ***