You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Roger Whitcomb (Created) (JIRA)" <ji...@apache.org> on 2011/11/04 20:53:51 UTC

[jira] [Created] (PIVOT-816) Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically

Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically
-----------------------------------------------------------------------------------------------

                 Key: PIVOT-816
                 URL: https://issues.apache.org/jira/browse/PIVOT-816
             Project: Pivot
          Issue Type: Improvement
          Components: wtk
    Affects Versions: 2.0.1
         Environment: Windows XP SP3, JDK 1.6.0_16
            Reporter: Roger Whitcomb
            Assignee: Roger Whitcomb
            Priority: Trivial
             Fix For: 2.0.1


There is already a "setSelectedIndex", "getSelectedIndex" and "getSelectedTab" methods.  It would be nice and orthogonal to have a "setSelectedTab" method also.

My use case is this:  I have TabPane components identified by bxml:id in my main layout file, and references to these components in the .java code.  So, rather than relying on indexes to programmatically select a tab (which might change if I reorder the tabs), if I could just use the tab component itself (since I have a reference to it) to make the selection, then it would be more reliable.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIVOT-816) Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically

Posted by "Sandro Martini (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144382#comment-13144382 ] 

Sandro Martini commented on PIVOT-816:
--------------------------------------

Hi Roger,
to me the patch seems Ok, go with the commit ... a minimal test application could be useful but I think that in this case we can live even without it :-) .

                
> Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically
> -----------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-816
>                 URL: https://issues.apache.org/jira/browse/PIVOT-816
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JDK 1.6.0_16
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Trivial
>              Labels: TabPane
>             Fix For: 2.0.1
>
>         Attachments: tab.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> There is already a "setSelectedIndex", "getSelectedIndex" and "getSelectedTab" methods.  It would be nice and orthogonal to have a "setSelectedTab" method also.
> My use case is this:  I have TabPane components identified by bxml:id in my main layout file, and references to these components in the .java code.  So, rather than relying on indexes to programmatically select a tab (which might change if I reorder the tabs), if I could just use the tab component itself (since I have a reference to it) to make the selection, then it would be more reliable.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIVOT-816) Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically

Posted by "Roger Whitcomb (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb updated PIVOT-816:
---------------------------------

    Attachment: tab.patch

The "tab.patch" implements this functionality.

I have tested it with our application and it works just as I had hoped.

If the "component" is null, the selected index goes back to -1, and if the component isn't a child of the TabPane an exception is thrown.  This is consistent with "getSelectedTab".
                
> Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically
> -----------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-816
>                 URL: https://issues.apache.org/jira/browse/PIVOT-816
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JDK 1.6.0_16
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Trivial
>              Labels: TabPane
>             Fix For: 2.0.1
>
>         Attachments: tab.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> There is already a "setSelectedIndex", "getSelectedIndex" and "getSelectedTab" methods.  It would be nice and orthogonal to have a "setSelectedTab" method also.
> My use case is this:  I have TabPane components identified by bxml:id in my main layout file, and references to these components in the .java code.  So, rather than relying on indexes to programmatically select a tab (which might change if I reorder the tabs), if I could just use the tab component itself (since I have a reference to it) to make the selection, then it would be more reliable.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIVOT-816) Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically

Posted by "Roger Whitcomb (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Whitcomb resolved PIVOT-816.
----------------------------------

    Resolution: Fixed

Sending        wtk\src\org\apache\pivot\wtk\TabPane.java
Transmitting file data .
Committed revision 1197807.
                
> Add "setSelectedTab(Component)" method to TabPane to facilitate selecting tabs programmatically
> -----------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-816
>                 URL: https://issues.apache.org/jira/browse/PIVOT-816
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3, JDK 1.6.0_16
>            Reporter: Roger Whitcomb
>            Assignee: Roger Whitcomb
>            Priority: Trivial
>              Labels: TabPane
>             Fix For: 2.0.1
>
>         Attachments: tab.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> There is already a "setSelectedIndex", "getSelectedIndex" and "getSelectedTab" methods.  It would be nice and orthogonal to have a "setSelectedTab" method also.
> My use case is this:  I have TabPane components identified by bxml:id in my main layout file, and references to these components in the .java code.  So, rather than relying on indexes to programmatically select a tab (which might change if I reorder the tabs), if I could just use the tab component itself (since I have a reference to it) to make the selection, then it would be more reliable.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira