NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Wiliam
Joined: 04 Jan 2011 Posts: 2
|
Posted: Tue Jan 04, 2011 10:54 am Post subject: Get an array of opened Tabs |
|
|
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.
|
Posted: Wed Jan 05, 2011 3:35 am Post subject: Re: Get an array of opened Tabs |
|
|
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
|
Posted: Wed Jan 05, 2011 3:30 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|