mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
JIDE: JideTabbedPane: fixed location of tab title editing box
This commit is contained in:
@@ -503,6 +503,13 @@ public class FlatJideTabbedPaneUI
|
|||||||
super.layoutLabel( tabPlacement, metrics, tabIndex, title, icon, tabRect, iconRect, textRect, isSelected );
|
super.layoutLabel( tabPlacement, metrics, tabIndex, title, icon, tabRect, iconRect, textRect, isSelected );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Rectangle getTabsTextBoundsAt( int tabIndex ) {
|
||||||
|
Rectangle rect = super.getTabsTextBoundsAt( tabIndex );
|
||||||
|
rect.x += getTabInsets( _tabPane.getTabPlacement(), tabIndex ).left;
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isLastInRun( int tabIndex ) {
|
private boolean isLastInRun( int tabIndex ) {
|
||||||
int run = getRunForTab( _tabPane.getTabCount(), tabIndex );
|
int run = getRunForTab( _tabPane.getTabCount(), tabIndex );
|
||||||
return lastTabInRun( _tabPane.getTabCount(), run ) == tabIndex;
|
return lastTabInRun( _tabPane.getTabCount(), run ) == tabIndex;
|
||||||
|
|||||||
@@ -376,6 +376,13 @@ public class FlatJideOssContainerTest
|
|||||||
tabbedPane.setShowGripper( showGripper );
|
tabbedPane.setShowGripper( showGripper );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void tabEditingAllowedChanged() {
|
||||||
|
boolean tabEditingAllowed = tabEditingAllowedCheckBox.isSelected();
|
||||||
|
|
||||||
|
for( JideTabbedPane tabbedPane : allTabbedPanes )
|
||||||
|
tabbedPane.setTabEditingAllowed( tabEditingAllowed );
|
||||||
|
}
|
||||||
|
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||||
JPanel panel9 = new JPanel();
|
JPanel panel9 = new JPanel();
|
||||||
@@ -414,6 +421,7 @@ public class FlatJideOssContainerTest
|
|||||||
smallerInsetsCheckBox = new JCheckBox();
|
smallerInsetsCheckBox = new JCheckBox();
|
||||||
showGripperCheckBox = new JCheckBox();
|
showGripperCheckBox = new JCheckBox();
|
||||||
showTabSeparatorsCheckBox = new JCheckBox();
|
showTabSeparatorsCheckBox = new JCheckBox();
|
||||||
|
tabEditingAllowedCheckBox = new JCheckBox();
|
||||||
hideTabAreaWithOneTabCheckBox = new JCheckBox();
|
hideTabAreaWithOneTabCheckBox = new JCheckBox();
|
||||||
CellConstraints cc = new CellConstraints();
|
CellConstraints cc = new CellConstraints();
|
||||||
|
|
||||||
@@ -618,6 +626,11 @@ public class FlatJideOssContainerTest
|
|||||||
showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged());
|
showTabSeparatorsCheckBox.addActionListener(e -> showTabSeparatorsChanged());
|
||||||
tabbedPaneControlPanel.add(showTabSeparatorsCheckBox, "cell 1 9");
|
tabbedPaneControlPanel.add(showTabSeparatorsCheckBox, "cell 1 9");
|
||||||
|
|
||||||
|
//---- tabEditingAllowedCheckBox ----
|
||||||
|
tabEditingAllowedCheckBox.setText("Tab editing allowed");
|
||||||
|
tabEditingAllowedCheckBox.addActionListener(e -> tabEditingAllowedChanged());
|
||||||
|
tabbedPaneControlPanel.add(tabEditingAllowedCheckBox, "cell 0 10");
|
||||||
|
|
||||||
//---- hideTabAreaWithOneTabCheckBox ----
|
//---- hideTabAreaWithOneTabCheckBox ----
|
||||||
hideTabAreaWithOneTabCheckBox.setText("Hide tab area with one tab");
|
hideTabAreaWithOneTabCheckBox.setText("Hide tab area with one tab");
|
||||||
hideTabAreaWithOneTabCheckBox.addActionListener(e -> hideTabAreaWithOneTabChanged());
|
hideTabAreaWithOneTabCheckBox.addActionListener(e -> hideTabAreaWithOneTabChanged());
|
||||||
@@ -661,6 +674,7 @@ public class FlatJideOssContainerTest
|
|||||||
private JCheckBox smallerInsetsCheckBox;
|
private JCheckBox smallerInsetsCheckBox;
|
||||||
private JCheckBox showGripperCheckBox;
|
private JCheckBox showGripperCheckBox;
|
||||||
private JCheckBox showTabSeparatorsCheckBox;
|
private JCheckBox showTabSeparatorsCheckBox;
|
||||||
|
private JCheckBox tabEditingAllowedCheckBox;
|
||||||
private JCheckBox hideTabAreaWithOneTabCheckBox;
|
private JCheckBox hideTabAreaWithOneTabCheckBox;
|
||||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
|
|
||||||
|
|||||||
@@ -357,6 +357,16 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 9"
|
"value": "cell 1 9"
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
|
name: "tabEditingAllowedCheckBox"
|
||||||
|
"text": "Tab editing allowed"
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabEditingAllowedChanged", false ) )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 10"
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "hideTabAreaWithOneTabCheckBox"
|
name: "hideTabAreaWithOneTabCheckBox"
|
||||||
"text": "Hide tab area with one tab"
|
"text": "Hide tab area with one tab"
|
||||||
|
|||||||
Reference in New Issue
Block a user