Adempiere 3.5.2a

org.compiere.grid.ed
Class AutoCompletion

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by org.compiere.grid.ed.AutoCompletion
All Implemented Interfaces:
Serializable, Document

public class AutoCompletion
extends PlainDocument

Auto completion behaviour for a combo box

Author:
phib: this is from http://www.orbital-computer.de/JComboBox with some minor revisions for Adempiere, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1735043 ] AutoCompletion: drop down box is showed even if i press Caps
  • FR [ 1820783 ] AutoCompletion: posibility to toggle strict mode
  • BF [ 1820778 ] ESC(cancel editing) key not working if you are on VComboBox
  • See Also:
    Serialized Form

    Nested Class Summary
     
    Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
    AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
     
    Field Summary
     
    Fields inherited from class javax.swing.text.PlainDocument
    lineLimitAttribute, tabSizeAttribute
     
    Fields inherited from class javax.swing.text.AbstractDocument
    BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
     
    Fields inherited from interface javax.swing.text.Document
    StreamDescriptionProperty, TitleProperty
     
    Constructor Summary
    AutoCompletion(CComboBox comboBox)
               
     
    Method Summary
    static void enable(CComboBox comboBox)
              Enable auto completion for a combo box (strict mode)
    static void enable(CComboBox comboBox, boolean strictMode)
              Enable auto completion for a combo box
     void insertString(int offs, String str, AttributeSet a)
               
     void remove(int offs, int len)
               
     void setStrictMode(boolean mode)
              Set strict mode.
     void setText(String text)
              Set text
     
    Methods inherited from class javax.swing.text.PlainDocument
    createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
     
    Methods inherited from class javax.swing.text.AbstractDocument
    addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AutoCompletion

    public AutoCompletion(CComboBox comboBox)
    Method Detail

    enable

    public static void enable(CComboBox comboBox)
    Enable auto completion for a combo box (strict mode)

    Parameters:
    comboBox -

    enable

    public static void enable(CComboBox comboBox,
                              boolean strictMode)
    Enable auto completion for a combo box

    Parameters:
    comboBox -
    strictMode - true if you want to set strict mode

    remove

    public void remove(int offs,
                       int len)
                throws BadLocationException
    Specified by:
    remove in interface Document
    Overrides:
    remove in class AbstractDocument
    Throws:
    BadLocationException

    insertString

    public void insertString(int offs,
                             String str,
                             AttributeSet a)
                      throws BadLocationException
    Specified by:
    insertString in interface Document
    Overrides:
    insertString in class PlainDocument
    Throws:
    BadLocationException

    setText

    public void setText(String text)
    Set text

    Parameters:
    text -

    setStrictMode

    public void setStrictMode(boolean mode)
    Set strict mode. If the strict mode is enabled, you can't enter any other values than the ones from combo box list.

    Parameters:
    mode - true if strict mode

    Adempiere 3.5.2a

    Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.