phenote.gui.field
Class AbstractAutoCompList

java.lang.Object
  extended by phenote.gui.field.CharFieldGui
      extended by phenote.gui.field.AbstractAutoCompList
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener
Direct Known Subclasses:
RelationCompList, TermCompList

public abstract class AbstractAutoCompList
extends CharFieldGui

has a jcombobox that does auto completion - i had to do some tricks(hacks) to get it working with mouse over which doesnt come naturally to jcombobox


Field Summary
 
Fields inherited from class phenote.gui.field.CharFieldGui
fieldHeight, inputSize, selectionModel
 
Constructor Summary
protected AbstractAutoCompList(CharField cf)
           
protected AbstractAutoCompList(CharField cf, int minCompChars)
           
 
Method Summary
protected  boolean canGetUIJList()
           
(package private)  void clear()
           
 void doMouseOver(int itemNumber)
           
protected  AbstractAutoCompList getCompList()
          for testing and internal use - overridden
 CompListSearcher getCompListSearcher()
           
protected abstract  java.lang.String getCurrentTermRelName()
          Return the name of the current term or relation - was gonna call this item name but that gets confused with "items" in combo box
protected  java.lang.Object getFirstCompListObj()
          Get first object in comp list, CompTerm for TermCompList, RelationTerm for RelCompList (silly - merge!) - throws ex if list is empty
 javax.swing.JComboBox getJComboBox()
           
 int getMinCompChars()
           
protected abstract  void getSearchItems(java.lang.String input, SearchListener l, boolean thread)
           
protected  SearchParamsI getSearchParams()
           
protected  java.lang.Object getSelectedObject()
          this is funny for TermCompList this is a CompletionTerm, for RelationCompList this is a RelationTerm - with new OboObject interface these should be merged! this returns a String if the user has not selected a term in the list yet the String is the current User input - rename this! peculiar that the method called is getSelectedItem as the String was never actually selected so with KeyListener on JTextField when get key selectedObj is a null state so returns null if so - can get text straight from TextField in this case if need it
 java.lang.String getText()
          Return text in text field
protected  javax.swing.JList getUIJList()
           
protected  javax.swing.JComponent getUserInputGui()
          Get the component used for user input - text field or jCombo
protected  boolean hasFocus()
           
protected  boolean hasMoreThanOneOntology()
           
protected  boolean hasOntologyChooser()
           
protected  boolean isCompList()
           
protected abstract  void setCharFieldValue(CharFieldValue value)
           
protected  void setForegroundColor(java.awt.Color color)
           
 void setMinCompChars(int minChars)
          no op - override in term completion gui
protected abstract  void setModelToNull()
           
 void setTestMode(boolean inTestMode)
          This is cheesy but theres a hanging bug with showPopup that only happens in test mode - dont know why but doesnt actually matter, so setting flag to turn off showpopup in test - if hangs in nontest will investigate
 void setText(java.lang.String text)
          Set text in editable text field of j combo (eg from table select)
 void setText(java.lang.String text, boolean settingTextExternally)
          text from selecting table doesnt do completion, TestPhenote does
 void simulateKeyStroke(int keyCode, char c)
           
 void simulateLKeyStroke()
           
protected  void updateModel()
          updateModel only if have selected from list
protected abstract  void updateModel(boolean useTopHit)
           
 
Methods inherited from class phenote.gui.field.CharFieldGui
areCharactersEqualForCharField, checkPostCompButton, commitAndSelectNext, editModelEnabled, enableEditModel, focusGained, focusLost, getCharField, getCharFieldEnum, getCompButton, getCurrentOboClass, getCurrentRelation, getDisabledTextColor, getEditManager, getEnabledTextColor, getLabel, getListDelButton, getListGui, getOntologyChooser, getRetrieveButton, getSelectedChars, getSelectionManager, getTermComp, hasChangedMultipleValues, hasCompButton, hasListGui, hasRetrieveButton, isInMultipleValueState, isTermCompList, makeCharFieldGui, makePostCompTermList, makeRelationList, setDoingInternalEdit, setEditManager, setGuiForMultipleValues, setGuiForNoSelection, setHasChangedMultipleValues, setInMultipleValueState, setLabel, setListSelectionModel, setMultipleValuesConditions, setOboClass, setOntologyChooserFromTerm, setRel, setSelectionManager, setUpdateGuiOnly, setValueFromChars, shouldResetGuiForMultipleValues, updateGuiOnly, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAutoCompList

