Styling: catch runtime exceptions while applying styles (and log them) to avoid that wrong/invalid styles could result in "damaged" UI

This commit is contained in:
Karl Tauber
2021-09-25 19:34:46 +02:00
parent 1c067d0284
commit 3d8c535ffa
30 changed files with 177 additions and 30 deletions

View File

@@ -51,6 +51,7 @@ import com.formdev.flatlaf.icons.FlatHelpButtonIcon;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -270,7 +271,11 @@ public class FlatButtonUI
/** @since 2 */
protected void installStyle( AbstractButton b ) {
applyStyle( b, FlatStylingSupport.getResolvedStyle( b, getStyleType() ) );
try {
applyStyle( b, FlatStylingSupport.getResolvedStyle( b, getStyleType() ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -28,6 +28,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JCheckBoxMenuItem}.
@@ -103,7 +104,11 @@ public class FlatCheckBoxMenuItemUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "CheckBoxMenuItem" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "CheckBoxMenuItem" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -72,6 +72,7 @@ import javax.swing.plaf.basic.ComboPopup;
import javax.swing.text.JTextComponent;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.SystemInfo;
/**
@@ -452,7 +453,11 @@ public class FlatComboBoxUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( comboBox, "ComboBox" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( comboBox, "ComboBox" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -35,6 +35,7 @@ import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JEditorPane}.
@@ -174,7 +175,11 @@ public class FlatEditorPaneUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), "EditorPane" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), "EditorPane" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -38,6 +38,7 @@ import javax.swing.plaf.basic.BasicInternalFrameUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableBorder;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JInternalFrame}.
@@ -154,7 +155,11 @@ public class FlatInternalFrameUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( frame, "InternalFrame" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( frame, "InternalFrame" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -39,6 +39,7 @@ import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -133,7 +134,11 @@ public class FlatLabelUI
/** @since 2 */
protected void installStyle( JLabel c ) {
applyStyle( c, FlatStylingSupport.getResolvedStyle( c, "Label" ) );
try {
applyStyle( c, FlatStylingSupport.getResolvedStyle( c, "Label" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -30,6 +30,7 @@ import javax.swing.plaf.basic.BasicListUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JList}.
@@ -162,7 +163,11 @@ public class FlatListUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( list, "List" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( list, "List" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -42,6 +42,7 @@ import javax.swing.plaf.basic.BasicMenuBarUI;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.SystemInfo;
/**
@@ -138,7 +139,11 @@ public class FlatMenuBarUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( menuBar, "MenuBar" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( menuBar, "MenuBar" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -29,6 +29,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicMenuItemUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JMenuItem}.
@@ -104,7 +105,11 @@ public class FlatMenuItemUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "MenuItem" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "MenuItem" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -38,6 +38,7 @@ import javax.swing.plaf.MenuBarUI;
import javax.swing.plaf.basic.BasicMenuUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JMenu}.
@@ -150,7 +151,11 @@ public class FlatMenuUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "Menu" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "Menu" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -23,6 +23,7 @@ import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicPopupMenuUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JPopupMenu}.
@@ -81,7 +82,11 @@ public class FlatPopupMenuUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( popupMenu, "PopupMenu" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( popupMenu, "PopupMenu" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -35,6 +35,7 @@ import javax.swing.plaf.basic.BasicProgressBarUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -132,7 +133,11 @@ public class FlatProgressBarUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( progressBar, "ProgressBar" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( progressBar, "ProgressBar" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -28,6 +28,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JRadioButtonMenuItem}.
@@ -103,7 +104,11 @@ public class FlatRadioButtonMenuItemUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "RadioButtonMenuItem" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( menuItem, "RadioButtonMenuItem" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -39,6 +39,7 @@ import com.formdev.flatlaf.icons.FlatCheckBoxIcon;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -149,7 +150,11 @@ public class FlatRadioButtonUI
/** @since 2 */
protected void installStyle( AbstractButton b ) {
applyStyle( b, FlatStylingSupport.getResolvedStyle( b, getStyleType() ) );
try {
applyStyle( b, FlatStylingSupport.getResolvedStyle( b, getStyleType() ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -39,6 +39,7 @@ import javax.swing.plaf.basic.BasicScrollBarUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -223,7 +224,11 @@ public class FlatScrollBarUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( scrollbar, "ScrollBar" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( scrollbar, "ScrollBar" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -49,6 +49,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicScrollPaneUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JScrollPane}.
@@ -304,7 +305,11 @@ public class FlatScrollPaneUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( scrollpane, "ScrollPane" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( scrollpane, "ScrollPane" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -30,6 +30,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSeparatorUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JSeparator}.
@@ -134,7 +135,11 @@ public class FlatSeparatorUI
/** @since 2 */
protected void installStyle( JSeparator s ) {
applyStyle( s, FlatStylingSupport.getResolvedStyle( s, getStyleType() ) );
try {
applyStyle( s, FlatStylingSupport.getResolvedStyle( s, getStyleType() ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -42,6 +42,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -194,7 +195,11 @@ public class FlatSliderUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( slider, "Slider" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( slider, "Slider" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -47,6 +47,7 @@ import javax.swing.plaf.basic.BasicSpinnerUI;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JSpinner}.
@@ -192,7 +193,11 @@ public class FlatSpinnerUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( spinner, "Spinner" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( spinner, "Spinner" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -37,6 +37,7 @@ import javax.swing.plaf.basic.BasicSplitPaneUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -139,7 +140,11 @@ public class FlatSplitPaneUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( splitPane, "SplitPane" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( splitPane, "SplitPane" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -506,7 +506,9 @@ public class FlatStylingSupport
* @throws UnknownStyleException if object does not have a annotated field with given name
* @throws IllegalArgumentException if value type does not fit to expected type
*/
public static Object applyToAnnotatedObjectOrComponent( Object obj, Object comp, String key, Object value ) {
public static Object applyToAnnotatedObjectOrComponent( Object obj, Object comp, String key, Object value )
throws UnknownStyleException, IllegalArgumentException
{
try {
return applyToAnnotatedObject( obj, key, value );
} catch( UnknownStyleException ex ) {

View File

@@ -93,6 +93,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.Animator;
import com.formdev.flatlaf.util.CubicBezierEasing;
import com.formdev.flatlaf.util.JavaCompatibility;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.StringUtils;
import com.formdev.flatlaf.util.UIScale;
@@ -574,7 +575,11 @@ public class FlatTabbedPaneUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( tabPane, "TabbedPane" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( tabPane, "TabbedPane" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -43,6 +43,7 @@ import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -142,7 +143,11 @@ public class FlatTableHeaderUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( header, "TableHeader" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( header, "TableHeader" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -41,6 +41,7 @@ import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.SystemInfo;
import com.formdev.flatlaf.util.UIScale;
@@ -238,7 +239,11 @@ public class FlatTableUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( table, "Table" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( table, "Table" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -32,6 +32,7 @@ import javax.swing.plaf.basic.BasicTextAreaUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextArea}.
@@ -148,7 +149,11 @@ public class FlatTextAreaUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), "TextArea" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), "TextArea" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -47,6 +47,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.JavaCompatibility;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextField}.
@@ -229,7 +230,11 @@ public class FlatTextFieldUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), getStyleType() ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), getStyleType() ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -32,6 +32,7 @@ import javax.swing.plaf.basic.BasicTextPaneUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JTextPane}.
@@ -156,7 +157,11 @@ public class FlatTextPaneUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), "TextPane" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( getComponent(), "TextPane" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -33,6 +33,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarSeparatorUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JToolBar.Separator}.
@@ -130,7 +131,11 @@ public class FlatToolBarSeparatorUI
/** @since 2 */
protected void installStyle( JSeparator s ) {
applyStyle( FlatStylingSupport.getResolvedStyle( s, "ToolBarSeparator" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( s, "ToolBarSeparator" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -31,6 +31,7 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarUI;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
/**
* Provides the Flat LaF UI delegate for {@link javax.swing.JToolBar}.
@@ -138,7 +139,11 @@ public class FlatToolBarUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( toolBar, "ToolBar" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( toolBar, "ToolBar" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */

View File

@@ -42,6 +42,7 @@ import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreePath;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.UIScale;
/**
@@ -312,7 +313,11 @@ public class FlatTreeUI
/** @since 2 */
protected void installStyle() {
applyStyle( FlatStylingSupport.getResolvedStyle( tree, "Tree" ) );
try {
applyStyle( FlatStylingSupport.getResolvedStyle( tree, "Tree" ) );
} catch( RuntimeException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
/** @since 2 */