mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
JIDE: JidePopupMenu:
- added test to FlatJideOssTest - updated README.md and CHANGELOG.md (PR #246)
This commit is contained in:
@@ -3,6 +3,10 @@ FlatLaf Change Log
|
||||
|
||||
## 1.0-rc2-SNAPSHOT
|
||||
|
||||
#### New features and improvements
|
||||
|
||||
- JIDE Common Layer: Support `JidePopupMenu`.
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- CheckBox and RadioButton: Fill component background as soon as background
|
||||
|
||||
@@ -6,6 +6,7 @@ This addon for FlatLaf adds support for **some**
|
||||
|
||||
Following JIDE Common Layer components are currently supported by this addon:
|
||||
|
||||
- `JidePopupMenu`
|
||||
- `JideTabbedPane`
|
||||
- `RangeSlider`
|
||||
- `TristateCheckBox`
|
||||
|
||||
@@ -84,18 +84,27 @@ public class FlatJideOssTest
|
||||
}
|
||||
}
|
||||
|
||||
private void showJidePopupButtonActionPerformed( ActionEvent e ) {
|
||||
private void showJidePopup( ActionEvent e ) {
|
||||
Component invoker = (Component) e.getSource();
|
||||
|
||||
JPanel panel = new JPanel( new MigLayout() );
|
||||
panel.add( new JLabel( "Name:") );
|
||||
panel.add( new JTextField( 20 ) );
|
||||
|
||||
JidePopup popupMenu = new JidePopup();
|
||||
popupMenu.add( panel );
|
||||
popupMenu.setDetached( true );
|
||||
popupMenu.setOwner( invoker );
|
||||
popupMenu.showPopup();
|
||||
JidePopup popup = new JidePopup();
|
||||
popup.add( panel );
|
||||
popup.setDetached( true );
|
||||
popup.setOwner( invoker );
|
||||
popup.showPopup();
|
||||
}
|
||||
|
||||
private void showJidePopupMenu( ActionEvent e ) {
|
||||
Component invoker = (Component) e.getSource();
|
||||
|
||||
JidePopupMenu popupMenu = new JidePopupMenu();
|
||||
for( int i = 1; i <= 100; i++ )
|
||||
popupMenu.add( "menu item " + i );
|
||||
popupMenu.show( invoker, 0, invoker.getHeight() );
|
||||
}
|
||||
|
||||
private void tristateCheckBox1Changed() {
|
||||
@@ -139,6 +148,8 @@ public class FlatJideOssTest
|
||||
JPanel panel10 = new JPanel();
|
||||
JLabel jidePopupLabel = new JLabel();
|
||||
JButton showJidePopupButton = new JButton();
|
||||
JLabel jidePopupMenuLabel = new JLabel();
|
||||
JButton showJidePopupMenuButton = new JButton();
|
||||
JLabel label9 = new JLabel();
|
||||
tristateCheckBox1 = new TristateCheckBox();
|
||||
triStateLabel1 = new JLabel();
|
||||
@@ -314,6 +325,7 @@ public class FlatJideOssTest
|
||||
"[fill]",
|
||||
// rows
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]"));
|
||||
|
||||
//---- jidePopupLabel ----
|
||||
@@ -322,22 +334,31 @@ public class FlatJideOssTest
|
||||
|
||||
//---- showJidePopupButton ----
|
||||
showJidePopupButton.setText("show JidePopup");
|
||||
showJidePopupButton.addActionListener(e -> showJidePopupButtonActionPerformed(e));
|
||||
showJidePopupButton.addActionListener(e -> showJidePopup(e));
|
||||
panel10.add(showJidePopupButton, "cell 1 0");
|
||||
|
||||
//---- jidePopupMenuLabel ----
|
||||
jidePopupMenuLabel.setText("JidePopupMenu:");
|
||||
panel10.add(jidePopupMenuLabel, "cell 0 1");
|
||||
|
||||
//---- showJidePopupMenuButton ----
|
||||
showJidePopupMenuButton.setText("show JidePopupMenu");
|
||||
showJidePopupMenuButton.addActionListener(e -> showJidePopupMenu(e));
|
||||
panel10.add(showJidePopupMenuButton, "cell 1 1");
|
||||
|
||||
//---- label9 ----
|
||||
label9.setText("TristateCheckBox:");
|
||||
panel10.add(label9, "cell 0 1");
|
||||
panel10.add(label9, "cell 0 2");
|
||||
|
||||
//---- tristateCheckBox1 ----
|
||||
tristateCheckBox1.setText("three states");
|
||||
tristateCheckBox1.addActionListener(e -> tristateCheckBox1Changed());
|
||||
panel10.add(tristateCheckBox1, "cell 1 1");
|
||||
panel10.add(tristateCheckBox1, "cell 1 2");
|
||||
|
||||
//---- triStateLabel1 ----
|
||||
triStateLabel1.setText("text");
|
||||
triStateLabel1.setEnabled(false);
|
||||
panel10.add(triStateLabel1, "cell 2 1");
|
||||
panel10.add(triStateLabel1, "cell 2 2");
|
||||
}
|
||||
panel9.add(panel10, cc.xy(1, 9));
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ new FormModel {
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "insets 3 0 3 3,hidemode 3"
|
||||
"$columnConstraints": "[fill][fill][fill]"
|
||||
"$rowConstraints": "[][]"
|
||||
"$rowConstraints": "[][][]"
|
||||
} ) {
|
||||
name: "panel10"
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
@@ -207,15 +207,28 @@ new FormModel {
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "showJidePopupButton"
|
||||
"text": "show JidePopup"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopupButtonActionPerformed", true ) )
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopup", true ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "jidePopupMenuLabel"
|
||||
"text": "JidePopupMenu:"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "showJidePopupMenuButton"
|
||||
"text": "show JidePopupMenu"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopupMenu", true ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label9"
|
||||
"text": "TristateCheckBox:"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
add( new FormComponent( "com.jidesoft.swing.TristateCheckBox" ) {
|
||||
name: "tristateCheckBox1"
|
||||
@@ -225,7 +238,7 @@ new FormModel {
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tristateCheckBox1Changed", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "triStateLabel1"
|
||||
@@ -235,7 +248,7 @@ new FormModel {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1"
|
||||
"value": "cell 2 2"
|
||||
} )
|
||||
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
||||
"gridY": 9
|
||||
|
||||
Reference in New Issue
Block a user