mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 14:37:13 -06:00
TextField: require JComponent for leading and trailing components (to allow setting a style class client property)
This commit is contained in:
@@ -18,9 +18,9 @@ package com.formdev.flatlaf.extras.components;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFormattedTextField;
|
||||
import com.formdev.flatlaf.extras.components.FlatTextField.SelectAllOnFocusPolicy;
|
||||
|
||||
@@ -91,8 +91,8 @@ public class FlatFormattedTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public Component getLeadingComponent() {
|
||||
return (Component) getClientProperty( TEXT_FIELD_LEADING_COMPONENT );
|
||||
public JComponent getLeadingComponent() {
|
||||
return (JComponent) getClientProperty( TEXT_FIELD_LEADING_COMPONENT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +110,7 @@ public class FlatFormattedTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public void setLeadingComponent( Component leadingComponent ) {
|
||||
public void setLeadingComponent( JComponent leadingComponent ) {
|
||||
putClientProperty( TEXT_FIELD_LEADING_COMPONENT, leadingComponent );
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ public class FlatFormattedTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public Component getTrailingComponent() {
|
||||
return (Component) getClientProperty( TEXT_FIELD_TRAILING_COMPONENT );
|
||||
public JComponent getTrailingComponent() {
|
||||
return (JComponent) getClientProperty( TEXT_FIELD_TRAILING_COMPONENT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ public class FlatFormattedTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public void setTrailingComponent( Component trailingComponent ) {
|
||||
public void setTrailingComponent( JComponent trailingComponent ) {
|
||||
putClientProperty( TEXT_FIELD_TRAILING_COMPONENT, trailingComponent );
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.formdev.flatlaf.extras.components;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JPasswordField;
|
||||
import com.formdev.flatlaf.extras.components.FlatTextField.SelectAllOnFocusPolicy;
|
||||
|
||||
@@ -91,8 +91,8 @@ public class FlatPasswordField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public Component getLeadingComponent() {
|
||||
return (Component) getClientProperty( TEXT_FIELD_LEADING_COMPONENT );
|
||||
public JComponent getLeadingComponent() {
|
||||
return (JComponent) getClientProperty( TEXT_FIELD_LEADING_COMPONENT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +110,7 @@ public class FlatPasswordField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public void setLeadingComponent( Component leadingComponent ) {
|
||||
public void setLeadingComponent( JComponent leadingComponent ) {
|
||||
putClientProperty( TEXT_FIELD_LEADING_COMPONENT, leadingComponent );
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ public class FlatPasswordField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public Component getTrailingComponent() {
|
||||
return (Component) getClientProperty( TEXT_FIELD_TRAILING_COMPONENT );
|
||||
public JComponent getTrailingComponent() {
|
||||
return (JComponent) getClientProperty( TEXT_FIELD_TRAILING_COMPONENT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ public class FlatPasswordField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public void setTrailingComponent( Component trailingComponent ) {
|
||||
public void setTrailingComponent( JComponent trailingComponent ) {
|
||||
putClientProperty( TEXT_FIELD_TRAILING_COMPONENT, trailingComponent );
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.formdev.flatlaf.extras.components;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
/**
|
||||
@@ -90,8 +90,8 @@ public class FlatTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public Component getLeadingComponent() {
|
||||
return (Component) getClientProperty( TEXT_FIELD_LEADING_COMPONENT );
|
||||
public JComponent getLeadingComponent() {
|
||||
return (JComponent) getClientProperty( TEXT_FIELD_LEADING_COMPONENT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ public class FlatTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public void setLeadingComponent( Component leadingComponent ) {
|
||||
public void setLeadingComponent( JComponent leadingComponent ) {
|
||||
putClientProperty( TEXT_FIELD_LEADING_COMPONENT, leadingComponent );
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ public class FlatTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public Component getTrailingComponent() {
|
||||
return (Component) getClientProperty( TEXT_FIELD_TRAILING_COMPONENT );
|
||||
public JComponent getTrailingComponent() {
|
||||
return (JComponent) getClientProperty( TEXT_FIELD_TRAILING_COMPONENT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ public class FlatTextField
|
||||
*
|
||||
* @since 2
|
||||
*/
|
||||
public void setTrailingComponent( Component trailingComponent ) {
|
||||
public void setTrailingComponent( JComponent trailingComponent ) {
|
||||
putClientProperty( TEXT_FIELD_TRAILING_COMPONENT, trailingComponent );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user