You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by NaveenKumar <ca...@gmail.com> on 2022/03/12 17:15:06 UTC

Adding a button to the Toolbar

Hi Team,

I am new to the JMeter core/plugin development ecosystem. I am trying to add a button to the toolbar. 

Here is my repo [https://github.com/QAInsights/validate-thread-group]. But it is not displaying any option either in the menu or in the toolbar. 

Could someone guide me, please?

Thank you!

Re: Adding a button to the Toolbar

Posted by Milamber <mi...@apache.org>.
For record, the source of icons in JMeter toolbar is: 
https://sourceforge.net/projects/openiconlibrary/


On 13/03/2022 10:14, Milamber wrote:
>
>
> On 13/03/2022 03:11, NaveenKumar wrote:
>> I was able to add the validate thread group action to the toolbar 
>> using the below properties in icons-toolbar.properties file.
>>
>> But it is not picking up the custom icon from the `bin` directory. If 
>> I give the path as 
>> `org/apache/jmeter/images/toolbar/<SIZE>/document-new-4.png` it is 
>> displaying the icon and validate is working fine.
>>
>> Is there a way to map the custom icon? Any inputs, please?
>
>
> You need to put the icon files (3 sizes) in this directory:
> ./src/core/src/main/resources/org/apache/jmeter/images/toolbar/(22x22 
> 32x32  48x48)/
>
> After, build JMeter. You can find your new icons into 
> /lib/ext/ApacheJMeter_core.jar
>
>
>>
>> toolbar=new,templates,open,save,|,undo,redo,cut,copy,paste,|,expand,collapse,toggle,|,test_start,test_start_notimers,test_stop,test_shutdown,validate_tg,|,test_clear,test_clear_all,|,search,search_reset,|,function_helper,help 
>>
>>
>>
>> validate_tg=validate,VALIDATE_TG,validate.png
>>
>>
>> Thank you
>>
>> On 3/12/2022 12:15:20 PM, NaveenKumar <ca...@gmail.com> 
>> wrote:
>> Hi Team,
>>
>> I am new to the JMeter core/plugin development ecosystem. I am trying 
>> to add a button to the toolbar.
>>
>> Here is my repo 
>> [https://github.com/QAInsights/validate-thread-group]. But it is not 
>> displaying any option either in the menu or in the toolbar.
>>
>> Could someone guide me, please?
>>
>> Thank you!
>
>


Re: Adding a button to the Toolbar

Posted by NaveenKumar <ca...@gmail.com>.
Thanks Milamber and Felix for your inputs.

Felix,

I did try mapping the properties and the icon file path in the icons-toolbar.properties.

validate_tg=validate,VALIDATE_TG,validate.png


JMeter is picking up the properties but not mapping the icon file. In debug log, I can see `there is no icon found`.

I developed own plugin to address my needs; plugin is now available in the JMeter Plugins repo [https://github.com/QAInsights/validate-thread-group]. 

Thank you
On 3/13/2022 7:10:27 AM, Felix Schumacher <fe...@internetallee.de> wrote:

Am 13.03.22 um 10:14 schrieb Milamber:



On 13/03/2022 03:11, NaveenKumar wrote:

I was able to add the validate thread group action to the toolbar using the below properties in icons-toolbar.properties file.

But it is not picking up the custom icon from the `bin` directory. If I give the path as `org/apache/jmeter/images/toolbar/<SIZE>/document-new-4.png` it is displaying the icon and validate is working fine.

Is there a way to map the custom icon? Any inputs, please?



You need to put the icon files (3 sizes) in this directory:
./src/core/src/main/resources/org/apache/jmeter/images/toolbar/(22x22 32x32 48x48)/

After, build JMeter. You can find your new icons into /lib/ext/ApacheJMeter_core.jar

If I read the code at JMeterToolBar#getIconsMappings() right, you can add custom images for the buttons by providing your own properties file (look at icons-toolbar.properties for the format) and let the JMeter property jmeter.toolbar.icons point to it.
But even if it is working (haven't tested it), it feels cumbersome for third party plugin developers. If this is really the only way to extend the toolbar icons, it would make a good enhancement, don't you think?
And it seems, that you can use SVGs instead of PNGs, too.
Felix




toolbar=new,templates,open,save,|,undo,redo,cut,copy,paste,|,expand,collapse,toggle,|,test_start,test_start_notimers,test_stop,test_shutdown,validate_tg,|,test_clear,test_clear_all,|,search,search_reset,|,function_helper,help


validate_tg=validate,VALIDATE_TG,validate.png


Thank you

On 3/12/2022 12:15:20 PM, NaveenKumar <ca...@gmail.com> [mailto:catchnaveen.psgtech@gmail.com] wrote:
Hi Team,

I am new to the JMeter core/plugin development ecosystem. I am trying to add a button to the toolbar.

Here is my repo [https://github.com/QAInsights/validate-thread-group [https://github.com/QAInsights/validate-thread-group]]. But it is not displaying any option either in the menu or in the toolbar.

Could someone guide me, please?

Thank you!


Re: Adding a button to the Toolbar

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 13.03.22 um 10:14 schrieb Milamber:
>
>
> On 13/03/2022 03:11, NaveenKumar wrote:
>> I was able to add the validate thread group action to the toolbar 
>> using the below properties in icons-toolbar.properties file.
>>
>> But it is not picking up the custom icon from the `bin` directory. If 
>> I give the path as 
>> `org/apache/jmeter/images/toolbar/<SIZE>/document-new-4.png` it is 
>> displaying the icon and validate is working fine.
>>
>> Is there a way to map the custom icon? Any inputs, please?
>
>
> You need to put the icon files (3 sizes) in this directory:
> ./src/core/src/main/resources/org/apache/jmeter/images/toolbar/(22x22 
> 32x32  48x48)/
>
> After, build JMeter. You can find your new icons into 
> /lib/ext/ApacheJMeter_core.jar

If I read the code at JMeterToolBar#getIconsMappings() right, you can 
add custom images for the buttons by providing your own properties file 
(look at icons-toolbar.properties for the format) and let the JMeter 
property jmeter.toolbar.icons point to it.

But even if it is working (haven't tested it), it feels cumbersome for 
third party plugin developers. If this is really the only way to extend 
the toolbar icons, it would make a good enhancement, don't you think?

And it seems, that you can use SVGs instead of PNGs, too.

Felix

>
>
>>
>> toolbar=new,templates,open,save,|,undo,redo,cut,copy,paste,|,expand,collapse,toggle,|,test_start,test_start_notimers,test_stop,test_shutdown,validate_tg,|,test_clear,test_clear_all,|,search,search_reset,|,function_helper,help 
>>
>>
>>
>> validate_tg=validate,VALIDATE_TG,validate.png
>>
>>
>> Thank you
>>
>> On 3/12/2022 12:15:20 PM, NaveenKumar <ca...@gmail.com> 
>> wrote:
>> Hi Team,
>>
>> I am new to the JMeter core/plugin development ecosystem. I am trying 
>> to add a button to the toolbar.
>>
>> Here is my repo 
>> [https://github.com/QAInsights/validate-thread-group]. But it is not 
>> displaying any option either in the menu or in the toolbar.
>>
>> Could someone guide me, please?
>>
>> Thank you!
>

Re: Adding a button to the Toolbar

Posted by Milamber <mi...@apache.org>.

On 13/03/2022 03:11, NaveenKumar wrote:
> I was able to add the validate thread group action to the toolbar using the below properties in icons-toolbar.properties file.
>
> But it is not picking up the custom icon from the `bin` directory. If I give the path as `org/apache/jmeter/images/toolbar/<SIZE>/document-new-4.png` it is displaying the icon and validate is working fine.
>
> Is there a way to map the custom icon? Any inputs, please?


You need to put the icon files (3 sizes) in this directory:
./src/core/src/main/resources/org/apache/jmeter/images/toolbar/(22x22 
32x32  48x48)/

After, build JMeter. You can find your new icons into 
/lib/ext/ApacheJMeter_core.jar


>
> toolbar=new,templates,open,save,|,undo,redo,cut,copy,paste,|,expand,collapse,toggle,|,test_start,test_start_notimers,test_stop,test_shutdown,validate_tg,|,test_clear,test_clear_all,|,search,search_reset,|,function_helper,help
>
>
> validate_tg=validate,VALIDATE_TG,validate.png
>
>
> Thank you
>
> On 3/12/2022 12:15:20 PM, NaveenKumar <ca...@gmail.com> wrote:
> Hi Team,
>
> I am new to the JMeter core/plugin development ecosystem. I am trying to add a button to the toolbar.
>
> Here is my repo [https://github.com/QAInsights/validate-thread-group]. But it is not displaying any option either in the menu or in the toolbar.
>
> Could someone guide me, please?
>
> Thank you!


Re: Adding a button to the Toolbar

Posted by NaveenKumar <ca...@gmail.com>.
I was able to add the validate thread group action to the toolbar using the below properties in icons-toolbar.properties file. 

But it is not picking up the custom icon from the `bin` directory. If I give the path as `org/apache/jmeter/images/toolbar/<SIZE>/document-new-4.png` it is displaying the icon and validate is working fine.

Is there a way to map the custom icon? Any inputs, please? 

toolbar=new,templates,open,save,|,undo,redo,cut,copy,paste,|,expand,collapse,toggle,|,test_start,test_start_notimers,test_stop,test_shutdown,validate_tg,|,test_clear,test_clear_all,|,search,search_reset,|,function_helper,help


validate_tg=validate,VALIDATE_TG,validate.png


Thank you

On 3/12/2022 12:15:20 PM, NaveenKumar <ca...@gmail.com> wrote:
Hi Team,

I am new to the JMeter core/plugin development ecosystem. I am trying to add a button to the toolbar. 

Here is my repo [https://github.com/QAInsights/validate-thread-group]. But it is not displaying any option either in the menu or in the toolbar. 

Could someone guide me, please?

Thank you!