Quantcast

Is it possible to read / edit standard project properties?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is it possible to read / edit standard project properties?

sbobrov85
Hello.

I am newbie to programming plugins for netbeans and I can not solve one problem. Is it possible to read / edit standard project properties like remote connection or etc (Project -> Properties)?

I tried to use:

* ProjectUtils.getPreferences
* NbProperties

But all this works only for modules...

I want to change what's in the file nbproject/private/private.properties

Help me, please.




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to read / edit standard project properties?

Oliver Rettig
Hallo,

if you have the "Project"  you can locate the private.properties file and you
can access the file with plain java. This what I do in these cases. I think
there is no specific api to access this file. The problem is that if you want to
resolve templates/variables you have to do it on your own. Some years ago i
have tried to access programmatically project files via ant but it looks to
complex. If you find a better solution I am interested in.

best regards
Oliver

> Hello.
>
> I am newbie to programming plugins for netbeans and I can not solve one
> problem. Is it possible to read / edit standard project properties like
> remote connection or etc (Project -> Properties)?
>
> I tried to use:
>
> * ProjectUtils.getPreferences
> * NbProperties
>
> But all this works only for modules...
>
> I want to change what's in the file nbproject/private/private.properties
>
> Help me, please.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to read / edit standard project properties?

Geertjan Wielenga-3

Maybe this helps:
https://blogs.oracle.com/geertjan/entry/setting_netbeans_properties_programatically

Gj


On 16-4-2017 9:39, Oliver Rettig wrote:

> Hallo,
>
> if you have the "Project"  you can locate the private.properties file and you
> can access the file with plain java. This what I do in these cases. I think
> there is no specific api to access this file. The problem is that if you want to
> resolve templates/variables you have to do it on your own. Some years ago i
> have tried to access programmatically project files via ant but it looks to
> complex. If you find a better solution I am interested in.
>
> best regards
> Oliver
>
>> Hello.
>>
>> I am newbie to programming plugins for netbeans and I can not solve one
>> problem. Is it possible to read / edit standard project properties like
>> remote connection or etc (Project -> Properties)?
>>
>> I tried to use:
>>
>> * ProjectUtils.getPreferences
>> * NbProperties
>>
>> But all this works only for modules...
>>
>> I want to change what's in the file nbproject/private/private.properties
>>
>> Help me, please.
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to read / edit standard project properties?

Oliver Rettig
Hi Geertjan,

thats really great. The only thing I do not understand is the comment about

ProjectManager.mutex().writeAccess(...)

that should be used for writing.

Can you help?

best regards
Oliver

> Maybe this helps:
> https://blogs.oracle.com/geertjan/entry/setting_netbeans_properties_programa
> tically
>
> Gj
>
> On 16-4-2017 9:39, Oliver Rettig wrote:
> > Hallo,
> >
> > if you have the "Project"  you can locate the private.properties file and
> > you can access the file with plain java. This what I do in these cases. I
> > think there is no specific api to access this file. The problem is that
> > if you want to resolve templates/variables you have to do it on your own.
> > Some years ago i have tried to access programmatically project files via
> > ant but it looks to complex. If you find a better solution I am
> > interested in.
> >
> > best regards
> > Oliver
> >
> >> Hello.
> >>
> >> I am newbie to programming plugins for netbeans and I can not solve one
> >> problem. Is it possible to read / edit standard project properties like
> >> remote connection or etc (Project -> Properties)?
> >>
> >> I tried to use:
> >>
> >> * ProjectUtils.getPreferences
> >> * NbProperties
> >>
> >> But all this works only for modules...
> >>
> >> I want to change what's in the file nbproject/private/private.properties
> >>
> >> Help me, please.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is it possible to read / edit standard project properties?

sbobrov85
In reply to this post by sbobrov85
Many thanks to geertjan for his help.

This is what I need, with small corrections.
Private properties are perfectly modified in this way.


geertjan wrote:

> Maybe this helps:
> https://blogs.oracle.com/geertjan/entry/setting_netbeans_properties_programatically
>
> Gj
>
>
> On 16-4-2017 9:39, Oliver Rettig wrote:
>
> > Hallo,
> >
> > if you have the "Project"  you can locate the private.properties file and you
> > can access the file with plain java. This what I do in these cases. I think
> > there is no specific api to access this file. The problem is that if you want to
> > resolve templates/variables you have to do it on your own. Some years ago i
> > have tried to access programmatically project files via ant but it looks to
> > complex. If you find a better solution I am interested in.
> >
> > best regards
> > Oliver
> >
> >
> > > Hello.
> > >
> > > I am newbie to programming plugins for netbeans and I can not solve one
> > > problem. Is it possible to read / edit standard project properties like
> > > remote connection or etc (Project -> Properties)?
> > >
> > > I tried to use:
> > >
> > > * ProjectUtils.getPreferences
> > > * NbProperties
> > >
> > > But all this works only for modules...
> > >
> > > I want to change what's in the file nbproject/private/private.properties
> > >
> > > Help me, please.
> > >
> >
>





Loading...