mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
FlatDefaultsAddon: added default implementation to getDefaults() because most subclasses use the same implementation
This commit is contained in:
@@ -16,26 +16,17 @@
|
||||
|
||||
package com.formdev.flatlaf.swingx;
|
||||
|
||||
import java.io.InputStream;
|
||||
import com.formdev.flatlaf.FlatDefaultsAddon;
|
||||
|
||||
/**
|
||||
* SwingX addon for FlatLaf.
|
||||
* <p>
|
||||
* Finds SwingX addon .properties file for the given LaF class
|
||||
* in the same package as this class.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatSwingXDefaultsAddon
|
||||
extends FlatDefaultsAddon
|
||||
{
|
||||
/**
|
||||
* Finds SwingX addon .properties file for the given LaF class
|
||||
* in the same package as this class.
|
||||
*/
|
||||
@Override
|
||||
public InputStream getDefaults( Class<?> lafClass ) {
|
||||
Class<?> addonClass = this.getClass();
|
||||
String propertiesName = "/" + addonClass.getPackage().getName().replace( '.', '/' )
|
||||
+ '/' + lafClass.getSimpleName() + ".properties";
|
||||
return addonClass.getResourceAsStream( propertiesName );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user