-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from SchweinchenFuntik/kotlin_1.4
added support Kotlin 1.4
- Loading branch information
Showing
21 changed files
with
274 additions
and
158 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import org.jetbrains.intellij.tasks.RunIdeTask | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
import org.jetbrains.intellij.tasks.PatchPluginXmlTask | ||
import org.jetbrains.intellij.tasks.PublishTask | ||
|
||
plugins { | ||
idea apply true | ||
java | ||
kotlin("jvm") version "1.4.0" | ||
id("org.jetbrains.intellij") version "0.4.21" | ||
} | ||
|
||
group = "no.tornado" | ||
version = "1.7.20" | ||
|
||
val publishUsername: String by rootProject.extra | ||
val publishPassword: String by rootProject.extra | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
intellij { | ||
version = "2020.2" | ||
//updateSinceUntilBuild = false | ||
setPlugins("java", "properties", "org.jetbrains.kotlin:1.4.0-release-IJ2020.2-1") | ||
} | ||
|
||
tasks { | ||
// withType<PatchPluginXmlTask> { } | ||
|
||
withType<PublishTask> { | ||
username(publishUsername) | ||
password(publishPassword) | ||
} | ||
|
||
withType<JavaCompile> { | ||
sourceCompatibility = "1.8" | ||
targetCompatibility = "1.8" | ||
} | ||
|
||
withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
109 changes: 0 additions & 109 deletions
109
src/main/java/no/tornado/tornadofx/idea/TornadoFXConfigurable.java
This file was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
src/main/kotlin/no/tornado/tornadofx/idea/TornadoFXConfigurable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package no.tornado.tornadofx.idea | ||
|
||
import com.intellij.openapi.options.SearchableConfigurable | ||
import com.intellij.ui.HyperlinkAdapter | ||
import com.intellij.ui.HyperlinkLabel | ||
import java.awt.Desktop | ||
import java.io.IOException | ||
import java.net.URI | ||
import javax.swing.JCheckBox | ||
import javax.swing.JComponent | ||
import javax.swing.JPanel | ||
import javax.swing.event.HyperlinkEvent | ||
|
||
class TornadoFXConfigurable : SearchableConfigurable { | ||
private val id = "preferences.TornadoFX" | ||
private val displayName = "TornadoFX" | ||
private val settings by lazy { TornadoFXSettings.getInstance() } | ||
private var ui: ConfigUI? = null | ||
|
||
override fun createComponent(): JComponent? = ui?.mainPanel ?: ConfigUI().also { ui = it }.mainPanel | ||
|
||
override fun isModified(): Boolean = ui?.isModified(settings) ?: false | ||
|
||
override fun apply() { | ||
ui?.apply(settings) | ||
} | ||
|
||
override fun getDisplayName(): String = displayName | ||
|
||
override fun getId(): String = id | ||
|
||
override fun getHelpTopic(): String? = id | ||
|
||
override fun disposeUIResources() { | ||
ui = null | ||
} | ||
|
||
override fun reset() { | ||
ui?.reset(settings) | ||
} | ||
|
||
class ConfigUI { | ||
internal var mainPanel: JPanel? = null | ||
private var alternativePropertySyntaxCheckbox: JCheckBox? = null | ||
private var propertySyntaxLink: HyperlinkLabel? = null | ||
|
||
fun reset(settings: TornadoFXSettings) { | ||
alternativePropertySyntaxCheckbox!!.isSelected = settings.alternativePropertySyntax | ||
} | ||
|
||
fun apply(settings: TornadoFXSettings) { | ||
settings.alternativePropertySyntax = alternativePropertySyntaxCheckbox!!.isSelected | ||
} | ||
|
||
fun isModified(settings: TornadoFXSettings): Boolean { | ||
return settings.alternativePropertySyntax != alternativePropertySyntaxCheckbox!!.isSelected | ||
} | ||
|
||
init { | ||
propertySyntaxLink!!.setHyperlinkText("More") | ||
propertySyntaxLink!!.addHyperlinkListener(object : HyperlinkAdapter() { | ||
override fun hyperlinkActivated(e: HyperlinkEvent) { | ||
try { | ||
Desktop.getDesktop().browse(URI.create("https://edvin.gitbooks.io/tornadofx-guide/content/part2/Property%20Delegates.html#alternative-property-syntax")) | ||
} catch (e1: IOException) { | ||
e1.printStackTrace() | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
<idea-plugin> | ||
<id>no.tornado.tornadofx.idea</id> | ||
<name>TornadoFX</name> | ||
<version>1.7.18</version> | ||
<version>1.7.20</version> | ||
<vendor email="[email protected]" url="https://www.syse.no">SYSE</vendor> | ||
<description>Run configurations, templates, actions and intentions for TornadoFX.</description> | ||
<description><![CDATA[ | ||
Support for TornadoFX - the JavaFX framework for Kotlin | ||
]]></description> | ||
|
||
<change-notes><![CDATA[ | ||
<h4>1.7.20 2020-08-24</h4> | ||
<ul> | ||
<li>Support kotlin 1.4</li> | ||
</ul> | ||
<h4>1.7.17.1 2018-10-01</h4> | ||
<ul> | ||
<li>General bug fix and compatibility release</li> | ||
|
@@ -23,7 +28,7 @@ | |
<depends>org.jetbrains.kotlin</depends> | ||
<depends>com.intellij.properties</depends> | ||
|
||
<idea-version since-build="201" /> | ||
<idea-version since-build="202" /> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
|
||
|
@@ -77,7 +82,7 @@ | |
<internalFileTemplate name="TornadoFX FXML View"/> | ||
<internalFileTemplate name="TornadoFX FXML ViewResource"/> | ||
|
||
<applicationService serviceInterface="no.tornado.tornadofx.idea.TornadoFXSettings" serviceImplementation="no.tornado.tornadofx.idea.TornadoFXSettings"/> | ||
<applicationService serviceImplementation="no.tornado.tornadofx.idea.TornadoFXSettings"/> | ||
<applicationConfigurable instance="no.tornado.tornadofx.idea.TornadoFXConfigurable" groupId="language" id="preferences.TornadoFX"/> | ||
<annotator language="kotlin" implementationClass="no.tornado.tornadofx.idea.annotator.CSSColorAnnotator" order="first"/> | ||
<annotator language="kotlin" implementationClass="no.tornado.tornadofx.idea.annotator.CSSBoxAnnotator" order="first"/> | ||
|
@@ -107,6 +112,7 @@ | |
description="Generate a new TornadoFX View" icon="/icons/action.png"> | ||
<add-to-group group-id="NewGroup" anchor="after" relative-to-action="Kotlin.NewFile"/> | ||
</action> | ||
<!--suppress PluginXmlCapitalization --> | ||
<action id="injectResource" class="no.tornado.tornadofx.idea.actions.InjectComponentAction" text="Inject TornadoFX Component" | ||
description="Inject TornadoFX Component into the current Component" icon="/icons/action.png"> | ||
<add-to-group group-id="GenerateGroup" anchor="last"/> | ||
|
Oops, something went wrong.