2 Replies Latest reply on Mar 25, 2016 11:31 AM by gastaldi

    How to "report" to the user in an add-on ?

    clement.escoffier

      Hello,

       

      I'm building an add-on and I would like to know what's the best way to "report" to the user. Report in the sense of notifying the user of what's going on. Right know I'm using System.out, but I'm not sure it's the right way.

       

      Second (related) question, what's the best way for an add on to log messages ?

       

      Thanks,

        • 1. Re: How to "report" to the user in an add-on ?
          jim.riley

          I am a newbie, but you might try using the ProgressMonitor

           

          @Override

            public Result execute(UIExecutionContext context) throws Exception {

            ProgressMonitor progressMonitor = context.getProgressMonitor();

            int numberOfWorkItems = 3

            progressMonitor.beginTask("Do stuff", numberOfWorkItems );

               progressMonitor.subTask("optional subtask  ");

               // finished one item

               progressMonitor.worked(1);

               // finished another item

               progressMonitor.worked(1);

                progressMonitor.subTask("another subtask  ");

              // finished the third and for my example the last item.

              progressMonitor.worked(1);

          progressMonitor.done();

          • 2. Re: How to "report" to the user in an add-on ?
            gastaldi

            That's right Jim. This is the best way to display progress when executing a command.