Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make swingx/MaterialTaskPaneUI optional #199

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/main/java/mdlaf/MaterialLookAndFeel.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public class MaterialLookAndFeel extends MetalLookAndFeel {
private static final String separatorUI = MaterialSeparatorUI.class.getCanonicalName();
private static final String fileChooserUI = MaterialFileChooserUI.class.getCanonicalName();
private static final String toolTipUI = MaterialToolTipUI.class.getCanonicalName();
private static final String taskPaneUI = MaterialTaskPaneUI.class.getCanonicalName();
vincenzopalazzo marked this conversation as resolved.
Show resolved Hide resolved
private static final String taskPaneUI;
private static final String formattedTextFieldUI =
MaterialFormattedTextFieldUI.class.getCanonicalName();
private static final String listUI = MaterialListUI.class.getCanonicalName();
Expand All @@ -125,6 +125,16 @@ public class MaterialLookAndFeel extends MetalLookAndFeel {
private static final String colorChooserUI = MaterialColorChooser.class.getCanonicalName();
private static final String splitPaneUI = MaterialSplitPaneUI.class.getCanonicalName();

static {
String taskPaneUIName = null;
try {
taskPaneUIName = MaterialTaskPaneUI.class.getCanonicalName();
} catch (NoClassDefFoundError ignored) {
// Swingx is not in the classpath
}
taskPaneUI = taskPaneUIName;
}

public static void changeTheme(MaterialTheme theme) {
if (theme == null) {
return;
Expand Down Expand Up @@ -235,7 +245,9 @@ protected void initClassDefaults(UIDefaults table) {
table.put("SplitPaneUI", splitPaneUI);
table.put("ColorChooserUI", colorChooserUI);
// java swingx
table.put("swingx/TaskPaneUI", taskPaneUI);
if (taskPaneUI != null) {
table.put("swingx/TaskPaneUI", taskPaneUI);
}
}

@Override
Expand Down
Loading