Skip to content

Commit

Permalink
Refactor method names in UIUtil class
Browse files Browse the repository at this point in the history
The method names 'clickOnNode' in the UIUtil class were renamed to 'isClickOnNode' to improve readability and understandability, since these methods return a boolean. The code where these methods are called was also updated to reflect this change.
  • Loading branch information
leewyatt committed Jun 12, 2024
1 parent 246b50f commit 660cbb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public EnhancedPasswordField() {
StackPane rightWrapper = new StackPane(rightIcon);
rightWrapper.getStyleClass().add("right-icon-wrapper");
rightWrapper.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
if (UIUtil.clickOnNode(event)) {
if (UIUtil.isClickOnNode(event)) {
setShowPassword(!isShowPassword());
event.consume();
}
Expand Down
6 changes: 3 additions & 3 deletions gemsfx/src/main/java/com/dlsc/gemsfx/util/UIUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ public static void copyToClipboard(String copyContent) {
* @return {@code true} if the event is a single stable primary button click, {@code false} otherwise.
* @throws NullPointerException if the event is null.
*/
public static boolean clickOnNode(MouseEvent event) {
return clickOnNode(event, false);
public static boolean isClickOnNode(MouseEvent event) {
return isClickOnNode(event, false);
}

/**
Expand All @@ -228,7 +228,7 @@ public static boolean clickOnNode(MouseEvent event) {
*
* @throws IllegalArgumentException if the event is not a mouse clicked event.
*/
public static boolean clickOnNode(MouseEvent event, boolean isSingleClick) {
public static boolean isClickOnNode(MouseEvent event, boolean isSingleClick) {
if (event.getEventType() != MouseEvent.MOUSE_CLICKED) {
throw new IllegalArgumentException("The event must be a mouse clicked event.");
// return false;
Expand Down

0 comments on commit 660cbb4

Please sign in to comment.