protected AbstractAutoCompList(CharField cf)

AbstractAutoCompList

protected AbstractAutoCompList(CharField cf,
                               int minCompChars)
Method Detail

setMinCompChars

public void setMinCompChars(int minChars)
Description copied from class: CharFieldGui
no op - override in term completion gui

Overrides:
setMinCompChars in class CharFieldGui

getMinCompChars

public int getMinCompChars()
Overrides:
getMinCompChars in class CharFieldGui

getUserInputGui

protected javax.swing.JComponent getUserInputGui()
Description copied from class: CharFieldGui
Get the component used for user input - text field or jCombo

Specified by:
getUserInputGui in class CharFieldGui

getJComboBox

public javax.swing.JComboBox getJComboBox()

isCompList

protected boolean isCompList()
Overrides:
isCompList in class CharFieldGui

getSearchParams

protected SearchParamsI getSearchParams()

getCompListSearcher

public CompListSearcher getCompListSearcher()

getCompList

protected AbstractAutoCompList getCompList()
Description copied from class: CharFieldGui
for testing and internal use - overridden

Overrides:
getCompList in class CharFieldGui

hasOntologyChooser

protected boolean hasOntologyChooser()
Overrides:
hasOntologyChooser in class CharFieldGui

hasMoreThanOneOntology

protected boolean hasMoreThanOneOntology()

setCharFieldValue

protected abstract void setCharFieldValue(CharFieldValue value)
Specified by:
setCharFieldValue in class CharFieldGui

hasFocus

protected boolean hasFocus()
Specified by:
hasFocus in class CharFieldGui

setForegroundColor

protected void setForegroundColor(java.awt.Color color)
Overrides:
setForegroundColor in class CharFieldGui

setText

public void setText(java.lang.String text)
Set text in editable text field of j combo (eg from table select)

Specified by:
setText in class CharFieldGui

setText

public void setText(java.lang.String text,
                    boolean settingTextExternally)
text from selecting table doesnt do completion, TestPhenote does


getText

public java.lang.String getText()
Return text in text field

Specified by:
getText in class CharFieldGui

clear

void clear()

getSelectedObject

protected java.lang.Object getSelectedObject()
                                      throws OboException
this is funny for TermCompList this is a CompletionTerm, for RelationCompList this is a RelationTerm - with new OboObject interface these should be merged! this returns a String if the user has not selected a term in the list yet the String is the current User input - rename this! peculiar that the method called is getSelectedItem as the String was never actually selected so with KeyListener on JTextField when get key selectedObj is a null state so returns null if so - can get text straight from TextField in this case if need it

Throws:
OboException

getFirstCompListObj

protected java.lang.Object getFirstCompListObj()
                                        throws OboException
Get first object in comp list, CompTerm for TermCompList, RelationTerm for RelCompList (silly - merge!) - throws ex if list is empty

Throws:
OboException

getCurrentTermRelName

protected abstract java.lang.String getCurrentTermRelName()
Return the name of the current term or relation - was gonna call this item name but that gets confused with "items" in combo box


setModelToNull

protected abstract void setModelToNull()

setTestMode

public void setTestMode(boolean inTestMode)
This is cheesy but theres a hanging bug with showPopup that only happens in test mode - dont know why but doesnt actually matter, so setting flag to turn off showpopup in test - if hangs in nontest will investigate


getSearchItems

protected abstract void getSearchItems(java.lang.String input,
                                       SearchListener l,
                                       boolean thread)

canGetUIJList

protected boolean canGetUIJList()

getUIJList

protected javax.swing.JList getUIJList()

doMouseOver

public void doMouseOver(int itemNumber)

updateModel

protected void updateModel()
updateModel only if have selected from list

Specified by:
updateModel in class CharFieldGui

updateModel

protected abstract void updateModel(boolean useTopHit)

simulateLKeyStroke

public void simulateLKeyStroke()

simulateKeyStroke

public void simulateKeyStroke(int keyCode,
                              char c)