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

disabled tabs in a inner tabpane show like enabled

    XMLWordPrintable

Details

    • x86
    • windows_8

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_40"
      Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]

      A DESCRIPTION OF THE PROBLEM :
      If an inner tabpane has disabled tabs and the outer tabpane has a disabled tab which include the inner tabpane and the tab from the outer tabpane will be enabled, then are the tabs in the inner tabpane disabled, but they show like enabled.

      For a example see "Steps to Reproduce"

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      First Click on the disable-button and then click on the enable-button
      and you will see the Problem.

      see "Source code for an executable test case"



      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package test;

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Tab;
      import javafx.scene.control.TabPane;
      import javafx.scene.control.TabPane.TabClosingPolicy;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class Test extends Application {

          @Override
          public void start( final Stage primaryStage ) throws Exception {
              final BorderPane pane = new BorderPane();
              final TabPane tabPane = new TabPane();
              tabPane.setTabClosingPolicy( TabClosingPolicy.UNAVAILABLE );

              tabPane.getTabs().add( new Tab( "Tab A" ) );
              tabPane.getTabs().add( new Tab( "Tab B" ) );
              tabPane.getTabs().add( new Tab( "Tab C" ) );

              pane.setCenter( tabPane );

              /////////////////////////////////////////////////////

              final TabPane innerTabPane = new TabPane();
              innerTabPane.setTabClosingPolicy( TabClosingPolicy.UNAVAILABLE );

              innerTabPane.getTabs().add( new Tab( "Tab 1" ) );
              innerTabPane.getTabs().add( new Tab( "Tab 2" ) );
              innerTabPane.getTabs().add( new Tab( "Tab 3" ) );
              innerTabPane.getTabs().add( new Tab( "Tab 4" ) );
              innerTabPane.getTabs().add( new Tab( "Tab 5" ) );

              tabPane.getTabs().get( 1 ).setContent( innerTabPane );

              /////////////////////////////////////////////////////

              innerTabPane.getTabs().get( 2 ).setDisable( true );
              innerTabPane.getTabs().get( 3 ).setDisable( true );

              /////////////////////////////////////////////////////

              final HBox box = new HBox();
              final Button disable = new Button( "Disable" );
              final Button enable = new Button( "Enable" );
              box.getChildren().addAll( disable, enable );
              box.setSpacing( 5 );
              box.setPadding( new Insets( 5 ) );
              pane.setBottom( box );

              /////////////////////////////////////////////////////

              disable.setOnAction( event -> tabPane.getTabs().get( 1 ).setDisable( true ) );
              enable.setOnAction( event -> tabPane.getTabs().get( 1 ).setDisable( false ) );

              /////////////////////////////////////////////////////

              primaryStage.setScene( new Scene( pane ) );
              primaryStage.setWidth( 800 );
              primaryStage.setHeight( 600 );
              primaryStage.show();
          }

          public static void main( final String[] args ) {
              launch( args );
          }
      }
      ---------- END SOURCE ----------

      SUPPORT :
      YES

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: