Search in sources :

Example 1 with AbstractListModel

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());
}
Also used : Quote(org.knime.core.util.tokenizer.Quote) AbstractListModel(javax.swing.AbstractListModel) Vector(java.util.Vector)

Aggregations

Vector (java.util.Vector)1 AbstractListModel (javax.swing.AbstractListModel)1 Quote (org.knime.core.util.tokenizer.Quote)1