Re: Auto Enabling/Disabling of Menu Items
út 31. 3. 2020 v 4:22 odesílatel Sean Carrick napsal: > Hello, Dev List! > > I am somewhat new at designing RCPs on the NetBeans Platform and have run > into a small issue. If anyone can point me in the right direction, I will > be very grateful. > > I am working on a singleton class, FuelPurchaseManager, which stores the > data for the Proof of Concept for my project for making fuel purchases. I > have created a menu, Maintenance/Post Journals to Ledger. On this menu, I > have created the following Action: > > package com.northwind.fuel.controller; > import com.northwind.fuel.model.FuelPurchaseManager;import > java.awt.event.ActionEvent;import java.awt.event.ActionListener;import > org.openide.loaders.DataObject;import org.openide.awt.ActionID;import > org.openide.awt.ActionReference;import > org.openide.awt.ActionRegistration;import > org.openide.util.NbBundle.Messages; > > @ActionID( > category = "Maintenance", > id = "com.northwind.fuel.controller.PostJournalToGL" > )@ActionRegistration( > iconBase = "com/northwind/fuel/postToGL.png", > displayName = "#CTL_PostJournalToGL" > )@ActionReference(path = "Menu/Maintenance/Journals", position = > 3233)@Messages("CTL_PostJournalToGL=Post Fuel Journal")public final > class PostJournalToGL implements ActionListener { > > private final FuelPurchaseManager context; > > public PostJournalToGL(FuelPurchaseManager context) { > this.context = context; > } > > @Override > public void actionPerformed(ActionEvent ev) { > FuelPurchaseManager.getInstance().actionPerformed(ev); > Wrong. Don't use singleton. Use `context`. > } > } > > > I have set up the FuelPurchaseManager singleton as follows: > > public class FuelPurchaseManager extends AbstractAction > implements LookupListener, ContextAwareAction { > Remove `extends AbstractAction implements LookupListener, ContextAwareAction` keep just the business logic. Then just make sure a TopComponent with instance of `FuelPurchaceManager` in its lookup is opened - on startup - on some other action - etc.: ``` TopComponent tc = new TopComponent() { { associateLookup(Lookups.singleton(new FuelPurchaceManager())); } }; tc.open(); tc.requestActive(); ``` Your `PostJournalToGL` action is going to be enabled when your TopComponent is focused and disabled otherwise. -jt PS: https://www.slideshare.net/guestb9a4bf/mvcdci-in-netbeans-by-jaroslav-tulach PPS: http://wiki.apidesign.org/wiki/DCI > public static final long serialVersionUID = 6597346658963L; > > private static FuelPurchaseManager mgr = null; > private Lookup context; > Lookup.Result lkpInfo; > > private final ArrayList journal; > > private FuelPurchaseManager() { > this.journal = new ArrayList<>(); > > /* > * > * DEBUGGING CODE: The following code, until the "END > DEBUGGING" ** comment is for the Proof of Concept > only. It will need to be * * updated to ***actual*** > business logic before we create a release * * build. >* > / > DateTimeFormatter fmt = DateTimeFormatter.ofPattern("MMM dd, > "); > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 14, 2020", fmt), // Tx date > 540312, // Odometer > 102.890, // # of gallons > 2.765, // Price per gallon > 284.49)); // Total price > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 17, 2020", fmt), > 541990, > 134.880, > 2.493, > 336.26)); > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 20, 2020", fmt), > 542766, > 151.460, > 2.420, > 366.46)); > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 21, 2020", fmt), > 543088, > 92.730, > 2.306, > 213.80)); > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 23, 2020", fmt), > 545317, > 161.060, > 2.620, > 421.99)); > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 25, 2020", fmt), > 546525, > 127.360, > 2.706, > 344.66)); > this.journal.add(new FuelPurchase( > LocalDate.parse("Jan 29, 2020", fmt), > 547184, > 168.880, > 2.315, > 390.87)); > /* >
Re: Dedication message for NetBeans 12
+1 —Gail > On Apr 3, 2020, at 4:54 AM, Sven Reimers wrote: > > Hi all, > > I assume most of you already heard about Carl Quinn passing away on April > 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. > > He was a dear friend, a humble community guy and one of the people working > on NetBeans features in Sun days... > > So I would suggest to put in a dedication "in memoriam Carl Quinn" for the > 12.0 Apache NetBeans release... what do you think? > > Not sure how, not sure where just pondering the general idea first. > > > If you need any more ressons - just follow the twitter thread.. > > Comments? > > Thanks for considering and stay safe > > -Sven - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
RE: Dedication message for NetBeans 12
+1 -Original Message- From: Sven Reimers Sent: April 3, 2020 7:54 AM To: dev Subject: Dedication message for NetBeans 12 Hi all, I assume most of you already heard about Carl Quinn passing away on April 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. He was a dear friend, a humble community guy and one of the people working on NetBeans features in Sun days... So I would suggest to put in a dedication "in memoriam Carl Quinn" for the 12.0 Apache NetBeans release... what do you think? Not sure how, not sure where just pondering the general idea first. If you need any more ressons - just follow the twitter thread.. Comments? Thanks for considering and stay safe -Sven
Re: Dedication message for NetBeans 12
I completely agree :( +1 -- Emmanuel Hugonnet http://www.ehsavoie.com http://twitter.com/ehsavoie On Fri, Apr 3, 2020 at 7:15 PM Eirik Bakke wrote: > +1 > > -Original Message- > From: Mario Schroeder > Sent: Friday, April 3, 2020 8:11 AM > To: dev@netbeans.apache.org > Subject: Re: Dedication message for NetBeans 12 > > Das to hear. Maybe put a detication in the 'About NetBeans' window for the > release. So his work for NetBeans is bond to the actual product. > > Regards, > Mario > > Sven Reimers schrieb am Fr., 3. Apr. 2020, 13:54: > > > Hi all, > > > > I assume most of you already heard about Carl Quinn passing away on > > April 1st (see > https://twitter.com/javaposse/status/1245583036588019715?s=19).. > > > > He was a dear friend, a humble community guy and one of the people > > working on NetBeans features in Sun days... > > > > So I would suggest to put in a dedication "in memoriam Carl Quinn" for > > the > > 12.0 Apache NetBeans release... what do you think? > > > > Not sure how, not sure where just pondering the general idea first. > > > > > > If you need any more ressons - just follow the twitter thread.. > > > > Comments? > > > > Thanks for considering and stay safe > > > > -Sven > > >
RE: Dedication message for NetBeans 12
+1 -Original Message- From: Mario Schroeder Sent: Friday, April 3, 2020 8:11 AM To: dev@netbeans.apache.org Subject: Re: Dedication message for NetBeans 12 Das to hear. Maybe put a detication in the 'About NetBeans' window for the release. So his work for NetBeans is bond to the actual product. Regards, Mario Sven Reimers schrieb am Fr., 3. Apr. 2020, 13:54: > Hi all, > > I assume most of you already heard about Carl Quinn passing away on > April 1st (see > https://twitter.com/javaposse/status/1245583036588019715?s=19).. > > He was a dear friend, a humble community guy and one of the people > working on NetBeans features in Sun days... > > So I would suggest to put in a dedication "in memoriam Carl Quinn" for > the > 12.0 Apache NetBeans release... what do you think? > > Not sure how, not sure where just pondering the general idea first. > > > If you need any more ressons - just follow the twitter thread.. > > Comments? > > Thanks for considering and stay safe > > -Sven >
Re: Dedication message for NetBeans 12
+1 On 4/04/2020 5:56 am, Geertjan Wielenga wrote: Agree! Gj On Fri, Apr 3, 2020 at 6:56 PM Ivan Soleimanipour < ivan.soleimanip...@sbcglobal.net> wrote: +1 On 4/3/20 5:10 AM, Mario Schroeder wrote: Das to hear. Maybe put a detication in the 'About NetBeans' window for the release. So his work for NetBeans is bond to the actual product. Regards, Mario Sven Reimers schrieb am Fr., 3. Apr. 2020, 13:54: Hi all, I assume most of you already heard about Carl Quinn passing away on April 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19) .. He was a dear friend, a humble community guy and one of the people working on NetBeans features in Sun days... So I would suggest to put in a dedication "in memoriam Carl Quinn" for the 12.0 Apache NetBeans release... what do you think? Not sure how, not sure where just pondering the general idea first. If you need any more ressons - just follow the twitter thread.. Comments? Thanks for considering and stay safe -Sven - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-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: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: Dedication message for NetBeans 12
+1 On Fri, Apr 3, 2020 at 4:54 AM Sven Reimers wrote: > Hi all, > > I assume most of you already heard about Carl Quinn passing away on April > 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. > > He was a dear friend, a humble community guy and one of the people working > on NetBeans features in Sun days... > > So I would suggest to put in a dedication "in memoriam Carl Quinn" for the > 12.0 Apache NetBeans release... what do you think? > > Not sure how, not sure where just pondering the general idea first. > > > If you need any more ressons - just follow the twitter thread.. > > Comments? > > Thanks for considering and stay safe > > -Sven >
Re: Dedication message for NetBeans 12
Agree! Gj On Fri, Apr 3, 2020 at 6:56 PM Ivan Soleimanipour < ivan.soleimanip...@sbcglobal.net> wrote: > +1 > > > On 4/3/20 5:10 AM, Mario Schroeder wrote: > > Das to hear. Maybe put a detication in the 'About NetBeans' window for > the > > release. So his work for NetBeans is bond to the actual product. > > > > Regards, > > Mario > > > > Sven Reimers schrieb am Fr., 3. Apr. 2020, > 13:54: > > > >> Hi all, > >> > >> I assume most of you already heard about Carl Quinn passing away on > April > >> 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19) > .. > >> > >> He was a dear friend, a humble community guy and one of the people > working > >> on NetBeans features in Sun days... > >> > >> So I would suggest to put in a dedication "in memoriam Carl Quinn" for > the > >> 12.0 Apache NetBeans release... what do you think? > >> > >> Not sure how, not sure where just pondering the general idea first. > >> > >> > >> If you need any more ressons - just follow the twitter thread.. > >> > >> Comments? > >> > >> Thanks for considering and stay safe > >> > >> -Sven > >> > > > > - > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > For additional commands, e-mail: dev-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >
Re: Dedication message for NetBeans 12
+1 On 4/3/20 5:10 AM, Mario Schroeder wrote: Das to hear. Maybe put a detication in the 'About NetBeans' window for the release. So his work for NetBeans is bond to the actual product. Regards, Mario Sven Reimers schrieb am Fr., 3. Apr. 2020, 13:54: Hi all, I assume most of you already heard about Carl Quinn passing away on April 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. He was a dear friend, a humble community guy and one of the people working on NetBeans features in Sun days... So I would suggest to put in a dedication "in memoriam Carl Quinn" for the 12.0 Apache NetBeans release... what do you think? Not sure how, not sure where just pondering the general idea first. If you need any more ressons - just follow the twitter thread.. Comments? Thanks for considering and stay safe -Sven - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
RE: Forced to download nb-javac even when not selected
> over the past few years, the gap between NetBeans+nb-javac and > NetBeans+recent JDK javac got much smaller That's good to hear. In particular, is there a fundamental reason why Compile on Save can not be supported from the JDK javac? -- Eirik -Original Message- From: Jan Lahoda Sent: Friday, April 3, 2020 2:12 AM To: Apache NetBeans Subject: Re: Forced to download nb-javac even when not selected On Thu, Apr 2, 2020 at 5:10 PM Eirik Bakke wrote: > > Aside from that, for 12.0, should we downplay the usage of nb-javac > > as > much as possible and not make it so prominently available -- we should > be encouraging the usage of the latest LTS, which is 11 and not 8. > > I'm concerned that "downplaying" nb-javac will discourage us from > maintaining it. > I guess I think we should reduce the intensity of NetBeans pushing the user to download nb-javac, which I think is what Geertjan says. There is a number of reasons to that - over the past few years, the gap between NetBeans+nb-javac and NetBeans+recent JDK javac got much smaller, having nb-javac is in some cases even undesirable (as NetBeans is still using the JDK 13-based nb-javac, no JDK 14 language features are available, AFAIK), etc. So pushing users hard to install nb-javac while they run on JDK 14 does not seem very good to me. (What to do when running on JDK 13 is unclear to me.) Jan > I understand that the JDK-based javac is the way to go in the long term. > But http://wiki.netbeans.org/JavacDiff lists a lot of good reasons why > nb-javac had to exist, and until all of these requirements are met by > the new approach, it seems dangerous to abandon nb-javac. In the > short-term, the most high-quality solution would seem to be to stick > with nb-javac, updating and fixing bugs in the latter while waiting > for JDK-based javac to catch up feature-wise. > > What is our strategy here? > > -- Eirik > > -Original Message- > From: Geertjan Wielenga > Sent: Thursday, April 2, 2020 4:09 AM > To: dev > Subject: Forced to download nb-javac even when not selected > > Hi all, > > I've encountered this one too: > > https://issues.apache.org/jira/browse/NETBEANS-4078 > > i.e., I'm running NB on JDK 14, I do not select the nb-javac checkbox. > I click Download and Activate. > > And then I am shown that the nb-javac editing support library will be > downloaded, even though I did not select it. > > Aside from that, for 12.0, should we downplay the usage of nb-javac as > much as possible and not make it so prominently available -- we should > be encouraging the usage of the latest LTS, which is 11 and not 8. > > Thoughts? > > Gj > > > > - > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > For additional commands, e-mail: dev-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >
Re: Dedication message for NetBeans 12
+1 Josh Juneau juneau...@gmail.com http://jj-blogger.blogspot.com https://www.apress.com/us/search?query=Juneau > On Apr 3, 2020, at 7:11 AM, Mario Schroeder wrote: > > Das to hear. Maybe put a detication in the 'About NetBeans' window for the > release. So his work for NetBeans is bond to the actual product. > > Regards, > Mario > > Sven Reimers schrieb am Fr., 3. Apr. 2020, 13:54: > >> Hi all, >> >> I assume most of you already heard about Carl Quinn passing away on April >> 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. >> >> He was a dear friend, a humble community guy and one of the people working >> on NetBeans features in Sun days... >> >> So I would suggest to put in a dedication "in memoriam Carl Quinn" for the >> 12.0 Apache NetBeans release... what do you think? >> >> Not sure how, not sure where just pondering the general idea first. >> >> >> If you need any more ressons - just follow the twitter thread.. >> >> Comments? >> >> Thanks for considering and stay safe >> >> -Sven >>
Re: Dedication message for NetBeans 12
Das to hear. Maybe put a detication in the 'About NetBeans' window for the release. So his work for NetBeans is bond to the actual product. Regards, Mario Sven Reimers schrieb am Fr., 3. Apr. 2020, 13:54: > Hi all, > > I assume most of you already heard about Carl Quinn passing away on April > 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. > > He was a dear friend, a humble community guy and one of the people working > on NetBeans features in Sun days... > > So I would suggest to put in a dedication "in memoriam Carl Quinn" for the > 12.0 Apache NetBeans release... what do you think? > > Not sure how, not sure where just pondering the general idea first. > > > If you need any more ressons - just follow the twitter thread.. > > Comments? > > Thanks for considering and stay safe > > -Sven >
Dedication message for NetBeans 12
Hi all, I assume most of you already heard about Carl Quinn passing away on April 1st (see https://twitter.com/javaposse/status/1245583036588019715?s=19).. He was a dear friend, a humble community guy and one of the people working on NetBeans features in Sun days... So I would suggest to put in a dedication "in memoriam Carl Quinn" for the 12.0 Apache NetBeans release... what do you think? Not sure how, not sure where just pondering the general idea first. If you need any more ressons - just follow the twitter thread.. Comments? Thanks for considering and stay safe -Sven
Re: Forced to download nb-javac even when not selected
IMHO, if nb-javac should be retired in the long term or 12.0+ we should find a way to decouple availability of JDK features from runtime JDK. It feels odd to have the latest JDK to be the runtime JDK if If want to use it for a single project for example. That's something I personally prefer by using nb-javac. BTW it also seems to work much faster, too. Benjamin On 03.04.2020 08:11, Jan Lahoda wrote: > On Thu, Apr 2, 2020 at 5:10 PM Eirik Bakke wrote: > >>> Aside from that, for 12.0, should we downplay the usage of nb-javac as >> much as possible and not make it so prominently available -- we should be >> encouraging the usage of the latest LTS, which is 11 and not 8. >> >> I'm concerned that "downplaying" nb-javac will discourage us from >> maintaining it. >> > I guess I think we should reduce the intensity of NetBeans pushing the user > to download nb-javac, which I think is what Geertjan says. There is a > number of reasons to that - over the past few years, the gap between > NetBeans+nb-javac and NetBeans+recent JDK javac got much smaller, having > nb-javac is in some cases even undesirable (as NetBeans is still using the > JDK 13-based nb-javac, no JDK 14 language features are available, AFAIK), > etc. So pushing users hard to install nb-javac while they run on JDK 14 > does not seem very good to me. (What to do when running on JDK 13 is > unclear to me.) > > Jan > > >> I understand that the JDK-based javac is the way to go in the long term. >> But http://wiki.netbeans.org/JavacDiff lists a lot of good reasons why >> nb-javac had to exist, and until all of these requirements are met by the >> new approach, it seems dangerous to abandon nb-javac. In the short-term, >> the most high-quality solution would seem to be to stick with nb-javac, >> updating and fixing bugs in the latter while waiting for JDK-based javac to >> catch up feature-wise. >> >> What is our strategy here? >> >> -- Eirik >> >> -Original Message- >> From: Geertjan Wielenga >> Sent: Thursday, April 2, 2020 4:09 AM >> To: dev >> Subject: Forced to download nb-javac even when not selected >> >> Hi all, >> >> I've encountered this one too: >> >> https://issues.apache.org/jira/browse/NETBEANS-4078 >> >> i.e., I'm running NB on JDK 14, I do not select the nb-javac checkbox. I >> click Download and Activate. >> >> And then I am shown that the nb-javac editing support library will be >> downloaded, even though I did not select it. >> >> Aside from that, for 12.0, should we downplay the usage of nb-javac as >> much as possible and not make it so prominently available -- we should be >> encouraging the usage of the latest LTS, which is 11 and not 8. >> >> Thoughts? >> >> Gj >> >> >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org >> For additional commands, e-mail: dev-h...@netbeans.apache.org >> >> For further information about the NetBeans mailing lists, visit: >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists >> >> >> >> signature.asc Description: OpenPGP digital signature
Re: Forced to download nb-javac even when not selected
On Thu, Apr 2, 2020 at 5:10 PM Eirik Bakke wrote: > > Aside from that, for 12.0, should we downplay the usage of nb-javac as > much as possible and not make it so prominently available -- we should be > encouraging the usage of the latest LTS, which is 11 and not 8. > > I'm concerned that "downplaying" nb-javac will discourage us from > maintaining it. > I guess I think we should reduce the intensity of NetBeans pushing the user to download nb-javac, which I think is what Geertjan says. There is a number of reasons to that - over the past few years, the gap between NetBeans+nb-javac and NetBeans+recent JDK javac got much smaller, having nb-javac is in some cases even undesirable (as NetBeans is still using the JDK 13-based nb-javac, no JDK 14 language features are available, AFAIK), etc. So pushing users hard to install nb-javac while they run on JDK 14 does not seem very good to me. (What to do when running on JDK 13 is unclear to me.) Jan > I understand that the JDK-based javac is the way to go in the long term. > But http://wiki.netbeans.org/JavacDiff lists a lot of good reasons why > nb-javac had to exist, and until all of these requirements are met by the > new approach, it seems dangerous to abandon nb-javac. In the short-term, > the most high-quality solution would seem to be to stick with nb-javac, > updating and fixing bugs in the latter while waiting for JDK-based javac to > catch up feature-wise. > > What is our strategy here? > > -- Eirik > > -Original Message- > From: Geertjan Wielenga > Sent: Thursday, April 2, 2020 4:09 AM > To: dev > Subject: Forced to download nb-javac even when not selected > > Hi all, > > I've encountered this one too: > > https://issues.apache.org/jira/browse/NETBEANS-4078 > > i.e., I'm running NB on JDK 14, I do not select the nb-javac checkbox. I > click Download and Activate. > > And then I am shown that the nb-javac editing support library will be > downloaded, even though I did not select it. > > Aside from that, for 12.0, should we downplay the usage of nb-javac as > much as possible and not make it so prominently available -- we should be > encouraging the usage of the latest LTS, which is 11 and not 8. > > Thoughts? > > Gj > > > > - > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > For additional commands, e-mail: dev-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >