You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Patrik Karlström <pa...@trixon.se> on 2025/09/13 04:44:34 UTC

[platform] Communicate with an nbp application

Does the platform have some kind of support for communicating with the
application from the outside by files in the userdir or similar?

/Patrik

Re: [platform] Communicate with an nbp application

Posted by Laszlo Kishalmi <la...@gmail.com>.
Well, I use Options > Editor > Autosave > Save files when focus is lost

for similar purpose.

On 9/14/25 01:09, Patrik Karlström wrote:
> Thanks Laszlo, it works perfectly!
> With this simple plugin I'm now able to save all files in the IDE 
> first thing in my external build script.
> So no more waiting for a build to fail (due to unsaved files at least...)
>
> public class Handler implements ArgsProcessor {
>
>     @Arg(longName = "save-all")
>     @Description(
>             shortDescription = "Save all files"
>     )
>     public boolean mSaveAllOption;
>
>     public Handler() {
>     }
>
>     @Override
>     public void process(Env env) throws CommandException {
>         if (mSaveAllOption) {
>             LifecycleManager.getDefault().saveAll();
>         }
>     }
>
> }
>
>
> Den lör 13 sep. 2025 kl 18:50 skrev Laszlo Kishalmi 
> <la...@gmail.com>:
>
>     You can call the platform application with different command line
>     parameters. If the application is already running those can be
>     processed
>     by the opened application.
>
>
>     That's how Open project/file works through CLI arguments.
>
>     On 9/12/25 21:44, Patrik Karlström wrote:
>     > Does the platform have some kind of support for communicating
>     with the
>     > application from the outside by files in the userdir or similar?
>     >
>     > /Patrik
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
>     For additional commands, e-mail: users-help@netbeans.apache.org
>
>     For further information about the NetBeans mailing lists, visit:
>     https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>

Re: [platform] Communicate with an nbp application

Posted by Patrik Karlström <pa...@trixon.se>.
Thanks Laszlo, it works perfectly!
With this simple plugin I'm now able to save all files in the IDE first
thing in my external build script.
So no more waiting for a build to fail (due to unsaved files at least...)

public class Handler implements ArgsProcessor {

    @Arg(longName = "save-all")
    @Description(
            shortDescription = "Save all files"
    )
    public boolean mSaveAllOption;

    public Handler() {
    }

    @Override
    public void process(Env env) throws CommandException {
        if (mSaveAllOption) {
            LifecycleManager.getDefault().saveAll();
        }
    }

}


Den lör 13 sep. 2025 kl 18:50 skrev Laszlo Kishalmi <
laszlo.kishalmi@gmail.com>:

> You can call the platform application with different command line
> parameters. If the application is already running those can be processed
> by the opened application.
>
>
> That's how Open project/file works through CLI arguments.
>
> On 9/12/25 21:44, Patrik Karlström wrote:
> > Does the platform have some kind of support for communicating with the
> > application from the outside by files in the userdir or similar?
> >
> > /Patrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>

Re: [platform] Communicate with an nbp application

Posted by Laszlo Kishalmi <la...@gmail.com>.
You can call the platform application with different command line 
parameters. If the application is already running those can be processed 
by the opened application.


That's how Open project/file works through CLI arguments.

On 9/12/25 21:44, Patrik Karlström wrote:
> Does the platform have some kind of support for communicating with the 
> application from the outside by files in the userdir or similar?
>
> /Patrik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists