All Downloads are FREE. Search and download functionalities are using the official Maven repository.

test.ca.odell.glazedlists.swing.JEventListPanelTest Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
/* Glazed Lists                                                 (c) 2003-2006 */
/* http://publicobject.com/glazedlists/                      publicobject.com,*/
/*                                                     O'Dell Engineering Ltd.*/
package ca.odell.glazedlists.swing;

import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.EventList;

import javax.swing.*;

/**
 * @author Jesse Wilson
 */
public class JEventListPanelTest extends SwingTestCase {

    /**
     * Verifies that JEventListPanel works with all operations in sequence.
     */
    public void guiTestAddUpdateDelete() {
        EventList checkBoxes = new BasicEventList();
        JEventListPanel checkboxPanel = new JEventListPanel(checkBoxes, new CheckBoxFormat());
        checkBoxes.add(new JCheckBox("Saskatchewan"));
        checkBoxes.add(new JCheckBox("Manitoba"));
        checkBoxes.set(0, new JCheckBox("Ontario"));
        checkBoxes.remove(1);
        checkBoxes.remove(0);
    }

    /**
     * Trivial implementation of {@link JEventListPanel.Format} for testing.
     */
    class CheckBoxFormat extends JEventListPanel.AbstractFormat {
        public CheckBoxFormat() {
            super("pref", "pref", null, null, new String[] { "1, 1" });
        }
        public JComponent getComponent(JCheckBox element, int component) {
            return element;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy