13 Replies Latest reply on Dec 29, 2014 12:35 PM by Daniel Cunha (soro)

    addon creation

    fazertyplus Newbie

      Hi,

       

      I'm trying to create an addon. (Fazerty/jbfex-addon · GitHub)

      There are 2 commands:

      - one to create a project and write in this project a fiel readme.txt from a template

      - one to create a java file from a template and add dependency. This command is only available to projects created with the first command.

       

      I've several problems:

      - in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand

              this  doesn't work :

              project = getSelectedProject(builder.getUIContext()); 

      - the methods to create files from template works when the forge cli is used, but not when the forge UI in eclipse is used

           here is the code used:

             URL resourceURL = getClass().getResource("mailservice.fmt");

              Resource<URL> templateResource = resourceFactory.create(resourceURL);

              Template template = templateFactory.create(templateResource, FreemarkerTemplate.class);  

       

      Maybe I did something wrong, but I can't find what.

      Is somebody able to help me and give me some advice to improve this addon.

       

      Many Thanks

       

      Fazerty

        • 1. Re: [forge-users] addon creation
          George Gastaldi Master

          Do you have any stacktrace? Check the error log in Eclipse

           

           

           

          Em 23/12/2014, às 12:04, forge-users@lists.jboss.org escreveu:

           

          Hi,

           

          I'm trying to create an addon. (Fazerty/jbfex-addon · GitHub (https://github.com/Fazerty/jbfex-addon/))

          There are 2 commands:

          - one to create a project and write in this project a fiel readme.txt from a template

          - one to create a java file from a template and add dependency. This command is only available to projects created with the first command.

           

          I've several problems:

          - in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand

                  this  doesn't work :

          project = getSelectedProject(builder.getUIContext());

          - the methods to create files from template works when the forge cli is used, but not when the forge UI in eclipse is used

               here is the code used:

          URL resourceURL = getClass().getResource("mailservice.fmt");

          +        Resource<URL> templateResource = resourceFactory.create(resourceURL);+

          *        Template template = templateFactory.create(templateResource, FreemarkerTemplate.class);  * 

           

          Maybe I did something wrong, but I can't find what.

          Is somebody able to help me and give me some advice to improve this addon.

           

          Many Thanks

           

          Fazerty

           

          Posted by forums

          Original post: https://developer.jboss.org/message/914438#914438

           

          _______________________________________________

          forge-users mailing list

          forge-users@lists.jboss.org

          https://lists.jboss.org/mailman/listinfo/forge-users

           

          _______________________________________________

          forge-users mailing list

          forge-users@lists.jboss.org

          https://lists.jboss.org/mailman/listinfo/forge-users

           

           

          • 2. Re: Re: [forge-users] addon creation
            fazertyplus Newbie

            I can't reproduce the error I had only in eclipse with the methods to create files from templates.

             

            Here is the stacktrace when in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand I use project = getSelectedProject(builder.getUIContext());

             

            java.lang.NullPointerException

                at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:38)

                at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:26)

                at org.jboss.forge.addon.projects.ui.AbstractProjectCommand.getSelectedProject(AbstractProjectCommand.java:75)

                at org.jbfex.addon.commands.JbfexMailCommand.initializeUI(JbfexMailCommand.java:77)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:483)

                at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)

                at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

                at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)

                at org.jbfex.addon.commands.JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.initializeUI(JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.java)

                at org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.initialize(SingleCommandControllerImpl.java:57)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:483)

                at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)

                at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

                at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)

                at org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.initialize(CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.java)

                at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:118)

                at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:102)

                at org.jboss.tools.forge.ui.internal.ext.dialog.UICommandListDialog$1$1.handleElementSelected(UICommandListDialog.java:233)

                at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:322)

                at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:312)

                at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents$6.mouseUp(QuickAccessContents.java:461)

                at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)

                at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)

                at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)

                at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)

                at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)

                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)

                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)

                at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)

                at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)

                at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)

                at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

                at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)

                at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

                at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)

                at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:483)

                at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)

                at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)

                at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

                at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

            • 3. Re: [forge-users] addon creation
              Daniel Cunha (soro) Novice

              Hi,

               

              you need to do "getSelectedProject(builder)" if you want get the selected

              project.

               

              On Thu, Dec 25, 2014 at 10:08 AM, <forge-users@lists.jboss.org> wrote:

               

              I can't reproduce the error I had only in eclipse with the methods to

              create files from templates.

               

              Here is the stacktrace when in the method initializeUI(UIBuilder builder)

              of the class JbfexMailCommand I use *+project =

              getSelectedProject(builder.getUIContext());+*

               

               

              > java.lang.NullPointerException

              >

              >     at

              > org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:38)

              >

              >     at

              > org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:26)

              >

              >     at

              > org.jboss.forge.addon.projects.ui.AbstractProjectCommand.getSelectedProject(AbstractProjectCommand.java:75)

              >

              >     at

              > org.jbfex.addon.commands.JbfexMailCommand.initializeUI(JbfexMailCommand.java:77)

              >

              >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              >

              >     at

              > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

              >

              >     at

              > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              >

              >     at java.lang.reflect.Method.invoke(Method.java:483)

              >

              >     at

              > org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)

              >

              >     at

              > org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

              >

              >     at

              > org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)

              >

              >     at

              > org.jbfex.addon.commands.JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.initializeUI(JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.java)

              >

              >     at

              > org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.initialize(SingleCommandControllerImpl.java:57)

              >

              >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              >

              >     at

              > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

              >

              >     at

              > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              >

              >     at java.lang.reflect.Method.invoke(Method.java:483)

              >

              >     at

              > org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)

              >

              >     at

              > org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

              >

              >     at

              > org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)

              >

              >     at

              > org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.initialize(CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.java)

              >

              >     at

              > org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:118)

              >

              >     at

              > org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:102)

              >

              >     at

              > org.jboss.tools.forge.ui.internal.ext.dialog.UICommandListDialog$1$1.handleElementSelected(UICommandListDialog.java:233)

              >

              >     at

              > org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:322)

              >

              >     at

              > org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:312)

              >

              >     at

              > org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents$6.mouseUp(QuickAccessContents.java:461)

              >

              >     at

              > org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)

              >

              >     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

              >

              >     at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)

              >

              >     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)

              >

              >     at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)

              >

              >     at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)

              >

              >     at

              > org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)

              >

              >     at

              > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

              >

              >     at

              > org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)

              >

              >     at

              > org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)

              >

              >     at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)

              >

              >     at

              > org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

              >

              >     at

              > org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)

              >

              >     at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

              >

              >     at

              > org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)

              >

              >     at

              > org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

              >

              >     at

              > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

              >

              >     at

              > org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

              >

              >     at

              > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)

              >

              >     at

              > org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)

              >

              >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              >

              >     at

              > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

              >

              >     at

              > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              >

              >     at java.lang.reflect.Method.invoke(Method.java:483)

              >

              >     at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)

              >

              >     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)

              >

              >     at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

              >

              >     at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

              >

              >

               

              Posted by forums

              Original post: https://developer.jboss.org/message/914532#914532

               

              _______________________________________________

              forge-users mailing list

              forge-users@lists.jboss.org

              https://lists.jboss.org/mailman/listinfo/forge-users

               

               

               

               

              --

              Daniel Cunha (soro)

               

              • 4. Re: [forge-users] addon creation
                George Gastaldi Master

                Both methods should work. I'll try to reproduce it asap

                 

                 

                 

                Em 25/12/2014, às 15:36, Daniel Cunha <danielsoro@gmail.com> escreveu:

                 

                Hi,

                 

                you need to do "getSelectedProject(builder)" if you want get the selected project.

                 

                >> On Thu, Dec 25, 2014 at 10:08 AM, <forge-users@lists.jboss.org> wrote:

                >> I can't reproduce the error I had only in eclipse with the methods to create files from templates.

                >>

                >> Here is the stacktrace when in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand I use project = getSelectedProject(builder.getUIContext());

                >>

                >>

                 

                >> java.lang.NullPointerException

                >>

                >>     at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:38)

                >>

                >>     at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:26)

                >>

                >>     at org.jboss.forge.addon.projects.ui.AbstractProjectCommand.getSelectedProject(AbstractProjectCommand.java:75)

                >>

                >>     at org.jbfex.addon.commands.JbfexMailCommand.initializeUI(JbfexMailCommand.java:77)

                >>

                >>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                >>

                >>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                >>

                >>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                >>

                >>     at java.lang.reflect.Method.invoke(Method.java:483)

                >>

                >>     at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)

                >>

                >>     at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

                >>

                >>     at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)

                >>

                >>     at org.jbfex.addon.commands.JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.initializeUI(JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.java)

                >>

                >>     at org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.initialize(SingleCommandControllerImpl.java:57)

                >>

                >>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                >>

                >>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                >>

                >>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                >>

                >>     at java.lang.reflect.Method.invoke(Method.java:483)

                >>

                >>     at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)

                >>

                >>     at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

                >>

                >>     at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)

                >>

                >>     at org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.initialize(CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.java)

                >>

                >>     at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:118)

                >>

                >>     at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:102)

                >>

                >>     at org.jboss.tools.forge.ui.internal.ext.dialog.UICommandListDialog$1$1.handleElementSelected(UICommandListDialog.java:233)

                >>

                >>     at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:322)

                >>

                >>     at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:312)

                >>

                >>     at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents$6.mouseUp(QuickAccessContents.java:461)

                >>

                >>     at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)

                >>

                >>     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                >>

                >>     at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)

                >>

                >>     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)

                >>

                >>     at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)

                >>

                >>     at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)

                >>

                >>     at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)

                >>

                >>     at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                >>

                >>     at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)

                >>

                >>     at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)

                >>

                >>     at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)

                >>

                >>     at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                >>

                >>     at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)

                >>

                >>     at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

                >>

                >>     at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)

                >>

                >>     at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

                >>

                >>     at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

                >>

                >>     at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

                >>

                >>     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)

                >>

                >>     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)

                >>

                >>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                >>

                >>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                >>

                >>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                >>

                >>     at java.lang.reflect.Method.invoke(Method.java:483)

                >>

                >>     at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)

                >>

                >>     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)

                >>

                >>     at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

                >>

                >>     at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

                >>

                >>

                >>

                >> Posted by forums

                >> Original post: https://developer.jboss.org/message/914532#914532

                >>

                >> _______________________________________________

                >> forge-users mailing list

                >> forge-users@lists.jboss.org

                >> https://lists.jboss.org/mailman/listinfo/forge-users

                 

                 

                --

                Daniel Cunha (soro)

                _______________________________________________

                forge-users mailing list

                forge-users@lists.jboss.org

                https://lists.jboss.org/mailman/listinfo/forge-users

                 

                • 5. Re: [forge-users] addon creation
                  George Gastaldi Master

                  There is an error in your code:

                  https://github.com/Fazerty/jbfex-addon/blob/master/src/main/java/org/jbfex/addon/commands/JbfexMailCommand.java#L129

                   

                  You are returning a null ProjectFactory, that's why the error happens.

                  _______________________________________________

                  forge-users mailing list

                  forge-users@lists.jboss.org

                  https://lists.jboss.org/mailman/listinfo/forge-users

                   

                  • 6. Re: [forge-users] addon creation
                    Daniel Cunha (soro) Novice

                    George,

                     

                    this case.. Can forge assume which that's is false? (Is a bad suggestion?)

                     

                    On Mon, Dec 29, 2014 at 4:00 PM, George Gastaldi <ggastald@redhat.com>

                    wrote:

                     

                    There is an error in your code:

                     

                    https://github.com/Fazerty/jbfex-addon/blob/master/src/main/java/org/jbfex/addon/commands/JbfexMailCommand.java#L129

                     

                    You are returning a null ProjectFactory, that's why the error happens.

                    _______________________________________________

                    forge-users mailing list

                    forge-users@lists.jboss.org

                    https://lists.jboss.org/mailman/listinfo/forge-users

                     

                     

                     

                     

                    --

                    Daniel Cunha (soro)

                     

                    • 7. Re: [forge-users] addon creation
                      George Gastaldi Master

                      I am sorry, I don't understand your idea, can you elaborate more?

                       

                       

                       

                      Em 29/12/2014, às 14:05, Daniel Cunha <danielsoro@gmail.com> escreveu:

                       

                      George,

                       

                      this case.. Can forge assume which that's is false? (Is a bad suggestion?)

                       

                      >> On Mon, Dec 29, 2014 at 4:00 PM, George Gastaldi <ggastald@redhat.com> wrote:

                      >> There is an error in your code:

                      >> https://github.com/Fazerty/jbfex-addon/blob/master/src/main/java/org/jbfex/addon/commands/JbfexMailCommand.java#L129

                      >>

                      >> You are returning a null ProjectFactory, that's why the error happens.

                      >> _______________________________________________

                      >> forge-users mailing list

                      >> forge-users@lists.jboss.org

                      >> https://lists.jboss.org/mailman/listinfo/forge-users

                       

                       

                      --

                      Daniel Cunha (soro)

                      _______________________________________________

                      forge-users mailing list

                      forge-users@lists.jboss.org

                      https://lists.jboss.org/mailman/listinfo/forge-users

                       

                      • 8. Re: [forge-users] addon creation
                        Daniel Cunha (soro) Novice

                        This method is an abstract method.

                         

                        So, it's very common that IDE's implement this method with return null.

                        In some languages if (null) == false.

                         

                        So, Forge can in this case interpret null == false.

                        I prefer that I receive a BANG! (as Antonio talking) NullPointerException.

                         

                        WDYT?

                         

                        On Mon, Dec 29, 2014 at 4:18 PM, George Gastaldi <ggastald@redhat.com>

                        wrote:

                         

                        I am sorry, I don't understand your idea, can you elaborate more?

                         

                        >

                         

                        Em 29/12/2014, às 14:05, Daniel Cunha <danielsoro@gmail.com> escreveu:

                         

                        George,

                         

                        this case.. Can forge assume which that's is false? (Is a bad suggestion?)

                         

                        On Mon, Dec 29, 2014 at 4:00 PM, George Gastaldi <ggastald@redhat.com>

                        wrote:

                         

                        >> There is an error in your code:

                        >>

                        >> https://github.com/Fazerty/jbfex-addon/blob/master/src/main/java/org/jbfex/addon/commands/JbfexMailCommand.java#L129

                        >>

                        >> You are returning a null ProjectFactory, that's why the error happens.

                        >> _______________________________________________

                        >> forge-users mailing list

                        >> forge-users@lists.jboss.org

                        >> https://lists.jboss.org/mailman/listinfo/forge-users

                        >>

                        >

                        >

                        --

                        Daniel Cunha (soro)

                         

                        _______________________________________________

                        forge-users mailing list

                        forge-users@lists.jboss.org

                        https://lists.jboss.org/mailman/listinfo/forge-users

                         

                        >

                        _______________________________________________

                        forge-users mailing list

                        forge-users@lists.jboss.org

                        https://lists.jboss.org/mailman/listinfo/forge-users

                         

                         

                         

                         

                        --

                        Daniel Cunha (soro)

                         

                        • 9. Re: [forge-users] addon creation
                          Daniel Cunha (soro) Novice

                          Oh..

                           

                          Sorry. I confuse the methods. Sorry! Forget this.

                           

                          On Mon, Dec 29, 2014 at 4:32 PM, Daniel Cunha <danielsoro@gmail.com> wrote:

                           

                          This method is an abstract method.

                           

                          So, it's very common that IDE's implement this method with return null.

                          In some languages if (null) == false.

                           

                          So, Forge can in this case interpret null == false.

                          I prefer that I receive a BANG! (as Antonio talking) NullPointerException.

                           

                          WDYT?

                           

                          On Mon, Dec 29, 2014 at 4:18 PM, George Gastaldi <ggastald@redhat.com>

                          wrote:

                           

                          >> I am sorry, I don't understand your idea, can you elaborate more?

                          >>

                          >>

                          >>

                          >> Em 29/12/2014, às 14:05, Daniel Cunha <danielsoro@gmail.com> escreveu:

                          >>

                          >> George,

                          >>

                          >> this case.. Can forge assume which that's is false? (Is a bad suggestion?)

                          >>

                          >> On Mon, Dec 29, 2014 at 4:00 PM, George Gastaldi <ggastald@redhat.com>

                          >> wrote:

                          >>

                          >>> There is an error in your code:

                          >>>

                          >>> https://github.com/Fazerty/jbfex-addon/blob/master/src/main/java/org/jbfex/addon/commands/JbfexMailCommand.java#L129

                          >>>

                          >>> You are returning a null ProjectFactory, that's why the error happens.

                          >>> _______________________________________________

                          >>> forge-users mailing list

                          >>> forge-users@lists.jboss.org

                          >>> https://lists.jboss.org/mailman/listinfo/forge-users

                          >>>

                          >>

                          >>

                          >>

                          >> --

                          >> Daniel Cunha (soro)

                          >>

                          >> _______________________________________________

                          >> forge-users mailing list

                          >> forge-users@lists.jboss.org

                          >> https://lists.jboss.org/mailman/listinfo/forge-users

                          >>

                          >>

                          >> _______________________________________________

                          >> forge-users mailing list

                          >> forge-users@lists.jboss.org

                          >> https://lists.jboss.org/mailman/listinfo/forge-users

                          >>

                          >

                          >

                          --

                          Daniel Cunha (soro)

                           

                           

                           

                           

                          --

                          Daniel Cunha (soro)

                           

                          • 10. Re: addon creation
                            fazertyplus Newbie

                            Thank you!

                            I generated the command with addon-new-ui-command --named JbfexMailCommand --commandName "Jbfex: mail" --categories "Example"

                            Then I changed the class to extend AbstractProjectCommand instead of AbstractUICommand and added the unimplemented methods automatically with eclipse and I didn't check these methods.

                             

                            To avoid this mistake in the future, is it possible to have a new function like addon-new-PROJECT-command that creates a class that extends AbstractProjectCommand?

                            • 11. Re: [forge-users] addon creation
                              Daniel Cunha (soro) Novice

                              Hi,

                               

                              try: addon-new-ui-command

                               

                              On Mon, Dec 29, 2014 at 5:28 PM, <forge-users@lists.jboss.org> wrote:

                               

                              Thank you!

                              I generated the command with *+addon-new-ui-command --named

                              JbfexMailCommand --commandName "Jbfex: mail" --categories "Example"+*

                              Then I changed the class to extend AbstractProjectCommand instead of

                              AbstractUICommand and added the unimplemented methods automatically with

                              eclipse and I didn't check these methods.

                               

                              To avoid this mistake in the future, is it possible to have a new function

                              like addon-new-PROJECT-command that create a class that extends

                              AbstractProjectCommand?

                               

                              Posted by forums

                              Original post: https://developer.jboss.org/message/914672#914672

                              _______________________________________________

                              forge-users mailing list

                              forge-users@lists.jboss.org

                              https://lists.jboss.org/mailman/listinfo/forge-users

                               

                               

                               

                               

                              --

                              Daniel Cunha (soro)

                               

                              • 12. Re: [forge-users] addon creation
                                George Gastaldi Master

                                That looks like a good idea. Wanna submit a pull-request?

                                 

                                Thanks!

                                 

                                 

                                 

                                Em 29/12/2014, às 15:29, forge-users@lists.jboss.org escreveu:

                                 

                                Thank you!

                                I generated the command with addon-new-ui-command --named JbfexMailCommand --commandName "Jbfex: mail" --categories "Example"

                                Then I changed the class to extend AbstractProjectCommand instead of AbstractUICommand and added the unimplemented methods automatically with eclipse and I didn't check these methods.

                                 

                                To avoid this mistake in the future, is it possible to have a new function like addon-new-PROJECT-command that create a class that extends AbstractProjectCommand?

                                 

                                Posted by forums

                                Original post: https://developer.jboss.org/message/914672#914672

                                _______________________________________________

                                forge-users mailing list

                                forge-users@lists.jboss.org

                                https://lists.jboss.org/mailman/listinfo/forge-users

                                 

                                _______________________________________________

                                forge-users mailing list

                                forge-users@lists.jboss.org

                                https://lists.jboss.org/mailman/listinfo/forge-users

                                 

                                 

                                • 13. Re: [forge-users] addon creation
                                  Daniel Cunha (soro) Novice

                                  Pff,

                                   

                                  Sorry.. I'm very lazy today! I'm reading all things wrong.

                                   

                                  On Mon, Dec 29, 2014 at 5:32 PM, Daniel Cunha <danielsoro@gmail.com> wrote:

                                   

                                  Hi,

                                   

                                  try: addon-new-ui-command

                                   

                                  On Mon, Dec 29, 2014 at 5:28 PM, <forge-users@lists.jboss.org> wrote:

                                   

                                  >> Thank you!

                                  >> I generated the command with *+addon-new-ui-command --named

                                  >> JbfexMailCommand --commandName "Jbfex: mail" --categories "Example"+*

                                  >> Then I changed the class to extend AbstractProjectCommand instead of

                                  >> AbstractUICommand and added the unimplemented methods automatically with

                                  >> eclipse and I didn't check these methods.

                                  >>

                                  >> To avoid this mistake in the future, is it possible to have a new

                                  >> function like addon-new-PROJECT-command that create a class that

                                  >> extends AbstractProjectCommand?

                                  >>

                                  >> Posted by forums

                                  >> Original post: https://developer.jboss.org/message/914672#914672

                                  >> _______________________________________________

                                  >> forge-users mailing list

                                  >> forge-users@lists.jboss.org

                                  >> https://lists.jboss.org/mailman/listinfo/forge-users

                                  >>

                                  >

                                  >

                                  --

                                  Daniel Cunha (soro)

                                   

                                   

                                   

                                   

                                  --

                                  Daniel Cunha (soro)