com.pallas.swing.pcombobox
Class FullWordComboKeySelectionModel

java.lang.Object
  |
  +--com.pallas.swing.pcombobox.FullWordComboKeySelectionModel
All Implemented Interfaces:
javax.swing.JComboBox.KeySelectionManager

public class FullWordComboKeySelectionModel
extends java.lang.Object
implements javax.swing.JComboBox.KeySelectionManager

Title: $FileName: FullWordComboKeySelectionModel.java$

Version:
$VerNum: 5$
Author:
$AuthorName: Rob MacGrogan$

$Description: KeySelectionManager used by PComboBox.$
$KeyWordsOff: $

KeySelectionManager used by PComboBox. Allows the user to enter text into the editor component. Looks at text user has typed and make a match accordingly. Will not allow user's caret to advance if no match can be made.

Field Summary
(package private)  boolean block
           
private  int caretPosition
           
private  javax.swing.JTextField field
           
private  FullWordComboKeySelectionModel mgr
           
private  PComboBox parent
           
private  int selection
           
 
Constructor Summary
FullWordComboKeySelectionModel(PComboBox parent)
           
 
Method Summary
(package private)  int getCaretPosition()
          Returns user's current caret position inside of editable component.
private  java.lang.String getCurrentSerachString(int caretPosition)
           
(package private)  javax.swing.JTextField getField()
          Returns editor component of the PComboBox.
(package private)  PComboBox getParent()
          Returns PComboBox that is using this FullWordComboKeySelectionModel.
private  java.lang.String getSelectedString(javax.swing.ComboBoxModel model)
           
private  java.lang.String getString(javax.swing.ComboBoxModel model, int index)
           
 int selectionForKey(char key, javax.swing.ComboBoxModel model)
          Can't get this to work consistently, so we are not using this method.
 int selectionForKey(char key, javax.swing.ComboBoxModel model, int caretPosition)
          LIke selectionForKey, but we are calling this indirectly (via Async) from PComboDocumentListener, passing in the caret position, and ignoring the key.
 void updateSearchStringField(java.lang.String s, javax.swing.ComboBoxModel model, java.lang.String searchString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private PComboBox parent

field

private javax.swing.JTextField field

mgr

private FullWordComboKeySelectionModel mgr

block

boolean block

caretPosition

private int caretPosition

selection

private int selection
Constructor Detail

FullWordComboKeySelectionModel

public FullWordComboKeySelectionModel(PComboBox parent)
Method Detail

getParent

PComboBox getParent()
Returns PComboBox that is using this FullWordComboKeySelectionModel.


getField

javax.swing.JTextField getField()
Returns editor component of the PComboBox.


getCaretPosition

int getCaretPosition()
Returns user's current caret position inside of editable component.


selectionForKey

public int selectionForKey(char key,
                           javax.swing.ComboBoxModel model)
Can't get this to work consistently, so we are not using this method.

Specified by:
selectionForKey in interface javax.swing.JComboBox.KeySelectionManager

selectionForKey

public int selectionForKey(char key,
                           javax.swing.ComboBoxModel model,
                           int caretPosition)
LIke selectionForKey, but we are calling this indirectly (via Async) from PComboDocumentListener, passing in the caret position, and ignoring the key.


updateSearchStringField

public void updateSearchStringField(java.lang.String s,
                                    javax.swing.ComboBoxModel model,
                                    java.lang.String searchString)

getCurrentSerachString

private java.lang.String getCurrentSerachString(int caretPosition)

getString

private java.lang.String getString(javax.swing.ComboBoxModel model,
                                   int index)

getSelectedString

private java.lang.String getSelectedString(javax.swing.ComboBoxModel model)


Copyright 2003 Pallas Technology.