From d1bbb3cb52f153b677c6652335ba51273fc4c605 Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Tue, 6 Nov 2018 15:43:56 +0100 Subject: [PATCH] fix bug where listener got registered twice --- .../java/gearth/ui/extensions/ExtensionItemContainer.java | 2 -- G-Earth/src/main/java/gearth/ui/extensions/Extensions.java | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/G-Earth/src/main/java/gearth/ui/extensions/ExtensionItemContainer.java b/G-Earth/src/main/java/gearth/ui/extensions/ExtensionItemContainer.java index 92193f1..7474c49 100644 --- a/G-Earth/src/main/java/gearth/ui/extensions/ExtensionItemContainer.java +++ b/G-Earth/src/main/java/gearth/ui/extensions/ExtensionItemContainer.java @@ -79,10 +79,8 @@ public class ExtensionItemContainer extends GridPane { Tooltip delete = new Tooltip("Close connection with this extension"); Tooltip.install(exitButton,delete); exitButton.show(); - exitButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isRemoveClickTrigger()); clickButton = new SimpleClickButton(); clickButton.show(); - clickButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.isClickTrigger()); buttonsBox = new HBox(clickButton, exitButton); diff --git a/G-Earth/src/main/java/gearth/ui/extensions/Extensions.java b/G-Earth/src/main/java/gearth/ui/extensions/Extensions.java index decd089..074236e 100644 --- a/G-Earth/src/main/java/gearth/ui/extensions/Extensions.java +++ b/G-Earth/src/main/java/gearth/ui/extensions/Extensions.java @@ -291,9 +291,7 @@ public class Extensions extends SubForm { e.printStackTrace(); } }); - extension.onClick(observable -> { - extension.sendMessage(new HPacket(OUTGOING_MESSAGES_IDS.ONDOUBLECLICK)); - }); + extension.onClick(observable -> extension.sendMessage(new HPacket(OUTGOING_MESSAGES_IDS.ONDOUBLECLICK))); Platform.runLater(() -> producer.extensionConnected(extension)); }