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

Remove RxJava #31

Merged
merged 14 commits into from
Jan 25, 2025
Merged
22 changes: 0 additions & 22 deletions .github/workflows/changelog-print.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# gradle stuff
.gradle/
build/
.kotlin/

# IntelliJ
.idea
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]
### Changed
- **BREAKING** `SwtMisc.systemFontWidth` now returns `double` instead of `int`.
- added new methods `systemFontWidthTimes(int)` and `systemFontWidthTimes(String)` to make this easier to deal with
- **BREAKING** remove RxJava completely in favor of Kotlin Flow.
- Bump required java from 11 to 17.

## [4.3.1] - 2024-07-05
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ subprojects { subProject ->
"https://javadoc.io/doc/com.diffplug.durian/durian-concurrent/${VER_DURIAN}",
"https://javadoc.io/doc/com.diffplug.durian/durian-debug/${VER_DURIAN_DEBUG}",
"https://javadoc.io/doc/com.diffplug.durian/durian-rx/${VER_DURIAN_RX}",
"https://javadoc.io/doc/io.reactivex.rxjava2/rxjava/${VER_RXJAVA}",
'https://docs.oracle.com/javase/8/docs/api/'
].join(' ')

Expand Down
1 change: 0 additions & 1 deletion durian-swt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ p2deps {
dependencies {
api project(':durian-swt.os')
api "com.diffplug.durian:durian-rx:$VER_DURIAN_RX"
api "io.reactivex.rxjava2:rxjava:$VER_RXJAVA"
implementation "com.diffplug.durian:durian-core:$VER_DURIAN"
implementation "com.diffplug.durian:durian-collect:$VER_DURIAN"
implementation "com.diffplug.durian:durian-concurrent:$VER_DURIAN"
Expand Down
15 changes: 8 additions & 7 deletions durian-swt/src/main/java/com/diffplug/common/swt/Shells.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import com.diffplug.common.swt.os.WS
import com.diffplug.common.tree.TreeIterable
import com.diffplug.common.tree.TreeQuery
import com.diffplug.common.tree.TreeStream
import io.reactivex.disposables.Disposable
import io.reactivex.disposables.Disposables
import kotlinx.coroutines.Job
import org.eclipse.swt.SWT
import org.eclipse.swt.graphics.Image
import org.eclipse.swt.graphics.Point
Expand All @@ -36,7 +35,7 @@ import java.util.*

/** A fluent builder for creating SWT [Shell]s. */
class Shells private constructor(private val style: Int, private val coat: Coat) {
private var title: String = ""
private var title: String? = null
private var image: Image? = null
private var alpha = SWT.DEFAULT
private val size = Point(SWT.DEFAULT, SWT.DEFAULT)
Expand Down Expand Up @@ -434,17 +433,19 @@ class Shells private constructor(private val style: Int, private val coat: Coat)

/** Prevents the given shell from closing without prompting. Returns a Subscription which can cancel this blocking. */
@JvmStatic
fun confirmClose(shell: Shell, title: String, question: String, runOnClose: Runnable): Disposable {
fun confirmClose(shell: Shell, title: String, question: String, runOnClose: Runnable): Job {
val listener = Listener { e: Event ->
e.doit = SwtMisc.blockForQuestion(title, question, shell)
if (e.doit) {
runOnClose.run()
}
}
shell.addListener(SWT.Close, listener)
return Disposables.fromRunnable {
SwtExec.immediate().guardOn(shell).execute {
shell.removeListener(SWT.Close, listener)
return Job().apply {
invokeOnCompletion {
SwtExec.immediate().guardOn(shell).execute {
shell.removeListener(SWT.Close, listener)
}
}
}
}
Expand Down
Loading
Loading