mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
FlatWindowDecorationsTest: disable "add/remove/change menu" buttons if shown in dialog, which does not have a menubar
This commit is contained in:
@@ -78,6 +78,10 @@ public class FlatWindowDecorationsTest
|
||||
menuBarEmbeddedCheckBox.setEnabled( window instanceof JFrame );
|
||||
maximizedBoundsCheckBox.setEnabled( window instanceof Frame );
|
||||
|
||||
addMenuButton.setEnabled( menuBarCheckBox.isEnabled() );
|
||||
removeMenuButton.setEnabled( menuBarCheckBox.isEnabled() );
|
||||
changeMenuButton.setEnabled( menuBarCheckBox.isEnabled() );
|
||||
|
||||
boolean windowHasIcons = (window != null && !window.getIconImages().isEmpty());
|
||||
iconNoneRadioButton.setEnabled( windowHasIcons );
|
||||
iconTestAllRadioButton.setEnabled( windowHasIcons );
|
||||
@@ -246,9 +250,9 @@ public class FlatWindowDecorationsTest
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
menuBarCheckBox = new JCheckBox();
|
||||
JButton addMenuButton = new JButton();
|
||||
JButton removeMenuButton = new JButton();
|
||||
JButton changeMenuButton = new JButton();
|
||||
addMenuButton = new JButton();
|
||||
removeMenuButton = new JButton();
|
||||
changeMenuButton = new JButton();
|
||||
menuBarEmbeddedCheckBox = new JCheckBox();
|
||||
resizableCheckBox = new JCheckBox();
|
||||
maximizedBoundsCheckBox = new JCheckBox();
|
||||
@@ -652,6 +656,9 @@ public class FlatWindowDecorationsTest
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JCheckBox menuBarCheckBox;
|
||||
private JButton addMenuButton;
|
||||
private JButton removeMenuButton;
|
||||
private JButton changeMenuButton;
|
||||
private JCheckBox menuBarEmbeddedCheckBox;
|
||||
private JCheckBox resizableCheckBox;
|
||||
private JCheckBox maximizedBoundsCheckBox;
|
||||
|
||||
@@ -26,6 +26,9 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "addMenuButton"
|
||||
"text": "Add menu"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "addMenu", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0 1 2,align left top,grow 0 0"
|
||||
@@ -33,6 +36,9 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "removeMenuButton"
|
||||
"text": "Remove menu"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "removeMenu", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0 1 2,align left top,grow 0 0"
|
||||
@@ -40,6 +46,9 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "changeMenuButton"
|
||||
"text": "Change menu"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "changeMenu", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0 1 2,align left top,grow 0 0"
|
||||
|
||||
Reference in New Issue
Block a user