2222import javax .swing .border .*;
2323import com .formdev .flatlaf .FlatClientProperties ;
2424import com .formdev .flatlaf .FlatLaf ;
25+ import com .formdev .flatlaf .extras .components .FlatTabbedPane .TabType ;
2526import com .formdev .flatlaf .icons .FlatInternalFrameCloseIcon ;
2627import com .formdev .flatlaf .testing .*;
2728import com .formdev .flatlaf .testing .FlatTestFrame ;
@@ -47,6 +48,8 @@ public static void main( String[] args ) {
4748 FlatJideOssContainerTest () {
4849 initComponents ();
4950
51+ tabTypeComboBox .init ( TabType .class , true );
52+
5053 tabPlacementField .init ( TabPlacement .class , true );
5154 tabAlignmentField .init ( JideTabAlignment .class , false );
5255 tabResizeModeField .init ( JideTabResizeMode .class , true );
@@ -281,6 +284,12 @@ private void tabResizeModeChanged() {
281284 tabbedPane .setTabResizeMode ( resizeMode );
282285 }
283286
287+ private void tabTypeChanged () {
288+ TabType value = tabTypeComboBox .getSelectedValue ();
289+ for ( JideTabbedPane tabbedPane : allTabbedPanes )
290+ tabbedPane .putClientProperty ( FlatClientProperties .TABBED_PANE_TAB_TYPE , (value != null ) ? value .toString () : null );
291+ }
292+
284293 private void tabBackForegroundChanged () {
285294 for ( JTabbedPane tabbedPane : allTabbedPanes )
286295 tabBackForegroundChanged ( tabbedPane );
@@ -434,6 +443,8 @@ private void initComponents() {
434443 tabAlignmentField = new FlatTestEnumSelector <>();
435444 JLabel tabResizeModeLabel = new JLabel ();
436445 tabResizeModeField = new FlatTestEnumSelector <>();
446+ JLabel tabTypeLabel = new JLabel ();
447+ tabTypeComboBox = new FlatTestEnumSelector <>();
437448 leadingComponentCheckBox = new JCheckBox ();
438449 customBorderCheckBox = new JCheckBox ();
439450 tabAreaInsetsCheckBox = new JCheckBox ();
@@ -501,6 +512,7 @@ private void initComponents() {
501512 "[]" +
502513 "[]" +
503514 "[]" +
515+ "[]" +
504516 "[]para" +
505517 "[]" +
506518 "[]para" +
@@ -605,65 +617,73 @@ private void initComponents() {
605617 tabResizeModeField .addActionListener (e -> tabResizeModeChanged ());
606618 tabbedPaneControlPanel .add (tabResizeModeField , "cell 2 5" );
607619
620+ //---- tabTypeLabel ----
621+ tabTypeLabel .setText ("Tab type:" );
622+ tabbedPaneControlPanel .add (tabTypeLabel , "cell 0 6" );
623+
624+ //---- tabTypeComboBox ----
625+ tabTypeComboBox .addActionListener (e -> tabTypeChanged ());
626+ tabbedPaneControlPanel .add (tabTypeComboBox , "cell 1 6" );
627+
608628 //---- leadingComponentCheckBox ----
609629 leadingComponentCheckBox .setText ("Leading component" );
610630 leadingComponentCheckBox .addActionListener (e -> leadingComponentChanged ());
611- tabbedPaneControlPanel .add (leadingComponentCheckBox , "cell 0 6 " );
631+ tabbedPaneControlPanel .add (leadingComponentCheckBox , "cell 0 7 " );
612632
613633 //---- customBorderCheckBox ----
614634 customBorderCheckBox .setText ("Custom border" );
615635 customBorderCheckBox .addActionListener (e -> customBorderChanged ());
616- tabbedPaneControlPanel .add (customBorderCheckBox , "cell 1 6 " );
636+ tabbedPaneControlPanel .add (customBorderCheckBox , "cell 1 7 " );
617637
618638 //---- tabAreaInsetsCheckBox ----
619639 tabAreaInsetsCheckBox .setText ("Tab area insets (5,5,10,10)" );
620640 tabAreaInsetsCheckBox .addActionListener (e -> tabAreaInsetsChanged ());
621- tabbedPaneControlPanel .add (tabAreaInsetsCheckBox , "cell 2 6 " );
641+ tabbedPaneControlPanel .add (tabAreaInsetsCheckBox , "cell 2 7 " );
622642
623643 //---- trailingComponentCheckBox ----
624644 trailingComponentCheckBox .setText ("Trailing component" );
625645 trailingComponentCheckBox .addActionListener (e -> trailingComponentChanged ());
626- tabbedPaneControlPanel .add (trailingComponentCheckBox , "cell 0 7 " );
646+ tabbedPaneControlPanel .add (trailingComponentCheckBox , "cell 0 8 " );
627647
628648 //---- hasFullBorderCheckBox ----
629649 hasFullBorderCheckBox .setText ("Show content border" );
630650 hasFullBorderCheckBox .addActionListener (e -> hasFullBorderChanged ());
631- tabbedPaneControlPanel .add (hasFullBorderCheckBox , "cell 1 7 ,alignx left,growx 0" );
651+ tabbedPaneControlPanel .add (hasFullBorderCheckBox , "cell 1 8 ,alignx left,growx 0" );
632652
633653 //---- boldActiveTabCheckBox ----
634654 boldActiveTabCheckBox .setText ("Bold active tab" );
635655 boldActiveTabCheckBox .addActionListener (e -> boldActiveTabChanged ());
636- tabbedPaneControlPanel .add (boldActiveTabCheckBox , "cell 0 8 " );
656+ tabbedPaneControlPanel .add (boldActiveTabCheckBox , "cell 0 9 " );
637657
638658 //---- showTabButtonsCheckBox ----
639659 showTabButtonsCheckBox .setText ("Show tab buttons always" );
640660 showTabButtonsCheckBox .addActionListener (e -> showTabButtonsChanged ());
641- tabbedPaneControlPanel .add (showTabButtonsCheckBox , "cell 1 8 " );
661+ tabbedPaneControlPanel .add (showTabButtonsCheckBox , "cell 1 9 " );
642662
643663 //---- smallerInsetsCheckBox ----
644664 smallerInsetsCheckBox .setText ("Smaller tab insets (2,2,2,2)" );
645665 smallerInsetsCheckBox .addActionListener (e -> smallerInsetsChanged ());
646- tabbedPaneControlPanel .add (smallerInsetsCheckBox , "cell 2 8 " );
666+ tabbedPaneControlPanel .add (smallerInsetsCheckBox , "cell 2 9 " );
647667
648668 //---- showGripperCheckBox ----
649669 showGripperCheckBox .setText ("Show gripper" );
650670 showGripperCheckBox .addActionListener (e -> showGripperChanged ());
651- tabbedPaneControlPanel .add (showGripperCheckBox , "cell 0 9 " );
671+ tabbedPaneControlPanel .add (showGripperCheckBox , "cell 0 10 " );
652672
653673 //---- showTabSeparatorsCheckBox ----
654674 showTabSeparatorsCheckBox .setText ("Show tab separators" );
655675 showTabSeparatorsCheckBox .addActionListener (e -> showTabSeparatorsChanged ());
656- tabbedPaneControlPanel .add (showTabSeparatorsCheckBox , "cell 1 9 " );
676+ tabbedPaneControlPanel .add (showTabSeparatorsCheckBox , "cell 1 10 " );
657677
658678 //---- tabEditingAllowedCheckBox ----
659679 tabEditingAllowedCheckBox .setText ("Tab editing allowed" );
660680 tabEditingAllowedCheckBox .addActionListener (e -> tabEditingAllowedChanged ());
661- tabbedPaneControlPanel .add (tabEditingAllowedCheckBox , "cell 0 10 " );
681+ tabbedPaneControlPanel .add (tabEditingAllowedCheckBox , "cell 0 11 " );
662682
663683 //---- hideTabAreaWithOneTabCheckBox ----
664684 hideTabAreaWithOneTabCheckBox .setText ("Hide tab area with one tab" );
665685 hideTabAreaWithOneTabCheckBox .addActionListener (e -> hideTabAreaWithOneTabChanged ());
666- tabbedPaneControlPanel .add (hideTabAreaWithOneTabCheckBox , "cell 1 10 " );
686+ tabbedPaneControlPanel .add (hideTabAreaWithOneTabCheckBox , "cell 1 11 " );
667687 }
668688 panel9 .add (tabbedPaneControlPanel , cc .xywh (1 , 7 , 3 , 1 ));
669689 }
@@ -694,6 +714,7 @@ private void initComponents() {
694714 private JCheckBox showCloseButtonOnMouseOverCheckBox ;
695715 private FlatTestEnumSelector <JideTabAlignment > tabAlignmentField ;
696716 private FlatTestEnumSelector <JideTabResizeMode > tabResizeModeField ;
717+ private FlatTestEnumSelector <TabType > tabTypeComboBox ;
697718 private JCheckBox leadingComponentCheckBox ;
698719 private JCheckBox customBorderCheckBox ;
699720 private JCheckBox tabAreaInsetsCheckBox ;
0 commit comments