Java Doc for SingleListSelectionAdapter.java in  » Swing-Library » jgoodies-data-binding » com » jgoodies » binding » adapter » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jgoodies data binding » com.jgoodies.binding.adapter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jgoodies.binding.adapter.SingleListSelectionAdapter

SingleListSelectionAdapter
final public class SingleListSelectionAdapter implements ListSelectionModel(Code)
A ListSelectionModel implementation that has the list index bound to a ValueModel . Therefore this class supports only the SINGLE_SELECTION mode where only one list index can be selected at a time. In this mode the setSelectionInterval and addSelectionInterval methods are equivalent, and only the second index argument (the "lead index") is used.

Example:

 SelectionInList selectionInList = new SelectionInList(...);
 JList list = new JList();
 list.setModel(selectionInList);
 list.setSelectionModel(new SingleListSelectionAdapter(
 selectionInList.getSelectionIndexHolder()));
 

author:
   Karsten Lentzsch
author:
   Jeanette Winzenburg
version:
   $Revision: 1.8 $
See Also:   ValueModel
See Also:   javax.swing.JList
See Also:   javax.swing.JTable



Constructor Summary
public  SingleListSelectionAdapter(ValueModel selectionIndexHolder)
     Constructs a SingleListSelectionAdapter with the given selection index holder.

Method Summary
public  voidaddListSelectionListener(ListSelectionListener listener)
     Add a listener to the list that's notified each time a change to the selection occurs.
public  voidaddSelectionInterval(int index0, int index1)
     Sets the selection interval using the given indices.

If this represents a change to the current selection, then notify each ListSelectionListener.

public  voidclearSelection()
     Changes the selection to have no index selected.
public  intgetAnchorSelectionIndex()
     Returns the selection index.
public  intgetLeadSelectionIndex()
     Returns the selection index.
public  ListSelectionListener[]getListSelectionListeners()
     Returns an array of all the list selection listeners registered on this DefaultListSelectionModel.
public  intgetMaxSelectionIndex()
     Returns the selection index.
public  intgetMinSelectionIndex()
     Returns the selection index.
public  intgetSelectionMode()
     Returns the fixed selection mode SINGLE_SELECTION.
public  booleangetValueIsAdjusting()
     Returns true if the value is undergoing a series of changes.
public  voidinsertIndexInterval(int index, int length, boolean before)
     Inserts length indices beginning before/after index.
public  booleanisSelectedIndex(int index)
     Checks and answers if the given index is selected or not.
public  booleanisSelectionEmpty()
     Returns true if no index is selected.
public  voidremoveIndexInterval(int index0, int index1)
     Remove the indices in the interval index0,index1 (inclusive) from the selection model.
public  voidremoveListSelectionListener(ListSelectionListener listener)
     Remove a listener from the list that's notified each time a change to the selection occurs.
public  voidremoveSelectionInterval(int index0, int index1)
     Clears the selection if it is equals to index0.
public  voidsetAnchorSelectionIndex(int newSelectionIndex)
     Sets the selection index.
public  voidsetLeadSelectionIndex(int newSelectionIndex)
     Sets the selection index.
public  voidsetSelectionInterval(int index0, int index1)
     Sets the selection index to index1.
public  voidsetSelectionMode(int selectionMode)
     Sets the selection mode.
public  voidsetValueIsAdjusting(boolean newValueIsAdjusting)
     This property is true if upcoming changes to the value of the model should be considered a single event.


Constructor Detail
SingleListSelectionAdapter
public SingleListSelectionAdapter(ValueModel selectionIndexHolder)(Code)
Constructs a SingleListSelectionAdapter with the given selection index holder.
Parameters:
  selectionIndexHolder - holds the selection index




Method Detail
addListSelectionListener
public void addListSelectionListener(ListSelectionListener listener)(Code)
Add a listener to the list that's notified each time a change to the selection occurs.
Parameters:
  listener - the ListSelectionListener
See Also:   SingleListSelectionAdapter.removeListSelectionListener(ListSelectionListener)
See Also:   SingleListSelectionAdapter.setSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.removeSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.clearSelection()
See Also:   SingleListSelectionAdapter.insertIndexInterval(int,int,boolean)
See Also:   SingleListSelectionAdapter.removeIndexInterval(int,int)



addSelectionInterval
public void addSelectionInterval(int index0, int index1)(Code)
Sets the selection interval using the given indices.

If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.
Parameters:
  index0 - one end of the interval.
Parameters:
  index1 - other end of the interval
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)




clearSelection
public void clearSelection()(Code)
Changes the selection to have no index selected. If this represents a change to the current selection then notify each ListSelectionListener.
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)



getAnchorSelectionIndex
public int getAnchorSelectionIndex()(Code)
Returns the selection index. the selection index
See Also:   SingleListSelectionAdapter.getAnchorSelectionIndex()
See Also:   SingleListSelectionAdapter.setSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addSelectionInterval(int,int)



getLeadSelectionIndex
public int getLeadSelectionIndex()(Code)
Returns the selection index. the selection index
See Also:   SingleListSelectionAdapter.getAnchorSelectionIndex()
See Also:   SingleListSelectionAdapter.setSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addSelectionInterval(int,int)



