NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
slawek.mikula
Joined: 08 Jan 2010 Posts: 10
|
Posted: Thu Oct 11, 2012 6:00 pm Post subject: 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 |
|
 |
markiewb
Joined: 29 Aug 2012 Posts: 264
|
Posted: Thu Oct 11, 2012 10:05 pm Post subject: [platform-dev] Re: Project settings - saving/restoring |
|
|
| Did you try NBPreference yet? Have a look at address-removed ([email]address-removed[/email])>: |
| Back to top |
|
 |
slawek.mikula
Joined: 08 Jan 2010 Posts: 10
|
Posted: Fri Oct 12, 2012 6:00 am Post subject: Re: [platform-dev] Re: Project settings - saving/restoring |
|
|
| 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.
|
Posted: Fri Oct 12, 2012 11:23 am Post subject: [platform-dev] Re: Project settings - saving/restoring |
|
|
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: 10
|
Posted: Mon Oct 15, 2012 9:40 pm Post subject: Re: Project settings - saving/restoring |
|
|
| 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 |
|
 |
|
|
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
|
|
|