Re: Formatting help: try-with-resource multiple variables
look for the linebreak settings in options editor formatting. met vriendelijke groet Pieter van den Hombergh Op wo 10 apr 2024 11:19 schreef Francesco Chicchiriccò : > Hi there, > possibly a silly question: how can I convince Netbeans 21 to format like > as following: > > try (InputStream propStream = > getClass().getResourceAsStream("/test.properties"); > InputStream srcStream = new > FileInputStream(props.getProperty("test.csv.src")); > FileOutputStream dstStream = new > FileOutputStream(props.getProperty("test.csv.dst"))) { > > e.g. one variable per line, while it keeps rearranging as: > > try (InputStream propStream = > getClass().getResourceAsStream("/test.properties"); InputStream srcStream = > new FileInputStream(props.getProperty("test.csv.src")); > FileOutputStream dstStream = > new FileOutputStream(props.getProperty("test.csv.dst"))) { > > ? > > TIA > Regards. > > -- > Francesco Chicchiriccò > > Tirasa - Open Source Excellence > http://www.tirasa.net/ > > Member at The Apache Software Foundation > Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail > http://home.apache.org/~ilgrosso/ > > > - > 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: Formatting help: try-with-resource multiple variables
Thank you, it worked! FTR I had to save and restart Netbeans, a simple "Apply" did not actually change the formatting. Regards. On 2024/04/10 11:45:23 zephy...@gmail.com wrote: > I tried to send an image but it failed. > > The configuration is at: Tools -> Options -> Editor -> Formatting > > Set the Language to "Java" and Category to "Wrapping" > > To set one variable per line set the "Try Resources" option to "Always" > > > On 2024/04/10 09:17:16 Francesco Chicchiriccò wrote: > > Hi there, > > possibly a silly question: how can I convince Netbeans 21 to format like as > > following: > > > > try (InputStream propStream = > > getClass().getResourceAsStream("/test.properties"); > > InputStream srcStream = new > > FileInputStream(props.getProperty("test.csv.src")); > > FileOutputStream dstStream = new > > FileOutputStream(props.getProperty("test.csv.dst"))) { > > > > e.g. one variable per line, while it keeps rearranging as: > > > > try (InputStream propStream = > > getClass().getResourceAsStream("/test.properties"); InputStream srcStream = > > new FileInputStream(props.getProperty("test.csv.src")); > > FileOutputStream dstStream = > > new FileOutputStream(props.getProperty("test.csv.dst"))) { > > > > ? > > > > TIA > > Regards. > > > > -- > > Francesco Chicchiriccò > > > > Tirasa - Open Source Excellence > > http://www.tirasa.net/ > > > > Member at The Apache Software Foundation > > Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail > > http://home.apache.org/~ilgrosso/ > > > > > > - > > 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 > > > > > > -- > Sent with Vivaldi Mail. Download Vivaldi for free at vivaldi.com > > - > 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: Formatting help: try-with-resource multiple variables
I tried to send an image but it failed. The configuration is at: Tools -> Options -> Editor -> Formatting Set the Language to "Java" and Category to "Wrapping" To set one variable per line set the "Try Resources" option to "Always" On 2024/04/10 09:17:16 Francesco Chicchiriccò wrote: > Hi there, > possibly a silly question: how can I convince Netbeans 21 to format like as > following: > > try (InputStream propStream = > getClass().getResourceAsStream("/test.properties"); > InputStream srcStream = new > FileInputStream(props.getProperty("test.csv.src")); > FileOutputStream dstStream = new > FileOutputStream(props.getProperty("test.csv.dst"))) { > > e.g. one variable per line, while it keeps rearranging as: > > try (InputStream propStream = > getClass().getResourceAsStream("/test.properties"); InputStream srcStream = > new FileInputStream(props.getProperty("test.csv.src")); > FileOutputStream dstStream = > new FileOutputStream(props.getProperty("test.csv.dst"))) { > > ? > > TIA > Regards. > > -- > Francesco Chicchiriccò > > Tirasa - Open Source Excellence > http://www.tirasa.net/ > > Member at The Apache Software Foundation > Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail > http://home.apache.org/~ilgrosso/ > > > - > 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 > > -- Sent with Vivaldi Mail. Download Vivaldi for free at vivaldi.com - 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
Formatting help: try-with-resource multiple variables
Hi there, possibly a silly question: how can I convince Netbeans 21 to format like as following: try (InputStream propStream = getClass().getResourceAsStream("/test.properties"); InputStream srcStream = new FileInputStream(props.getProperty("test.csv.src")); FileOutputStream dstStream = new FileOutputStream(props.getProperty("test.csv.dst"))) { e.g. one variable per line, while it keeps rearranging as: try (InputStream propStream = getClass().getResourceAsStream("/test.properties"); InputStream srcStream = new FileInputStream(props.getProperty("test.csv.src")); FileOutputStream dstStream = new FileOutputStream(props.getProperty("test.csv.dst"))) { ? TIA Regards. -- Francesco Chicchiriccò Tirasa - Open Source Excellence http://www.tirasa.net/ Member at The Apache Software Foundation Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail http://home.apache.org/~ilgrosso/ - 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