Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8200285

TabDragPolicy.REORDER prevents ContextMenu from showing

    XMLWordPrintable

Details

    • x86_64
    • linux

    Description

      FULL PRODUCT VERSION :
      java version "10" 2018-03-20
      Java(TM) SE Runtime Environment 18.3 (build 10+46)
      Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux glen 4.15.10-300.fc27.x86_64 #1 SMP Thu Mar 15 17:13:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When the TabDragPolicy of a TabPane is set to TabDragPolicy.REORDER any ContextMenu that has been set on the tabs doesn't show up. It seems one should be allowed to have draggable tabs as well as context menus on the tabs.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      set a TabPane drag policy to "reorder"
      set a contextMenu on the member tabs


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It is expected that the context menu would show even if the tabs a reorderable
      ACTUAL -
      The context menu doesn't show up when tabs are reorderable

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.ContextMenu;
      import javafx.scene.control.MenuItem;
      import javafx.scene.control.Tab;
      import javafx.scene.control.TabPane;
      import javafx.scene.layout.BorderPane;
      import javafx.stage.Stage;

      public class GuiTest extends Application
      {
          @Override
          public void start(Stage stage)
          {
              ContextMenu cmenu = new ContextMenu(new MenuItem("hello"), new MenuItem("goodbye"));
              Tab tab = new Tab("one");
              tab.setContextMenu(cmenu);
              TabPane tabPane=new TabPane(tab);
              tabPane.setTabDragPolicy(TabPane.TabDragPolicy.REORDER); //comment this line to allow context menu to show

              BorderPane bp = new BorderPane(tabPane);
              Scene scene=new Scene(bp);
              stage.setTitle("TabTest");
              stage.setWidth(450);
              stage.setHeight(550);

              stage.setScene(scene);
              stage.show();
          }
      }
      ---------- END SOURCE ----------

      Attachments

        1. GuiTest.java
          1.0 kB
          Priyanka Mangal

        Issue Links

          Activity

            People

              arapte Ambarish Rapte
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: