@@ -215,8 +215,10 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
215215 toggleGoldenMenuItemText .set (Boolean .parseBoolean (item .getValue ().getProperty ("golden" )) ? Messages .contextMenuRemoveGoldenTag : Messages .contextMenuTagAsGolden );
216216 toggleGoldenImageViewProperty .set (Boolean .parseBoolean (item .getValue ().getProperty ("golden" )) ? snapshotImageView : snapshotGoldenImageView );
217217 }
218- if (me .getClickCount () == 2 ) {
219- nodeDoubleClicked (browserSelectionModel .getSelectedItems ().get (0 ).getValue ());
218+ // Check if a tab has already been opened for this node.
219+ boolean highlighted = highlightTab (item .getValue ().getUniqueId ());
220+ if (!highlighted && me .getClickCount () == 2 ) {
221+ nodeDoubleClicked (item .getValue ());
220222 }
221223 });
222224
@@ -550,13 +552,6 @@ public void nodeDoubleClicked(){
550552 */
551553 private void nodeDoubleClicked (Node node ) {
552554
553- // Disallow opening a tab multiple times for the same save set.
554- for (Tab tab : tabPane .getTabs ()) {
555- if (tab .getId () != null && tab .getId ().equals (node .getUniqueId ())) {
556- return ;
557- }
558- }
559-
560555 Tab tab ;
561556
562557 switch (node .getNodeType ()) {
@@ -576,6 +571,16 @@ private void nodeDoubleClicked(Node node) {
576571 tabPane .getSelectionModel ().select (tab );
577572 }
578573
574+ private boolean highlightTab (String id ){
575+ for (Tab tab : tabPane .getTabs ()) {
576+ if (tab .getId () != null && tab .getId ().equals (id )) {
577+ tabPane .getSelectionModel ().select (tab );
578+ return true ;
579+ }
580+ }
581+ return false ;
582+ }
583+
579584 /**
580585 * Creates a new save set in the selected tree node.
581586 */
0 commit comments