NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Get an array of opened Tabs

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Developers
View previous topic :: View next topic  
Author Message
Wiliam



Joined: 04 Jan 2011
Posts: 2

PostPosted: Tue Jan 04, 2011 10:54 am    Post subject: Get an array of opened Tabs Reply with quote

Hi, it's my first time in this forum.

I wanna ask about getting an array of the opened tabs in the main Netbeans editor. The tabs of the files I'm editing mainly.

I wanna use this data to open a popup and let me select easily witch tab I wanna focus. So the second question is:

Can I popup a Window component?

Thank you,
Wiliam.

(I searched for an hour and I didn't found nothing)
Back to top
Ernie Rael
Posted via mailing list.





PostPosted: Wed Jan 05, 2011 3:35 am    Post subject: Re: Get an array of opened Tabs Reply with quote

This question is appropriate for the address-removed list.
This list is for development issues of the platform itself.

Regarding your question there's EditorRegistry and NbEditorUtilities
which together could provide the info you need. With maybe a touch of
TopComponent.Registry.

And did you vist http://netbeans.org/features/platform/index.html ?
There are some excellent tutorials.

-ernie

On 1/4/2011 2:54 AM, Wiliam wrote:
Quote:
Hi, it's my first time in this forum.

I wanna ask about getting an array of the opened tabs in the main Netbeans editor. The tabs of the files I'm editing mainly.

I wanna use this data to open a popup and let me select easily with tab I wanna focus. So the second question is:

Can I popup a Window component?

Thank you,
Wiliam.

(I searched for an hour and I didn't found nothing)





Back to top
Wiliam



Joined: 04 Jan 2011
Posts: 2

PostPosted: Wed Jan 05, 2011 3:30 pm    Post subject: Reply with quote

Uhm, I don't know what is this platform. It's for doing standalone ide's and apps?

About my questions I made it yesterday.

For Tabs:

Code:
public static List GetTabs()
    {
        Set<TopComponent> opened = TopComponent.getRegistry().getOpened();
        List tabs = new ArrayList();
       
        for (TopComponent topComponent : opened) {
            if(topComponent instanceof CloneableEditor) {
                tabs.add((CloneableEditor)topComponent);
            }
        }
       
        return tabs;
    }


For the popup I created a dialog and putted the TopComponent Window inside.

I'm new in java, sorry if something looks weird.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Developers All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo