Package javax.swing

Examples of javax.swing.DefaultListSelectionModel.clearSelection()


    DefaultListSelectionModel m = new DefaultListSelectionModel();
    m.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    m.addListSelectionListener(this);
    harness.check(m.isSelectionEmpty(), true);
    lastEvent = null;
    m.clearSelection();
    harness.check(m.isSelectionEmpty(), true);
    harness.check(lastEvent, null);
   
    // check 2 : clearing a selection generates an event with first and last
    // indices covering the former selection
View Full Code Here


    // check 2 : clearing a selection generates an event with first and last
    // indices covering the former selection
    harness.checkPoint("SINGLE_INTERVAL_SELECTION (2)");
    m.addSelectionInterval(10, 20);
    lastEvent = null;
    m.clearSelection();
    harness.check(m.isSelectionEmpty(), true);
    harness.check(m.isSelectedIndex(10), false);
    harness.check(m.getAnchorSelectionIndex(), 10);
    harness.check(m.getLeadSelectionIndex(), 20);
    harness.check(m.getMinSelectionIndex(), -1);
View Full Code Here

    DefaultListSelectionModel m = new DefaultListSelectionModel();
    m.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    m.addListSelectionListener(this);
    harness.check(m.isSelectionEmpty(), true);
    lastEvent = null;
    m.clearSelection();
    harness.check(m.isSelectionEmpty(), true);
    harness.check(lastEvent, null);
   
    // check 2 : clearing a selection generates an event with first and last
    // indices covering the former selection
View Full Code Here

    // indices covering the former selection
    harness.checkPoint("MULTIPLE_INTERVAL_SELECTION (2)");
    m.addSelectionInterval(2, 3);
    m.addSelectionInterval(12, 13);
    lastEvent = null;
    m.clearSelection();
    harness.check(m.isSelectionEmpty(), true);
    harness.check(m.getAnchorSelectionIndex(), 12);
    harness.check(m.getLeadSelectionIndex(), 13);
    harness.check(m.getMinSelectionIndex(), -1);
    harness.check(m.getMaxSelectionIndex(), -1);
View Full Code Here

    harness.check(m.getLeadSelectionIndex(), -1);
    m.setAnchorSelectionIndex(1);
    m.setLeadSelectionIndex(3);
    harness.check(m.getLeadSelectionIndex(), 3);
   
    m.clearSelection();
    harness.check(m.getLeadSelectionIndex(), 3);
   
    m.addSelectionInterval(15, 11);
    harness.check(m.getLeadSelectionIndex(), 11);
  }
View Full Code Here

  {
    DefaultListSelectionModel m = new DefaultListSelectionModel();
    harness.check(m.getAnchorSelectionIndex(), -1);
    m.setAnchorSelectionIndex(99);
    harness.check(m.getAnchorSelectionIndex(), 99);
    m.clearSelection();
    harness.check(m.getAnchorSelectionIndex(), 99);
    m.addSelectionInterval(15, 11);
    harness.check(m.getAnchorSelectionIndex(), 15);
  }
}
View Full Code Here

  {
    DefaultListSelectionModel m = new DefaultListSelectionModel();
    harness.check(m.getMaxSelectionIndex(), -1);
    m.addSelectionInterval(99, 101);
    harness.check(m.getMaxSelectionIndex(), 101);
    m.clearSelection();
    harness.check(m.getMaxSelectionIndex(), -1);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.