Re: NetBeans integrated terminal
Hi Pavel, Some answers below. On 2/4/24 22:36, PavelTurk wrote: Hello all. Could anyone explain how it is possible to run native application, for example, midnight commander in NB terminal? NetBeans uses a pure-Java terminal emulator. This is spread in different modules, the low-level module with support for terminal emulation is the "ide/lib.terminalemulator" module. Here's a pointer to get you started: https://github.com/apache/netbeans/blob/905ff7ef8344e372318751f6e93082a35da3b87f/ide/lib.terminalemulator/src/org/netbeans/lib/terminalemulator/Term.java I mean NB is a java application and as I understand it uses swing library for UI. And how was native application made to work inside java application with swing? What is the magic here? As explained by Thomas Wolf, you can launch any operating system process (say midnight commander) using the Java's ProcessBuilder class (NetBeans also has ad-hoc process launching mechanisms that were in place before ProcessBuilder was invented, see [1]). Once you launch an external process the modules "ide/lib.terminalemulator", "ide.terminalnb", "ide/dlight.terminal" and some others are responsible for painting the terminal emulator in Swing. Hope this helps, Antonio [1] https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-extexecution-base/overview-summary.html Best regards, Pavel - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: NetBeans integrated terminal
I don't know how the Netbeans team chose to implement its terminal feature. But I'd imagine it would involve a Java Swing component such as JEditorPanel and sending Midnight commander's stdout/stderr streams to that panel and forwarding keyboard input to the stdin of that application. tom > On Apr 2, 2024, at 4:47 PM, PavelTurk wrote: > > midnight commander TUI interface
Re: NetBeans integrated terminal
Thank you for your answer. It is clear, that it is possible to run external processes. The question is about "view". How midnight commander TUI interface is rendered in Swing Window? Best regards, Pavel On 4/2/24 11:43 PM, Thomas Wolf wrote: Just because an application was written in Java doesn't mean it can't run external processes. Look into the java API documentation on ProcessBuilder class. Tom On Apr 2, 2024, at 4:36 PM, PavelTurk wrote: Hello all. Could anyone explain how it is possible to run native application, for example, midnight commander in NB terminal? I mean NB is a java application and as I understand it uses swing library for UI. And how was native application made to work inside java application with swing? What is the magic here? Best regards, Pavel - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: NetBeans integrated terminal
Just because an application was written in Java doesn't mean it can't run external processes. Look into the java API documentation on ProcessBuilder class. Tom > On Apr 2, 2024, at 4:36 PM, PavelTurk wrote: > > Hello all. > > Could anyone explain how it is possible to run native application, for > example, midnight commander in NB terminal? > I mean NB is a java application and as I understand it uses swing library for > UI. And how was native application made > to work inside java application with swing? What is the magic here? > > Best regards, Pavel > > - > To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org > For additional commands, e-mail: users-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
NetBeans integrated terminal
Hello all. Could anyone explain how it is possible to run native application, for example, midnight commander in NB terminal? I mean NB is a java application and as I understand it uses swing library for UI. And how was native application made to work inside java application with swing? What is the magic here? Best regards, Pavel - To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org For additional commands, e-mail: users-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists