test.ca.odell.glazedlists.swing.JEventListPanelTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glazedlists_java15 Show documentation
Show all versions of glazedlists_java15 Show documentation
Event-driven lists for dynamically filtered and sorted tables
/* 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