Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f80b1af19a
|
@ -33,10 +33,8 @@ public class NetworkServiceCell extends CharmListCell<NetworkService> {
|
||||||
icon.setWidth(25);
|
icon.setWidth(25);
|
||||||
tile.setPrimaryGraphic(icon);
|
tile.setPrimaryGraphic(icon);
|
||||||
tile.setOnMouseClicked(e -> {
|
tile.setOnMouseClicked(e -> {
|
||||||
System.out.println("Selected -> " + itemProperty().get().getName() );
|
|
||||||
clipboardContent.putString(itemProperty().get().getUrl());
|
clipboardContent.putString(itemProperty().get().getUrl());
|
||||||
clipboard.setContent(clipboardContent);
|
clipboard.setContent(clipboardContent);
|
||||||
// TODO: Copy to iOS / Android clipboard
|
|
||||||
});
|
});
|
||||||
setText(null);
|
setText(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import javax.jmdns.JmDNS;
|
import javax.jmdns.JmDNS;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -81,6 +82,18 @@ public class DiscoveryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
public void destroy() {
|
||||||
|
if(jmdns != null) {
|
||||||
|
try {
|
||||||
|
jmdns.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("destroy() - {}", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setObservableList(ObservableList<NetworkService> list) {
|
public void setObservableList(ObservableList<NetworkService> list) {
|
||||||
this.observableList = list;
|
this.observableList = list;
|
||||||
services.forEach((item, color) -> {
|
services.forEach((item, color) -> {
|
||||||
|
@ -90,4 +103,5 @@ public class DiscoveryService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,9 +39,9 @@ public class MainPresenter {
|
||||||
private ResourceBundle resources;
|
private ResourceBundle resources;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private CharmListView charmListView;
|
private CharmListView<NetworkService, Integer> charmListView;
|
||||||
|
|
||||||
private ObservableList<NetworkService> devicesList = FXCollections.observableArrayList();
|
private final ObservableList<NetworkService> devicesList = FXCollections.observableArrayList();
|
||||||
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -62,7 +62,6 @@ public class MainPresenter {
|
||||||
});
|
});
|
||||||
|
|
||||||
discoveryService.setObservableList(devicesList);
|
discoveryService.setObservableList(devicesList);
|
||||||
|
|
||||||
charmListView.setItems(devicesList);
|
charmListView.setItems(devicesList);
|
||||||
charmListView.setCellFactory(p -> new NetworkServiceCell());
|
charmListView.setCellFactory(p -> new NetworkServiceCell());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue