From b3e9d82537902e246c38578102220eb4f67dcb90 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 19 Oct 2019 09:36:43 +0200 Subject: [PATCH] SwingX: added SwingX LaF addon (#8) --- .../flatlaf/swingx/FlatLookAndFeelAddons.java | 38 +++++++++++++++++++ ...org.jdesktop.swingx.plaf.LookAndFeelAddons | 1 + 2 files changed, 39 insertions(+) create mode 100644 flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/FlatLookAndFeelAddons.java create mode 100644 flatlaf-swingx/src/main/resources/META-INF/services/org.jdesktop.swingx.plaf.LookAndFeelAddons diff --git a/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/FlatLookAndFeelAddons.java b/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/FlatLookAndFeelAddons.java new file mode 100644 index 00000000..4d31b2c0 --- /dev/null +++ b/flatlaf-swingx/src/main/java/com/formdev/flatlaf/swingx/FlatLookAndFeelAddons.java @@ -0,0 +1,38 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.swingx; + +import javax.swing.UIManager; +import org.jdesktop.swingx.plaf.basic.BasicLookAndFeelAddons; +import com.formdev.flatlaf.FlatLaf; + +/** + * SwingX LaF addon. + * + * This class is required because without this class, the system addon would be used, + * which may result in wrong UI defaults. (e.g. background of TaskPaneContainer) + * + * @author Karl Tauber + */ +public class FlatLookAndFeelAddons + extends BasicLookAndFeelAddons +{ + @Override + protected boolean matches() { + return UIManager.getLookAndFeel() instanceof FlatLaf; + } +} diff --git a/flatlaf-swingx/src/main/resources/META-INF/services/org.jdesktop.swingx.plaf.LookAndFeelAddons b/flatlaf-swingx/src/main/resources/META-INF/services/org.jdesktop.swingx.plaf.LookAndFeelAddons new file mode 100644 index 00000000..2401de9d --- /dev/null +++ b/flatlaf-swingx/src/main/resources/META-INF/services/org.jdesktop.swingx.plaf.LookAndFeelAddons @@ -0,0 +1 @@ +com.formdev.flatlaf.swingx.FlatLookAndFeelAddons