NetBeans Forums

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

Project settings - saving/restoring

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



Joined: 08 Jan 2010
Posts: 17

PostPosted: Thu Oct 11, 2012 6:00 pm    Post subject: Project settings - saving/restoring Reply with quote

Hello everyone!

As a NB dev beginner please give me advice what is a best solution for storing customized project properties.

Background:
I'm developing a NB application which uses project approach. Each project should have it's own properties (eg. database connectivity information). I've implemented in a few modules the ProjectCustomizer.CompositeCategoryProvider as a frontend (gui) for the preferences. I've defined ActionListener which captures OK button for each module.

Question:
What is a best solution to store/read these settings for each project (the settings should be stored somewhere in the project directory). Does NB provide such helper methods or should I stick with standard .preferences FileObject and handle it manually for each module ?
Back to top
markiewb



Joined: 29 Aug 2012
Posts: 531

PostPosted: Thu Oct 11, 2012 10:05 pm    Post subject: [platform-dev] Re: Project settings - saving/restoring Reply with quote

Did you try NBPreference yet? Have a look at address-removed ([email]address-removed[/email])>:
Quote:
Hello everyone!

Back to top
slawek.mikula



Joined: 08 Jan 2010
Posts: 17

PostPosted: Fri Oct 12, 2012 6:00 am    Post subject: Re: [platform-dev] Re: Project settings - saving/restoring Reply with quote

markiewb wrote:
Did you try NBPreference yet? Have a look at address-removed ([email]address-removed[/email])>


First of all the link(?) was removed in the post. I was looking at the NbPreferences before but I thought that the NbPreferences as in (http://bits.netbeans.org/dev/javadoc/org-openide-util/index.html?org/openide/util/NbPreferences.html) are system (all users) or user specific. The configuration will be placed in the ~/.netbeans directory not in the project directory. If I am wrong could someone give me a little hint how to use NbPreferences on the project level ?
Back to top
Marini, Joseph - 1004 - M
Posted via mailing list.





PostPosted: Fri Oct 12, 2012 11:23 am    Post subject: [platform-dev] Re: Project settings - saving/restoring Reply with quote

You could create a netbeans options panel or view which uses netbeans preferences.

/Joe

-----Original Message-----
From: slawek.mikula [mailto:address-removed]
Sent: Thursday, October 11, 2012 2:00 PM
To: address-removed
Subject: [platform-dev] Project settings - saving/restoring

Hello everyone!

As a NB dev beginner please give me advice what is a best solution for storing customized project properties.

Background:
I'm developing a NB application which uses project approach. Each project should have it's own properties (eg. database connectivity information). I've implemented in a few modules the ProjectCustomizer.CompositeCategoryProvider as a frontend (gui) for the preferences. I've defined ActionListener which captures OK button for each module.

Question:
What is a best solution to store/read these settings for each project (the settings should be stored somewhere in the project directory). Does NB provide such helper methods or should I stick with standard .preferences FileObject and handle it manually for each module ?
Back to top
slawek.mikula



Joined: 08 Jan 2010
Posts: 17

PostPosted: Mon Oct 15, 2012 9:40 pm    Post subject: Re: Project settings - saving/restoring Reply with quote

slawek.mikula wrote:
Hello everyone!

Question:
What is a best solution to store/read these settings for each project (the settings should be stored somewhere in the project directory). Does NB provide such helper methods or should I stick with standard .preferences FileObject and handle it manually for each module ?


For explanation i've chosen the method explained in the http://comments.gmane.org/gmane.comp.java.netbeans.modules.openide.devel/47529 thread. Simply using FileObject and Properties object.

Another approach was using Auxillary Configuration http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/AuxiliaryConfiguration.html or getPreferences from the same ProjectUtils package. But this configuration was stored in NB userdir, which i wanted to avoid (whole project configuration in one transferrable place).

NbPreferences is (I think) for other cases (user configuration for NB application globally not per project)
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 cannot 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