diff --git a/flatlaf-jide-oss/build.gradle.kts b/flatlaf-jide-oss/build.gradle.kts new file mode 100644 index 00000000..478a15e1 --- /dev/null +++ b/flatlaf-jide-oss/build.gradle.kts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +version = rootProject.version + +plugins { + `java-library` +} + +dependencies { + implementation( project( ":flatlaf-core" ) ) + implementation( "com.jidesoft:jide-oss:3.6.18" ) +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} diff --git a/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/FlatJideOssDefaultsAddon.java b/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/FlatJideOssDefaultsAddon.java new file mode 100644 index 00000000..70f968c2 --- /dev/null +++ b/flatlaf-jide-oss/src/main/java/com/formdev/flatlaf/jideoss/FlatJideOssDefaultsAddon.java @@ -0,0 +1,41 @@ +/* + * 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.jideoss; + +import java.io.InputStream; +import com.formdev.flatlaf.FlatDefaultsAddon; + +/** + * JIDE Common Layer addon for FlatLaf. + * + * @author Karl Tauber + */ +public class FlatJideOssDefaultsAddon + extends FlatDefaultsAddon +{ + /** + * Finds JIDE Common Layer 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 ); + } +} diff --git a/flatlaf-jide-oss/src/main/resources/META-INF/services/com.formdev.flatlaf.FlatDefaultsAddon b/flatlaf-jide-oss/src/main/resources/META-INF/services/com.formdev.flatlaf.FlatDefaultsAddon new file mode 100644 index 00000000..4728dea8 --- /dev/null +++ b/flatlaf-jide-oss/src/main/resources/META-INF/services/com.formdev.flatlaf.FlatDefaultsAddon @@ -0,0 +1 @@ +com.formdev.flatlaf.jideoss.FlatJideOssDefaultsAddon diff --git a/settings.gradle.kts b/settings.gradle.kts index 26cdae3e..b168f8cb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,5 +19,6 @@ rootProject.name = "FlatLaf" include( "flatlaf-core" ) include( "flatlaf-extras" ) include( "flatlaf-swingx" ) +include( "flatlaf-jide-oss" ) include( "flatlaf-demo" ) include( "flatlaf-testing" )