getListSelectionListeners
public ListSelectionListener[] getListSelectionListeners()(Code)
Returns an array of all the list selection listeners registered on this DefaultListSelectionModel. all of this model's ListSelectionListenersor an emptyarray if no list selection listeners are currently registered
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)
See Also:   SingleListSelectionAdapter.removeListSelectionListener(ListSelectionListener)



getMaxSelectionIndex
public int getMaxSelectionIndex()(Code)
Returns the selection index. the selection index
See Also:   SingleListSelectionAdapter.getMinSelectionIndex()
See Also:   SingleListSelectionAdapter.setSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addSelectionInterval(int,int)



getMinSelectionIndex
public int getMinSelectionIndex()(Code)
Returns the selection index. the selection index
See Also:   SingleListSelectionAdapter.getMinSelectionIndex()
See Also:   SingleListSelectionAdapter.setSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addSelectionInterval(int,int)



getSelectionMode
public int getSelectionMode()(Code)
Returns the fixed selection mode SINGLE_SELECTION. SINGLE_SELECTION
See Also:   SingleListSelectionAdapter.setSelectionMode(int)



getValueIsAdjusting
public boolean getValueIsAdjusting()(Code)
Returns true if the value is undergoing a series of changes. true if the value is currently adjusting
See Also:   SingleListSelectionAdapter.setValueIsAdjusting(boolean)



insertIndexInterval
public void insertIndexInterval(int index, int length, boolean before)(Code)
Inserts length indices beginning before/after index. If the value This method is typically called to synchronize the selection model with a corresponding change in the data model.
Parameters:
  index - the index to start the insertion
Parameters:
  length - the length of the inserted interval
Parameters:
  before - true to insert before the start index



isSelectedIndex
public boolean isSelectedIndex(int index)(Code)
Checks and answers if the given index is selected or not.
Parameters:
  index - the index to be checked true if selected, false if deselected
See Also:   javax.swing.ListSelectionModel.isSelectedIndex(int)



isSelectionEmpty
public boolean isSelectionEmpty()(Code)
Returns true if no index is selected. true if no index is selected



removeIndexInterval
public void removeIndexInterval(int index0, int index1)(Code)
Remove the indices in the interval index0,index1 (inclusive) from the selection model. This is typically called to sync the selection model width a corresponding change in the data model.

Clears the selection if it is in the specified interval.
Parameters:
  index0 - the first index to remove from the selection
Parameters:
  index1 - the last index to remove from the selection
throws:
  IndexOutOfBoundsException - if either index0or index1 are less than -1
See Also:   ListSelectionModel.removeSelectionInterval(intint)
See Also:   SingleListSelectionAdapter.setSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addSelectionInterval(int,int)
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)




removeListSelectionListener
public void removeListSelectionListener(ListSelectionListener listener)(Code)
Remove a listener from the list that's notified each time a change to the selection occurs.
Parameters:
  listener - the ListSelectionListener
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)



removeSelectionInterval
public void removeSelectionInterval(int index0, int index1)(Code)
Clears the selection if it is equals to index0. Since this model supports only a single selection index, the index1 can be ignored for the selection.

If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.
Parameters:
  index0 - one end of the interval.
Parameters:
  index1 - other end of the interval
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)




setAnchorSelectionIndex
public void setAnchorSelectionIndex(int newSelectionIndex)(Code)
Sets the selection index.
Parameters:
  newSelectionIndex - the new selection index
See Also:   SingleListSelectionAdapter.getLeadSelectionIndex()



setLeadSelectionIndex
public void setLeadSelectionIndex(int newSelectionIndex)(Code)
Sets the selection index.
Parameters:
  newSelectionIndex - the new selection index
See Also:   SingleListSelectionAdapter.getLeadSelectionIndex()



setSelectionInterval
public void setSelectionInterval(int index0, int index1)(Code)
Sets the selection index to index1. Since this model supports only a single selection index, the index0 is ignored. This is the behavior the DefaultListSelectionModel uses in single selection mode.

If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.
Parameters:
  index0 - one end of the interval.
Parameters:
  index1 - other end of the interval
See Also:   SingleListSelectionAdapter.addListSelectionListener(ListSelectionListener)




setSelectionMode
public void setSelectionMode(int selectionMode)(Code)
Sets the selection mode. Only SINGLE_SELECTION is allowed in this implementation. Other modes are not supported and will throw an IllegalArgumentException.

With SINGLE_SELECTION only one list index can be selected at a time. In this mode the setSelectionInterval and addSelectionInterval methods are equivalent, and only the second index argument (the "lead index") is used.
Parameters:
  selectionMode - the mode to be set
See Also:   SingleListSelectionAdapter.getSelectionMode()
See Also:   javax.swing.ListSelectionModel.setSelectionMode(int)




setValueIsAdjusting
public void setValueIsAdjusting(boolean newValueIsAdjusting)(Code)
This property is true if upcoming changes to the value of the model should be considered a single event. For example if the model is being updated in response to a user drag, the value of the valueIsAdjusting property will be set to true when the drag is initiated and be set to false when the drag is finished. This property allows listeners to to update only when a change has been finalized, rather than always handling all of the intermediate values.
Parameters:
  newValueIsAdjusting - The new value of the property.
See Also:   SingleListSelectionAdapter.getValueIsAdjusting()



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.