Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JEditableCheckBox paint a border in a color #6379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vdaburon
Copy link
Contributor

@vdaburon vdaburon commented Nov 5, 2024

JEditableCheckBox paint a border in a color (likes Very Light Blue) to help differentiation to Standard Checkbox (no border) and Editable Checkbox (with color border).

Description

JEditableCheckBox paint a border in a color (likes Very light blue)

Motivation and Context

Since 5.6.x some checkboxes could be change in an expression (right click on checkbox) but there is no external information to explains if the checkbox is "standard" or "expression compatible".

checkbox_editable

How Has This Been Tested?

Change border color to Orange, Blue and Very Light Blue (not standard color).

Use the "HTTP Request" as demo because some checkbox are standard checkbox and some checkbox are editable checkbox (Expression)

Screenshots (if appropriate):

Border Color.ORANGE

2024-11-05_checkbox_border_color_orange

Border Color.BLUE

2024-11-05_checkbox_border_color_blue

Border Color(51,204,255) Very Light Blue my prefered color

2024-11-05_checkbox_border_color_very_light_blue

Border Color(51,204,255) Very Light Blue in Darcula look and feel

2024-11-05_checkbox_border_color_very_light_blue_in_darcula

Types of changes

Checklist:

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

JEditableCheckBox paint a border in a color (likes Very light blue) to help differentiation to Standard Checkbox and Editable Checkbox.
@vdaburon
Copy link
Contributor Author

vdaburon commented Nov 5, 2024

Currently the color is hard coded in the Class with: Color(51,204,255) but
the border color could be a new JMeter property likes :
RGB Color:
JEditableCheckBox.border.color=51,204,255
or standard Color:
JEditableCheckBox.border.color=ORANGE

add a space after the comma to  be style compatible
@@ -105,6 +107,8 @@ public open class JEditableCheckBox(

private val checkbox: JCheckBox = JCheckBox(label).apply {
val cb = this
cb.setBorderPainted(true)
cb.setBorder(BorderFactory.createLineBorder(Color(51, 204, 255))) // Very light blue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have multiple color schemas, so I do not think hardcoding a color is the right thing to do.

Copy link
Contributor Author

@vdaburon vdaburon Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never write Kotlin code and i can't code correctly read property in jmeter.properties or user.properties with

var propBorderColor = JMeterUtils.getResStringDefault("JEditableCheckBox.border.color","51,204,255")

I get an error "Adding dependency on module 'jmeter.src.core.main' will introduce circular dependency between modules 'jmeter.src.core.main' and 'jmeter.src.jorphan.main'. Add dependency anyway?"

vlsi could you code this external configuration ?
the border color could be a new JMeter property likes :
RGB Color:
JEditableCheckBox.border.color=51,204,255
or standard Color:
JEditableCheckBox.border.color=ORANGE

Regards.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is that orange might not work for all the color themes, so it should be rather something like "accent color" which is declared separately for each look and feel. I am not sure if jmeter.properties can configure different values for different look and feels.

This makes adding new colors hard, so we should rather try reusing the existing color resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main question is how to distinguish a standard checkbox from a special JEditableCheckBox ?
I proposed to add a colored border but if you have another proposition.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the need to mark the expression-supporting checkboxes?
Imagine we will support expressions in all the checkboxes. Why highlight all of them in the UI?

Copy link
Contributor Author

@vdaburon vdaburon Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some checkbox are standards some not and you don’t know except when you right click on the checkbox. No documentation explains that you could modify the checkbox value with an expression. I think is important to visually know the nature of the checkbox (standard or Editable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants