Skip to content

Commit 80ae3da

Browse files
committed
Rename asObservable to asFlow
1 parent 952b0f2 commit 80ae3da

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

durian-swt/src/main/java/com/diffplug/common/swt/SwtThread.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 DiffPlug
2+
* Copyright (C) 2020-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515
*/
1616
package com.diffplug.common.swt;
1717

18-
18+
import com.diffplug.common.rx.IFlowable;
1919
import java.lang.annotation.ElementType;
2020
import java.lang.annotation.Retention;
2121
import java.lang.annotation.RetentionPolicy;
@@ -35,7 +35,7 @@
3535
*
3636
* When annotated on a parameter or field, it
3737
* must be either an {@link rx.Observable},
38-
* {@link com.diffplug.common.rx.IObservable}, or a
38+
* {@link IFlowable}, or a
3939
* {@link java.util.concurrent.CompletionStage}, and
4040
* it indicates that the given code should only be
4141
* set and listened to from SWT.

durian-swt/src/main/java/com/diffplug/common/swt/jface/ViewerMisc.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 DiffPlug
2+
* Copyright (C) 2020-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
1515
*/
1616
package com.diffplug.common.swt.jface;
1717

18-
1918
import com.diffplug.common.base.Converter;
2019
import com.diffplug.common.base.Preconditions;
2120
import com.diffplug.common.collect.ImmutableList;
@@ -55,7 +54,7 @@ public static <T> void singleSelection(StructuredViewer viewer, RxBox<Optional<T
5554
box.set(Optional.ofNullable(selected));
5655
});
5756
// set the selection when the box changes
58-
SwtExec.immediate().guardOn(viewer.getControl()).subscribe(box.asObservable(), optional -> {
57+
SwtExec.immediate().guardOn(viewer.getControl()).subscribe(box, optional -> {
5958
if (optional.isPresent()) {
6059
viewer.setSelection(new StructuredSelection(optional.get()));
6160
} else {

durian-swt/src/main/java/com/diffplug/common/swt/widgets/RadioGroup.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 DiffPlug
2+
* Copyright (C) 2020-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
1515
*/
1616
package com.diffplug.common.swt.widgets;
1717

18-
1918
import com.diffplug.common.base.Preconditions;
2019
import com.diffplug.common.collect.BiMap;
2120
import com.diffplug.common.collect.HashBiMap;
@@ -84,7 +83,7 @@ public RxBox<T> buildOn(Composite cmp) {
8483

8584
// when the selection is changed, set the button
8685
Button firstBtn = Iterables.get(mapping.keySet(), 0);
87-
SwtExec.immediate().guardOn(firstBtn).subscribe(selection.asObservable(), obj -> {
86+
SwtExec.immediate().guardOn(firstBtn).subscribe(selection, obj -> {
8887
Button selectedBtn = mapping.inverse().get(obj);
8988
for (Button btn : mapping.keySet()) {
9089
btn.setSelection(btn == selectedBtn);

durian-swt/src/test/java/com/diffplug/common/swt/widgets/RadioGroupTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 DiffPlug
2+
* Copyright (C) 2020-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
1515
*/
1616
package com.diffplug.common.swt.widgets;
1717

18-
1918
import com.diffplug.common.rx.RxBox;
2019
import com.diffplug.common.swt.InteractiveTest;
2120
import com.diffplug.common.swt.Layouts;
@@ -65,7 +64,7 @@ public void test() {
6564
readLbl.setText("Read selection: ");
6665

6766
Text readTxt = new Text(debugParent, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
68-
SwtExec.immediate().guardOn(readTxt).subscribe(selection.asObservable(), option -> {
67+
SwtExec.immediate().guardOn(readTxt).subscribe(selection, option -> {
6968
readTxt.setText(option.name());
7069
});
7170

0 commit comments

Comments
 (0)