gate.gui
Class LuceneDataStoreSearchGUI.QueryTextArea

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JTextArea
                      extended by gate.gui.LuceneDataStoreSearchGUI.QueryTextArea
All Implemented Interfaces:
MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, DocumentListener, Scrollable
Enclosing class:
LuceneDataStoreSearchGUI

protected class LuceneDataStoreSearchGUI.QueryTextArea
extends JTextArea
implements DocumentListener, MouseListener

JtextArea with autocompletion for the annotation types and features, context menu and undo/redo.

See Also:
Serialized Form

Nested Class Summary
private  class LuceneDataStoreSearchGUI.QueryTextArea.CancelAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.DownAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.EnterAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.MultiplierAction
          Add multiplier around the selected expression.
private  class LuceneDataStoreSearchGUI.QueryTextArea.NewLineAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.NextResultAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.PopupFeatureTask
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.PopupTypeTask
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.PreviousResultAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.RedoAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.UndoAction
           
private  class LuceneDataStoreSearchGUI.QueryTextArea.UpAction
           
 
Nested classes/interfaces inherited from class javax.swing.JTextArea
JTextArea.AccessibleJTextArea
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private static String CANCEL_ACTION
           
private static String DOWN_ACTION
           
protected  int end
          offset of the last completion character
private static String ENTER_ACTION
           
protected static int INSERT
           
protected  int mode
           
protected  JPopupMenu mousePopup
           
private static String NEW_LINE
           
private static String NEXT_RESULT
           
protected static int POPUP_FEATURES
           
protected static int POPUP_TYPES
           
private static String PREVIOUS_RESULT
           
protected static int PROGRAMMATIC
           
protected  JList queryList
           
protected  DefaultListModel queryListModel
           
protected  JWindow queryPopupWindow
           
private static String REDO_ACTION
           
protected  LuceneDataStoreSearchGUI.QueryTextArea.RedoAction redoAction
           
protected  int start
          offset of the first completion character
protected  UndoManager undo
           
private static String UNDO_ACTION
           
protected  LuceneDataStoreSearchGUI.QueryTextArea.UndoAction undoAction
           
private static String UP_ACTION
           
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LuceneDataStoreSearchGUI.QueryTextArea()
           
 
Method Summary
 void changedUpdate(DocumentEvent ev)
           
private  void cleanup()
           
private  void createPopup(MouseEvent e)
           
 void insertUpdate(DocumentEvent ev)
           
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void removeUpdate(DocumentEvent ev)
           
private  boolean startsWithIgnoreCase(String str1, String str2)
           
 
Methods inherited from class javax.swing.JTextArea
append, createDefaultModel, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, replaceRange, setColumns, setFont, setLineWrap, setRows, setTabSize, setWrapStyleWord
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENTER_ACTION

private static final String ENTER_ACTION
See Also:
Constant Field Values

NEW_LINE

private static final String NEW_LINE
See Also:
Constant Field Values

CANCEL_ACTION

private static final String CANCEL_ACTION
See Also:
Constant Field Values

DOWN_ACTION

private static final String DOWN_ACTION
See Also:
Constant Field Values

UP_ACTION

private static final String UP_ACTION
See Also:
Constant Field Values

UNDO_ACTION

private static final String UNDO_ACTION
See Also:
Constant Field Values

REDO_ACTION

private static final String REDO_ACTION
See Also:
Constant Field Values

NEXT_RESULT

private static final String NEXT_RESULT
See Also:
Constant Field Values

PREVIOUS_RESULT

private static final String PREVIOUS_RESULT
See Also:
Constant Field Values

queryListModel

protected DefaultListModel queryListModel

queryList

protected JList queryList

queryPopupWindow

protected JWindow queryPopupWindow

mousePopup

protected JPopupMenu mousePopup

undo

protected UndoManager undo

undoAction

protected LuceneDataStoreSearchGUI.QueryTextArea.UndoAction undoAction

redoAction

protected LuceneDataStoreSearchGUI.QueryTextArea.RedoAction redoAction

start

protected int start
offset of the first completion character


end

protected int end
offset of the last completion character


mode

protected int mode

INSERT

protected static final int INSERT
See Also:
Constant Field Values

POPUP_TYPES

protected static final int POPUP_TYPES
See Also:
Constant Field Values

POPUP_FEATURES

protected static final int POPUP_FEATURES
See Also:
Constant Field Values

PROGRAMMATIC

protected static final int PROGRAMMATIC
See Also:
Constant Field Values
Constructor Detail

LuceneDataStoreSearchGUI.QueryTextArea

public LuceneDataStoreSearchGUI.QueryTextArea()
Method Detail

changedUpdate

public void changedUpdate(DocumentEvent ev)
Specified by:
changedUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent ev)
Specified by:
removeUpdate in interface DocumentListener

insertUpdate

public void insertUpdate(DocumentEvent ev)
Specified by:
insertUpdate in interface DocumentListener

startsWithIgnoreCase

private boolean startsWithIgnoreCase(String str1,
                                     String str2)

cleanup

private void cleanup()

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

createPopup

private void createPopup(MouseEvent e)