Search in sources :

Example 1 with ValueChangeListener

use of com.vaadin.flow.component.HasValue.ValueChangeListener in project karnak by OsiriX-Foundation.

the class MonitorView method buildwadoNodeListSelector.

private void buildwadoNodeListSelector() {
    wadoNodeListSelector = new Select<>();
    wadoNodeListSelector.setEmptySelectionAllowed(false);
    WadoNodeList pacsProdWadoNodeList = Util.readWadoNodes(this.getClass().getResource("/config/pacs-wado-web.csv"), "Public web");
    wadoNodeListSelector.setItems(pacsProdWadoNodeList);
    wadoNodeListSelector.addValueChangeListener((ValueChangeListener<ValueChangeEvent<WadoNodeList>>) event -> logic.wadoNodeListSelected(event.getValue()));
    if (!pacsProdWadoNodeList.isEmpty()) {
        wadoNodeListSelector.setValue(pacsProdWadoNodeList);
    }
}
Also used : DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList) Html(com.vaadin.flow.component.Html) Select(com.vaadin.flow.component.select.Select) Util(org.karnak.frontend.dicom.Util) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) Div(com.vaadin.flow.component.html.Div) AbstractView(org.karnak.frontend.dicom.AbstractView) H6(com.vaadin.flow.component.html.H6) ValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener) WadoNodeList(org.karnak.backend.model.dicom.WadoNodeList) Alignment(com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment) Button(com.vaadin.flow.component.button.Button) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent) WadoNodeList(org.karnak.backend.model.dicom.WadoNodeList)

Example 2 with ValueChangeListener

use of com.vaadin.flow.component.HasValue.ValueChangeListener in project karnak by OsiriX-Foundation.

the class MonitorView method buildDicomNodeListSelector.

private void buildDicomNodeListSelector() {
    dicomEchoNodeListSelector = new Select<>();
    dicomEchoNodeListSelector.setEmptySelectionAllowed(false);
    DicomNodeList pacsProdDicomNodeList = Util.readnodes(this.getClass().getResource("/config/pacs-nodes-web.csv"), "PACS Public WEB");
    DicomNodeList newPacsProdDicomNodeList = Util.readnodes(this.getClass().getResource("/config/workstations-nodes.csv"), "Workstations");
    dicomEchoNodeListSelector.setItems(pacsProdDicomNodeList, newPacsProdDicomNodeList);
    dicomEchoNodeListSelector.addValueChangeListener((ValueChangeListener<ValueChangeEvent<DicomNodeList>>) event -> logic.dicomNodeListSelected(event.getValue()));
    if (!pacsProdDicomNodeList.isEmpty()) {
        dicomEchoNodeListSelector.setValue(pacsProdDicomNodeList);
    }
}
Also used : DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList) Html(com.vaadin.flow.component.Html) Select(com.vaadin.flow.component.select.Select) Util(org.karnak.frontend.dicom.Util) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) Div(com.vaadin.flow.component.html.Div) AbstractView(org.karnak.frontend.dicom.AbstractView) H6(com.vaadin.flow.component.html.H6) ValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener) WadoNodeList(org.karnak.backend.model.dicom.WadoNodeList) Alignment(com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment) Button(com.vaadin.flow.component.button.Button) DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent)

Aggregations

ValueChangeEvent (com.vaadin.flow.component.HasValue.ValueChangeEvent)2 ValueChangeListener (com.vaadin.flow.component.HasValue.ValueChangeListener)2 Html (com.vaadin.flow.component.Html)2 Button (com.vaadin.flow.component.button.Button)2 Div (com.vaadin.flow.component.html.Div)2 H6 (com.vaadin.flow.component.html.H6)2 Alignment (com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment)2 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)2 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)2 Select (com.vaadin.flow.component.select.Select)2 DicomNodeList (org.karnak.backend.model.dicom.DicomNodeList)2 WadoNodeList (org.karnak.backend.model.dicom.WadoNodeList)2 AbstractView (org.karnak.frontend.dicom.AbstractView)2 Util (org.karnak.frontend.dicom.Util)2