FlatWindowDecorationsTest: disable "add/remove/change menu" buttons if shown in dialog, which does not have a menubar

This commit is contained in:
Karl Tauber
2020-09-17 13:28:02 +02:00
parent 81d46ba8ee
commit 99be346387
2 changed files with 19 additions and 3 deletions

View File

@@ -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;

View File

@@ -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"