Remove unchecked warnings.
This commit is contained in:
parent
6bcc246f9f
commit
94d65554df
|
@ -32,10 +32,8 @@ public class NetworkServiceCell extends CharmListCell<NetworkService> {
|
|||
icon.setWidth(25);
|
||||
tile.setPrimaryGraphic(icon);
|
||||
tile.setOnMouseClicked(e -> {
|
||||
System.out.println("Selected -> " + itemProperty().get().getName() );
|
||||
clipboardContent.putString(itemProperty().get().getUrl());
|
||||
clipboard.setContent(clipboardContent);
|
||||
// TODO: Copy to iOS / Android clipboard
|
||||
});
|
||||
setText(null);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.inject.Singleton;
|
||||
import javax.jmdns.JmDNS;
|
||||
import java.io.IOException;
|
||||
|
@ -78,6 +79,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) {
|
||||
this.observableList = list;
|
||||
services.forEach((item, color) -> {
|
||||
|
@ -87,4 +100,5 @@ public class DiscoveryService {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@ public class MainPresenter {
|
|||
private ResourceBundle resources;
|
||||
|
||||
@FXML
|
||||
private CharmListView charmListView;
|
||||
private CharmListView<NetworkService, Integer> charmListView;
|
||||
|
||||
private ObservableList<NetworkService> devicesList = FXCollections.observableArrayList();
|
||||
private final ObservableList<NetworkService> devicesList = FXCollections.observableArrayList();
|
||||
|
||||
|
||||
@FXML
|
||||
|
@ -62,7 +62,6 @@ public class MainPresenter {
|
|||
});
|
||||
|
||||
discoveryService.setObservableList(devicesList);
|
||||
|
||||
charmListView.setItems(devicesList);
|
||||
charmListView.setCellFactory(p -> new NetworkServiceCell());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue