mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
TextField: added "clear" button to theme editor find/replace and to UI defaults inspector
This commit is contained in:
@@ -43,6 +43,7 @@ import javax.swing.table.AbstractTableModel;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.extras.components.FlatTextField;
|
||||
import com.formdev.flatlaf.icons.FlatAbstractIcon;
|
||||
import com.formdev.flatlaf.ui.FlatBorder;
|
||||
import com.formdev.flatlaf.ui.FlatEmptyBorder;
|
||||
@@ -557,7 +558,7 @@ public class FlatUIDefaultsInspector
|
||||
panel = new JPanel();
|
||||
filterPanel = new JPanel();
|
||||
flterLabel = new JLabel();
|
||||
filterField = new JTextField();
|
||||
filterField = new FlatTextField();
|
||||
valueTypeLabel = new JLabel();
|
||||
valueTypeField = new JComboBox<>();
|
||||
scrollPane = new JScrollPane();
|
||||
@@ -588,7 +589,8 @@ public class FlatUIDefaultsInspector
|
||||
new Insets(0, 0, 0, 10), 0, 0));
|
||||
|
||||
//---- filterField ----
|
||||
filterField.putClientProperty("JTextField.placeholderText", "enter one or more filter strings, separated by space characters");
|
||||
filterField.setPlaceholderText("enter one or more filter strings, separated by space characters");
|
||||
filterField.setShowClearButton(true);
|
||||
filterPanel.add(filterField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
|
||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||
new Insets(0, 0, 0, 10), 0, 0));
|
||||
@@ -667,7 +669,7 @@ public class FlatUIDefaultsInspector
|
||||
private JPanel panel;
|
||||
private JPanel filterPanel;
|
||||
private JLabel flterLabel;
|
||||
private JTextField filterField;
|
||||
private FlatTextField filterField;
|
||||
private JLabel valueTypeLabel;
|
||||
private JComboBox<String> valueTypeField;
|
||||
private JScrollPane scrollPane;
|
||||
|
||||
@@ -20,9 +20,10 @@ new FormModel {
|
||||
"labelFor": new FormReference( "filterField" )
|
||||
"displayedMnemonic": 70
|
||||
}, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) )
|
||||
add( new FormComponent( "javax.swing.JTextField" ) {
|
||||
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatTextField" ) {
|
||||
name: "filterField"
|
||||
"$client.JTextField.placeholderText": "enter one or more filter strings, separated by space characters"
|
||||
"placeholderText": "enter one or more filter strings, separated by space characters"
|
||||
"showClearButton": true
|
||||
}, new FormLayoutConstraints( class com.jformdesigner.runtime.GridBagConstraintsEx ) {
|
||||
"gridx": 1
|
||||
} )
|
||||
|
||||
@@ -304,6 +304,7 @@ class FlatFindReplaceBar
|
||||
//---- findField ----
|
||||
findField.setColumns(16);
|
||||
findField.setSelectAllOnFocusPolicy(FlatTextField.SelectAllOnFocusPolicy.always);
|
||||
findField.setShowClearButton(true);
|
||||
findField.addActionListener(e -> find());
|
||||
add(findField, "cell 1 0");
|
||||
|
||||
@@ -365,6 +366,7 @@ class FlatFindReplaceBar
|
||||
//---- replaceField ----
|
||||
replaceField.setColumns(16);
|
||||
replaceField.setSelectAllOnFocusPolicy(FlatTextField.SelectAllOnFocusPolicy.always);
|
||||
replaceField.setShowClearButton(true);
|
||||
add(replaceField, "cell 1 1");
|
||||
|
||||
//======== toolBar1 ========
|
||||
|
||||
@@ -22,6 +22,7 @@ new FormModel {
|
||||
name: "findField"
|
||||
"columns": 16
|
||||
"selectAllOnFocusPolicy": enum com.formdev.flatlaf.extras.components.FlatTextField$SelectAllOnFocusPolicy always
|
||||
"showClearButton": true
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "find", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
@@ -91,6 +92,7 @@ new FormModel {
|
||||
name: "replaceField"
|
||||
"columns": 16
|
||||
"selectAllOnFocusPolicy": enum com.formdev.flatlaf.extras.components.FlatTextField$SelectAllOnFocusPolicy always
|
||||
"showClearButton": true
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
|
||||
Reference in New Issue
Block a user