use of javax.swing.AbstractListModel in project knime-core by knime.
the class QuotePanel method loadSettings.
/**
* Transfers the values from the specified object into the components of the
* panel.
*
* @param settings the object containing the settings to display
*/
private void loadSettings(final FileReaderNodeSettings settings) {
// take over the quotes defined in the settings object into our JList
final Vector<String> newModel = new Vector<String>();
for (Quote q : settings.getAllQuotes()) {
newModel.add(getListEntry(q));
}
m_currQuotes.setModel(new AbstractListModel() {
public int getSize() {
return newModel.size();
}
public Object getElementAt(final int index) {
return newModel.get(index);
}
});
// also clear the edit field
getQEditField().setText("");
clearErrorText();
m_allowLFCheckbox.setSelected(settings.allowLFinQuotes());
}
Aggregations