Example usage for javafx.collections FXCollections observableArrayList

List of usage examples for javafx.collections FXCollections observableArrayList

Introduction

In this page you can find the example usage for javafx.collections FXCollections observableArrayList.

Prototype

public static <E> ObservableList<E> observableArrayList(Collection<? extends E> col) 

Source Link

Document

Creates a new observable array list and adds a content of collection col to it.

Usage

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelTopDepPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamDelTopDepObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/* w ww. j  a v a2  s.com*/
    observableListOfDelTopDep = null;
    if (javafxDataCollection != null) {
        observableListOfDelTopDep = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfDelTopDep.sort(compareDelTopDepByQualName);
    } else {
        observableListOfDelTopDep = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfDelTopDep);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopTopDepPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamPopTopDepObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;//from   ww w.ja  v  a2s.  c o m
    observableListOfPopTopDep = null;
    if (javafxDataCollection != null) {
        observableListOfPopTopDep = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfPopTopDep.sort(comparePopTopDepByQualName);
    } else {
        observableListOfPopTopDep = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfPopTopDep);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:de.pixida.logtest.designer.logreader.LogReaderEditor.java

public void createInputForHandlingOfNonHeadlineLines(final List<Triple<String, Node, String>> formItems) {
    final Map<HandlingOfNonHeadlineLines, String> mapValueToChoice = new HashMap<>();
    mapValueToChoice.put(HandlingOfNonHeadlineLines.FAIL,
            "Abort - Each line in the log file is assumed to be a log entry");
    mapValueToChoice.put(HandlingOfNonHeadlineLines.CREATE_MULTILINE_ENTRY,
            "Append to payload - This will create multiline payloads");
    mapValueToChoice.put(HandlingOfNonHeadlineLines.ASSUME_LAST_TIMESTAMP,
            "Create new log entry and use timestamp of recent log entry");
    mapValueToChoice.put(HandlingOfNonHeadlineLines.ASSUME_LAST_TIMESTAMP_AND_CHANNEL,
            "Create new log entry and use timestamp and channel of recent log entry");
    final ChoiceBox<HandlingOfNonHeadlineLines> handlingOfNonHeadlineLinesInput = new ChoiceBox<>(
            FXCollections.observableArrayList(HandlingOfNonHeadlineLines.values()));
    handlingOfNonHeadlineLinesInput.setConverter(new StringConverter<HandlingOfNonHeadlineLines>() {
        @Override/*from w  w  w  .  j a  v  a  2  s.c  o  m*/
        public String toString(final HandlingOfNonHeadlineLines object) {
            return mapValueToChoice.get(object);
        }

        @Override
        public HandlingOfNonHeadlineLines fromString(final String string) {
            for (final Entry<HandlingOfNonHeadlineLines, String> entry : mapValueToChoice.entrySet()) {
                if (entry.getValue() == string) // Intentionally comparing references to obtain a bijection
                {
                    return entry.getKey();
                }
            }
            return null; // Should never happen
        }
    });
    handlingOfNonHeadlineLinesInput.getSelectionModel().select(this.logReader.getHandlingOfNonHeadlineLines());
    handlingOfNonHeadlineLinesInput.getSelectionModel().selectedIndexProperty()
            .addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> {
                this.logReader.setHandlingOfNonHeadlineLines(
                        handlingOfNonHeadlineLinesInput.getItems().get(newValue.intValue()));
                this.setChanged(true);
            });
    formItems.add(Triple.of("Dangling Lines", handlingOfNonHeadlineLinesInput,
            "Define what to do if dangling lines are spotted. Dangling lines are lines which do not match the headline pattern, i.e."
                    + " which do not introduce a new log entry."));
}

From source file:com.exalttech.trex.ui.views.PacketTableView.java

/**
 * Save profile changes to yaml file//from   w  w  w  .ja v a 2s  .c om
 *
 * @param profiles
 * @throws JsonProcessingException
 * @throws IOException
 */
private void saveChangesToYamlFile(Profile[] profiles) throws JsonProcessingException, IOException {
    String yamlData = trafficProfile.convertTrafficProfileToYaml(profiles);
    FileUtils.writeStringToFile(new File(tabledata.getYamlFileName()), yamlData);
    streamPacketTableView.setItems(FXCollections.observableArrayList(tabledata.getStreamsList()));
    if (tableUpdateHandler != null && doUpdate) {
        tableUpdateHandler.onStreamUpdated();
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep1PickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamDelSubDep1Obj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from   w w w  . j a  v  a 2s .  c  o  m*/
    observableListOfDelSubDep1 = null;
    if (javafxDataCollection != null) {
        observableListOfDelSubDep1 = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfDelSubDep1.sort(compareDelSubDep1ByQualName);
    } else {
        observableListOfDelSubDep1 = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfDelSubDep1);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep1PickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamPopSubDep1Obj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;//from w w  w. j ava 2s  .c o  m
    observableListOfPopSubDep1 = null;
    if (javafxDataCollection != null) {
        observableListOfPopSubDep1 = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfPopSubDep1.sort(comparePopSubDep1ByQualName);
    } else {
        observableListOfPopSubDep1 = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfPopSubDep1);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep2PickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamDelSubDep2Obj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;//ww  w.j  a v a  2s.  com
    observableListOfDelSubDep2 = null;
    if (javafxDataCollection != null) {
        observableListOfDelSubDep2 = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfDelSubDep2.sort(compareDelSubDep2ByQualName);
    } else {
        observableListOfDelSubDep2 = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfDelSubDep2);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXDelSubDep3PickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamDelSubDep3Obj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from   w w w  .ja v a 2  s. c  om*/
    observableListOfDelSubDep3 = null;
    if (javafxDataCollection != null) {
        observableListOfDelSubDep3 = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfDelSubDep3.sort(compareDelSubDep3ByQualName);
    } else {
        observableListOfDelSubDep3 = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfDelSubDep3);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep2PickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamPopSubDep2Obj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from  w ww  .  j  av a  2 s .c  o m*/
    observableListOfPopSubDep2 = null;
    if (javafxDataCollection != null) {
        observableListOfPopSubDep2 = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfPopSubDep2.sort(comparePopSubDep2ByQualName);
    } else {
        observableListOfPopSubDep2 = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfPopSubDep2);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXPopSubDep3PickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamPopSubDep3Obj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from  www  .  ja  va 2s  .  c  o  m*/
    observableListOfPopSubDep3 = null;
    if (javafxDataCollection != null) {
        observableListOfPopSubDep3 = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfPopSubDep3.sort(comparePopSubDep3ByQualName);
    } else {
        observableListOfPopSubDep3 = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfPopSubDep3);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}