Re: [GitHub] jmeter pull request #364: let GUI component (dynamically) decide whether it ...

2017-12-30 Thread Peter Doornbosch
Thanks guys.

2017-12-29 15:32 GMT+01:00 asfgit :
> Github user asfgit closed the pull request at:
>
> https://github.com/apache/jmeter/pull/364
>
>
> ---


[GitHub] jmeter pull request #364: let GUI component (dynamically) decide whether it ...

2017-12-29 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/jmeter/pull/364


---


[GitHub] jmeter pull request #364: let GUI component (dynamically) decide whether it ...

2017-12-21 Thread ham1
Github user ham1 commented on a diff in the pull request:

https://github.com/apache/jmeter/pull/364#discussion_r158429468
  
--- Diff: src/core/org/apache/jmeter/gui/util/MenuInfo.java ---
@@ -74,4 +75,16 @@ public String getClassName(){
 public int getSortOrder() {
 return sortOrder;
 }
+
+/**
+ * Returns whether the menu item represented by this MenuInfo object 
should be enabled
+ * @param actionCommandthe action command name for the menu item
+ * @return true when menu item should be enabled, false otherwise.
+ */
+public boolean getEnabled(String actionCommand) {
+if (ActionNames.ADD.equals(actionCommand))
--- End diff --

Please use braces. Checkstyle should pick this up.


---


[GitHub] jmeter pull request #364: let GUI component (dynamically) decide whether it ...

2017-12-21 Thread ptrd
GitHub user ptrd opened a pull request:

https://github.com/apache/jmeter/pull/364

let GUI component (dynamically) decide whether it can be added via th…

…e menu or not; the menu item will be enabled/disabled accordingly.

## Description
Added the ability to have menu items for GUI components dynamically 
disabled/enabled.
The question whether a specific test element can be added (to the testplan) 
is delegated to the corresponding GUI component.

## Motivation and Context
In my websocket plugin 
(https://bitbucket.org/pjtr/jmeter-websocket-samplers), i have a config element 
that enables the user to configure specific (advanced) properties of the plugin 
(previously, this was done via JMeter properties, which is of course 
cumbersome). To avoid funny behaviour in the plugin and to avoid confusion of 
the user, such a config element should only be added once.

## How Has This Been Tested?
I tested it with my websocket plugin, see 
https://bitbucket.org/pjtr/jmeter-websocket-samplers/commits/branch/limit-number-of-advanced-options-element

## Screenshots (if appropriate):

## Types of changes

- New feature (non-breaking change which adds functionality)

## Checklist:


- [ x] My code follows the [code style][style-guide] of this project.
- [ ] I have updated the documentation accordingly.

[style-guide]: https://wiki.apache.org/jmeter/CodeStyleGuidelines


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ptrd/jmeter dynamic-add-menu

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jmeter/pull/364.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #364


commit 72fccd5a6771565ffade43cce41763c3bc2df52f
Author: Peter Doornbosch 
Date:   2017-12-21T21:00:21Z

let GUI component (dynamically) decide whether it can be added via the menu 
or not; the menu item will be enabled/disabled accordingly.




---