NetBeans Forums

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

How to get the dataobject of file that is opened using "Open file" in netbeans

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
remya



Joined: 24 Sep 2012
Posts: 13

PostPosted: Fri Dec 07, 2012 5:03 am    Post subject: How to get the dataobject of file that is opened using "Open file" in netbeans Reply with quote

Hi,

I opened a file in netebeans platform using "Open file" under file menu.
I need to get the dataobject of the opened file.
Is there any listener that listenes to opening a file.

Please help.
Back to top
Monezz



Joined: 18 Feb 2009
Posts: 254

PostPosted: Fri Dec 07, 2012 9:36 pm    Post subject: [platform-dev] Re: How to get the dataobject of file that is opened using "Open file" in netbeans Reply with quote

Quote:
I opened a file in netebeans platform using "Open file" under file menu.
I need to get the dataobject of the opened file.
Is there any listener that listenes to opening a file.

You could probably use the
Back to top
markiewb



Joined: 29 Aug 2012
Posts: 271

PostPosted: Fri Dec 07, 2012 9:46 pm    Post subject: [platform-dev] Re: How to get the dataobject of file that is opened using "Open file" in netbeans Reply with quote

When you have a file or fileobject then you can get the dataobject the following way: [url=http://bits.netbeans.org/dev/javadoc/org-openide-loaders/org/openide/loaders/DataObject.html#find(org.openide.filesystems.FileObject)]http://bits.netbeans.org/dev/javadoc/org-openide-loaders/org/openide/loaders/DataObject.html#find(org.openide.filesystems.FileObject)[/url]
Greetings markiewb Am 07.12.2012 21:59 schrieb "remya" <address-removed ([email]address-removed[/email])>:
Quote:
Hi,

I opened a file in netebeans platform using "Open file" under file menu.
I need to get the dataobject of the opened file.
Is there any listener that listenes to opening a file.

Please help.




Back to top
remya



Joined: 24 Sep 2012
Posts: 13

PostPosted: Mon Dec 10, 2012 5:35 am    Post subject: How to get the file opened in netbeans platform using "open file" under file menu. Reply with quote

Thanks for the reply.
I think I didnt clearly mention the requirement.
When I open a file in netbeans platform, I want to get the file that I opened using the JFilechooser provided by the netbeans platform.
The purpose of this is to maintain an arraylist for all the files that is opened using netbeans platform's "Open File" under File Menu.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users 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